Use the alphabet count like this........

by (Login burger2227)
R

 

Seems you don't need anything before the alphabet in the string.

a = 1 and z = 26 is all you need. Not so hard. Example uses the A key to go left and D key to go right:

alph$ = "abcdefghijklmnopqrstuvwxyzabcdefghi"

position = 1
DO:
K$ = UCASE$(INKEY$)
IF K$ = "A" THEN position = position -1
IF K$ = "D" THEN position = position + 1
IF position > 26 THEN position = 1
IF position < 1 THEN position = 26
show$ = MID$(alph$, position, 10)
LOCATE 10, 10: PRINT show$
IF K$ <> CHR$(27) THEN SLEEP
LOOP UNTIL K$ = CHR$(27)

Posted on Jan 23, 2010, 2:47 PM

Respond to this message   

Return to Index

Response TitleAuthor and Date
* That's nice. Are you available for kid parties, too? on Jan 23
 * No I'm busy trying to figure out what to do with the W and S keys right now. on Jan 23
  * Rats, we needed a paper clip to help hold up the pinata. Good luck with keys. :) on Jan 23
  I know! .......W to capitalize and S to lower case them. Code... on Jan 23

 Copyright © 1999-2014 Network54. All rights reserved.   Terms of Use   Privacy Statement