# Qbasicnews.com

## QbasicNews.Com => Challenges => Topic started by: VonGodric on November 02, 2004, 08:39:04 AM

 Title: Yet another game challenge...:D Post by: VonGodric on November 02, 2004, 08:39:04 AM I was doing some stuff in VB and using option explicit when I came to an idea. There are lot of game challenges like on line and four line or each keyword only once and stuff like that. Well here's another one of that kind. Game (but can be any other program too)  challenge where you can use  each data type only once. Variables allowed:[/color]NO constants one integerone longone singleone doubleone string Title: Yet another game challenge...:D Post by: whitetiger0990 on November 02, 2004, 01:19:50 PM [syntax="QBASIC"]CLSRANDOMIZE TIMERDIM SHARED stringvar AS STRINGDIM integervar AS INTEGERDIM longvar AS LONGDIM singlevar AS SINGLEDIM doublevar AS DOUBLEOPEN "vars.dat" FOR RANDOM AS #1stringvar = "pineapple"'1 = x'2 = y'3 = xv'4 = yvSCREEN 13stringvar = "50"PUT #1, 1, stringvarstringvar = "50"PUT #1, 2, stringvarstringvar = "0"PUT #1, 3, stringvarstringvar = "1"PUT #1, 4, stringvarPSET (INT(RND * 320) + 1, INT(RND * 200) + 1), 1DOGET #1, 1, stringvarintegervar = VAL(stringvar)GET #1, 2, stringvarsinglevar = VAL(stringvar)IF POINT(integervar - 2, singlevar) = 1 THEN ENDIF POINT(integervar, singlevar - 2) = 1 THEN ENDIF POINT(integervar + 2, singlevar) = 1 THEN ENDIF POINT(integervar, singlevar + 2) = 1 THEN ENDPSET (integervar - 1, singlevar), 0PSET (integervar, singlevar - 1), 0PSET (integervar + 1, singlevar), 0PSET (integervar, singlevar + 1), 0PSET (integervar, singlevar), 4GET #1, 3, stringvarintegervar = integervar + VAL(stringvar)stringvar = STR\$(integervar)PUT #1, 1, stringvarGET #1, 4, stringvarsinglevar = singlevar + VAL(stringvar)stringvar = STR\$(singlevar)PUT #1, 2, stringvarSELECT CASE INKEY\$CASE "q": ENDCASE "s" stringvar = "0" PUT #1, 3, stringvar stringvar = "1" PUT #1, 4, stringvarCASE "w" stringvar = "0" PUT #1, 3, stringvar stringvar = "-1" PUT #1, 4, stringvarCASE "a" stringvar = "-1" PUT #1, 3, stringvar stringvar = "0" PUT #1, 4, stringvarCASE "d" stringvar = "1" PUT #1, 3, stringvar stringvar = "0" PUT #1, 4, stringvarEND SELECTdoublevar = TIMERDO: LOOP UNTIL TIMER - doublevar > .01LOOP[/syntax]the object is to run into the blue dot. i think....