That works a treat..thanks.....

by unseenmachine (Login unseenmachine)
R

 
as always, a but.

When i input the letters, i cannot seem to get them to locate properly, they are on the right line, but wrong column...any ideas?....UNSEEN

'COUNTDOWN VERSION V.01
DIM RNDVWL(5) AS INTEGER, rndcon(6) AS INTEGER, USRSCR AS INTEGER
DIM LTR(9) AS STRING, ltrcnt AS INTEGER
DIM LTRX AS INTEGER, LTX AS INTEGER, usrnme AS STRING
DIM vwlcnt AS INTEGER, concnt AS INTEGER
RANDOMIZE TIMER
SCREEN 12
CLS

'MOUSE
DIM m(8) AS LONG, mb AS INTEGER, MX AS INTEGER, MY AS INTEGER
m(0) = &H8BE58955
m(1) = &H78B0C5E
m(2) = &HD88933CD
m(3) = &H890A5E8B
m(4) = &H85E8B07
m(5) = &H5E8B0F89
m(6) = &H5D178906
m(7) = &H8CA
DEF SEG = VARSEG(m(0))

'initial values
vwlcnt = 0: ltrcnt = 0
LTRX = 18: USRSCR = 0: LTX = 140
TILE$ = "L11H3U22E3R22F3D22G3L11"
BTN$ = "L40H3U20E3R80F3D20G3L40"
TPBTN$ = "L100H3U20E3R200F3D20G3L100"

COLOR 11: LOCATE 2, 32: PRINT "Countdown v.01"
COLOR 3: LOCATE 3, 32: PRINT "--------------"
DO
COLOR 15: LOCATE 5, 1: INPUT "Enter your name : ", usrnme$
LOOP UNTIL usrnme$ > ""
LOCATE 5, 1: PRINT SPACE$(78)
LOCATE 5, 2: PRINT "Welcome "; usrnme$; " to CountDown"
LOCATE 7, 2: PRINT "To play choose 9 letters. You must have at least 3 vowels and "
LOCATE 9, 2: PRINT "4 consonants. Use the letters to make as big a word as possible."
LOCATE 11, 2: PRINT "Once you have chosen all nine, the timer will start. "
LOCATE 13, 2: PRINT "You have 30 seconds to type in your words...Enjoy."
SLEEP 20
CLS

'SHOW MOUSE, DRAW BUTTONS, DRAW BANNER
CALL absolute(1, mb, MX, MY, VARPTR(m(0)))
COLOR 5: PSET (163, 403): DRAW BTN$
COLOR 5: LOCATE 25, 19: PRINT "VOWEL"
COLOR 3: PSET (443, 403): DRAW BTN$
COLOR 3: LOCATE 25, 52: PRINT "CONSONANT"
COLOR 15: PSET (303, 52): DRAW TPBTN$
COLOR 10: LOCATE 3, 30: PRINT "*** COUNTDOWN ***"
COLOR 15

'Reset word list
OPEN "c:\wrdlist.lst" FOR OUTPUT AS #1
CLOSE #1

DO

DO
CALL absolute(3, mb, MX, MY, VARPTR(m(0)))
LOCATE 2, 1: PRINT MX; ":"; MY; ":"; mb
LOCATE 3, 1: PRINT mb; ":"; vwlcnt; ":"; concnt; ":"; ltrcnt
LOOP WHILE mb <> 1

IF MY > 377 AND MY < 403 THEN
'Vowel Button

IF MX > 119 AND MX < 205 THEN
IF vwlcnt < 4 THEN
DO
RNDVWL(vwlcnt) = INT(RND * 25) + 65 'needs to be only vowels
LTR(ltrcnt) = CHR$(RNDVWL(vwlcnt))
LOOP UNTIL LTR(ltrcnt) = "A" OR LTR(ltrcnt) = "E" OR LTR(ltrcnt) = "I" OR LTR(ltrcnt) = "O" OR LTR(ltrcnt) = "U"
PSET (LTX, 165): DRAW TILE$
LOCATE 10, LTRX: PRINT LTR(ltrcnt)
vwlcnt = vwlcnt + 1: LTX = LTX + 40: LTRX = LTRX + 5: ltrcnt = ltrcnt + 1
END IF
END IF

'Consonant Button
IF MX > 399 AND MX < 487 THEN
IF concnt < 6 THEN

DO
rndcon(concnt) = INT(RND * 25) + 65
LTR(ltrcnt) = CHR$(rndcon(concnt))
LOOP WHILE LTR(ltrcnt) = "A" OR LTR(ltrcnt) = "E" OR LTR(ltrcnt) = "I" OR LTR(ltrcnt) = "O" OR LTR(ltrcnt) = "U"

PSET (LTX, 165): DRAW TILE$
LOCATE 10, LTRX: PRINT LTR(ltrcnt)
LTX = LTX + 40: LTRX = LTRX + 5: concnt = concnt + 1: ltrcnt = ltrcnt + 1
END IF
END IF
END IF


'Reset Mouse
DO
CALL absolute(3, mb, MX, MY, VARPTR(m(0)))
LOOP UNTIL mb = 0
LOOP UNTIL ltrcnt = 9

'usr input bit - not working properly

START! = TIMER

DO
NOW! = TIMER: CURRENT% = 30 - (NOW! - START!)
LOCATE 16, 30: PRINT "Time remaining (secs) : "; CURRENT%
kb$ = INKEY$
WORD$ = WORD$ + kb$
IF INKEY$ = CHR$(13) OR LEN(WORD$) > 10 THEN
OPEN "c:\wrdlist.lst" FOR APPEND AS #1
PRINT #1, WORD$
CLOSE #1
LOCATE 14, 20: PRINT SPACE$(LEN(WORD$))
WORD$ = ""
END IF
LOCATE 14, 20: PRINT WORD$
LOOP WHILE TIMER < START! + 30

Posted on Dec 31, 2009, 9:35 AM

Respond to this message   

Return to Index

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