[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Apple II Random Events?
dalloff@freenet.columbus.oh.us (Dave Althoff) wrote:
> : > 50 REM GET A KEY (RETURNS ASCII CODE IN AC)
> : > 60 ZZ= RND(1): ZZ= PEEK(49152): IF ZZ<128 THEN 60
> : > 70 AC= ZZ-128: ZZ= PEEK(49168): RETURN
>
> A quick trick for Applesoft programmers waiting for a keypress...
Nice trick, Dave. For a no-frills "wait for keypress", I usually
did something like this:
60 WAIT -16384,128: GET C$: RETURN
I've met many Applesoft programmers who, for some reason, had
never heard of the WAIT instruction.
For extra credit, can you think of a situation where the optional
third argument to WAIT is useful?
Paul Guertin
pg@sff.net