Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Submitted, for your approval.

From: edanaii:cox at: 27-May-2002 19:01

Ammon Johnson wrote:
> Hmm... Some things that i found: > > Does this confuse anyone else? > > What is your guess? *@#%& > Matched: 2 Placed: 3 > > What is your guess? &@#%* > Matched: 2 Placed: 3 >
Hmmm... Without knowing the details of what the computer had chosen, it's hard to say, but this is a possible scenario. It is possible to move symbols around and still get the same results. Remember, it is only reporting on the symbols that match and place, but it is not telling you which have matched and placed. So it's possible when you switch them around that symbols go from placed to matched and back again and still total the same.
> I also noticed this: > > What is your guess? ^@#&* > Not all the choices you've made are valid. > Please make your choices from the following Symbols: ~ ! @ # $ % & * >
This is because the ^ is not legal. I tried using it in REBOL and it gave me the following grief: ** Syntax Error: Invalid string -- " ] ** Near: (line 54) Symbol_Set: [ "~" "!" "@" "#" "$" "%" "^" "&" ] It doesn't like the ^ symbol, for whatever reason...
> now watch what happens here: > > What is your guess? @#&*^ > Matched: 4 Placed: 1 >
What??? Bugs in my code! No way! OK, OK, I guess I gotta fix it! That one is definitely a bug in my code.
> You might also consider asking the user if he/she would like instructions at > the first of the game, I was rather confused to start with so I read the > source code. It would be much more intuitive to have it inform you of too > many or too few symbols. >
Well, since this was more an attempt to learn REBOL than it was to create a serious game, I just wasn't focused on complete instructions, that's why I used the document feature rather than making it accessible while running. As to the "too many or too few" issue. It does tell the user that. This appears to be a bug in REBOL. As it turns out, since I wrote my sub-routines as refinements, if I call the refinement with it's proper prefix (i.e. Symbols/Indicate_only_5), the script runs as expected. If, OTOH, I forget to prefix it, which was my mistake (i.e. Indicate_only_5), the script runs, but the refinement does not execute. Curious... -- Sincerely, | Ed Dana | Courage is fear holding on a minute longer. Software Developer | -- General George S. Patton 1Ghz Athlon Amiga |