Forum Discussion

EnTerr's avatar
EnTerr
Roku Guru
9 years ago

? ... --- ...

Today's wisecrack: did you know B/S implicitly supports Morse code? 😛

Pop-quiz: "So you think you know BrightScript? Try to guess what the following will output:"
Brightscript Debugger> ? ... --- ...

3 Replies

  • haha same thing this outputs:

    ? ...


    if you end with a hyphen, you get a syntax error.  if you print a dot, it outputs a zero.  fun stuff!
  • "joetesta" wrote:
    if you end with a hyphen, you get a syntax error.

    So we shan't signal messages that end in any of 'AJKMOQTUVWXY' 8-)

    if you print a dot, it outputs a zero.  fun stuff!

    it's tad more complicated than that. SOS does not output 6 zeros
  • "EnTerr" wrote:
    it's tad more complicated than that. SOS does not output 6 zeros

    Is it?

    ? ......



    Brightscript Debugger> ? ......
     0 0 0 0 0 0

    Well something tricky is going on;

    Brightscript Debugger> ? -.-.-.-.-.-.
     0

    Brightscript Debugger> ? ------......
     0

    Brightscript Debugger> ? ------ ......
     0

    Brightscript Debugger> ? - .....
     0 0 0 0
     
    Brightscript Debugger> ? -- .....
     0 0 0

    Brightscript Debugger> ? --- ...
     0

    Brightscript Debugger> ? --- ..
     0

    Brightscript Debugger> ? --- ........
     0 0 0 0 0

    So it seems each leading hyphen will remove one following period, but if there are any following periods it will always output at least one zero no matter how many leading hyphens there are.
    hmm - no, these are not simple rules!

    Brightscript Debugger> ? .....-----.
     0 0 0 0 0