Join the live talk at Discord.Be part of the conversation athttp://discord.qb64.org.
0 Members and 1 Guest are viewing this topic.
You mean something like this?Code: QB64: [Select]RANDOMIZE TIMERx$ = LTRIM$(STR$(INT(RND * 10 + 1)))DO try = try + 1 LINE INPUT "Guess a number between 1 and 10. "; num$ IF x$ < num$ THEN j = 1 ELSE j = 10 IF num$ = x$ THEN EXIT DO ELSE PRINT MID$("Too high!Too Low!", j, 9)LOOPIF try = 1 THEN PRINT "You guessed it in 1 try!" ELSE PRINT "You guessed it in"; try; "tries!"Pete - I'm really more of a one-liner kind of guy.
Sure, libraries. For instance, I made a keyboard / mouse routine I can use in any program. Steve has one of a similar nature. I suppose if the community promoted library routines, eventually we would wind up adding OOP support to QB64. The push against that. and count me in as a big pusher, is that the spirit of BASIC is to build these routines, not just utilize them. If the community became divided over such philosophical differences, I would simply recommend doing what PowerBASIC did, simply split the project. Have an OOP version and a BASIC version. In regard to PB, that would be their PowerBASIC for WIndows vs PpwerBASIC for DOS. Pete
nobody ask me why, but i just made a game in 10 lines. keep your mouse on the money to gain it, otherwise you lose it. your total is in the titleCode: QB64: [Select]1 i = i + 1DO WHILE _MOUSEINPUT x = INT((_WIDTH - 1) * (_MOUSEX / _WIDTH)) y = INT((_HEIGHT - 1) * (_MOUSEY / _HEIGHT))LOOPPRINT SPACE$(INT(_WIDTH / 2 - 10) * (1 + .25 * COS(i / 20) + .25 * SIN(i / 30))); "|"; STRING$(7 * (1 + ABS(COS(i / 10))), "$"); "|"IF (SCREEN(1 + y, 1 + x, 0) = 36) THEN t = t + 1 ELSE t = t - 1_TITLE "$:" + STR$(t)_LIMIT 30GOTO 1