1. Number Input

I'm starting to write a slot machine game in Euphoria, but I seem to=

have one hangup:  how do I let the player enter numbers (such as a bet),
and have the variable equal the number entered and not the ASCII number? =

For example (this could be used for the poker game I am planning to write=
):
 say a player wants to enter a bet.  They enter "15", but the sequence
variable is set to {49,53}  After they enter 15, I would have to subtract=

that amount from their bank, but I don't think using ASCII numbers would =
do
me any good, see what I'm saying?
     I would appreciate any help.

Regards,
  Bryan Watts

new topic     » topic index » view message » categorize

2. Re: Number Input

Bryan wrote:
> . . .how do I let the player enter numbers (such as a bet),
>and have the variable equal the number entered and not the ASCII number? >
. . .<skipped> . . . They enter "15", but the sequence
>variable is set to {49,53} . . .

     Bryan, I think the value() function would get the result you need.  You
will have to include get.e to use it, but it should return the number 15
from the string "15", etc.
     You may want to check the library.doc file on this function, as I
believe it actually returns a sequence with the first(second?)element being
a status indicator.

Craig

new topic     » goto parent     » topic index » view message » categorize

3. Re: Number Input

Reply:

>Bryan wrote: > . . .how do I let the player enter numbers (such
>as a bet), >and have the variable equal the number entered and
>not the ASCII number? > . . .<skipped> . . . They enter "15",
>but the sequence >variable is set to {49,53} . . .

>     Bryan, I think the value() function would get the result
>you need.  You will have to include get.e to use it, but it
>should return the number 15 from the string "15", etc.      You
>may want to check the library.doc file on this function, as I
>believe it actually returns a sequence with the
>first(second?)element being a status indicator.

>Craig =


Bryan,

Maybe you can use the input function, written by 'unknown coder' (actuall=
y
a corporate attempt of some coders). This function can also be found on t=
he
ftp site of Irv Mullins.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu