Here is My first, and really only "real program" Unless you call the "hello world"
stuff a program, but I think of those a Demos,...
This is my very first program,
I had some help, useing the tutorial, by Ted Felix,but mostly I pretty much did it myself , IOPNN, another guy, also helped me a little,...this also is a example,to show, you can post stuff like this in the genral forum, start yur own thread, or add to exising threads, for example, someone else that wants to show theyer first programs, could add to this,..or comment on this...etc.
Most of this is in spanish, as it was for my step son, whom dose not speak english....but yu should be able to figure it out...it runs on both qb4.5 and qb64....it was started originaly in qbasic, and then when I wanted to make it a stand alone, I learned about qb4.5, and qb64....
SCREEN 0
WIDTH 80
PRINT "Program BY:Garry Ricketson."
PRINT "E-mail:GarryRicketson@yahoo.com, http://www.garryspages.webs.com"
PRINT "Note: this is not a game nor intended to be real fun,if you don't"
PRINT "get the right answer, you cannot move on,Alfonso dose not like to,"
PRINT "study his X tabels,but he loves to play the computer games(san"
PRINT "Andreas auto theft) is his favorite. So, the idea is the faster"
PRINT "he learns the tabels, the sooner he can play his game, when he"
PRINT " completes the whole program, I then let him play with the computer"
PRINT "I hope anyone else can also use it."
PRINT "I would like to thank:Ted Weissgerber, for his Q-BASICS tutorial program"
PRINT " as I used part of the code he demonstrates, and also others at "
PRINT "http://www.petesqbsite.com, whom quickly answered questions, and also"
PRINT "where I got the tutorials I used, a anonymos,IOPNN, sent me corrected"
PRINT "code, and this was a great help.for more see the readme.txt in this"
PRINT "package, you may copy,use or edit, but cannot sell it"
SLEEP 5
SCREEN 0
WIDTH 40
COLOR 10, 1
PRINT "VAMOS a HACER TABLAS"; ""
PLAY "aaaa4bbb8<ggg4a2e8gggg>a4f8e2ccca4a4a4"
PRINT "tecla q para salir, intro para continuar"
PRINT "press q to exit tecla q para salir"
PRINT "Cualquire tecla para continuar"
INPUT "q", Q$
IF Q$ = "q" THEN END
SLEEP 5
PRINT "!Bienvenido!,WELCOME!... "
PRINT "Nada para decir ahora "
PRINT "ES una ejercisio de tablas, lo gue hizo para Alfonso,These are "
PRINT "multiplication tabels I made for Alfonso"
INPUT "ENTER YOUR NAME,escribe tu nombre:", name$
PRINT "HOLA!,"; name$; ".¨como estas,hoy?"
CLS
COLOR 17, 10, 2
PRINT "²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²"
PRINT "------------------------------------"
PRINT "²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²"
PRINT "² ²"
PRINT "² ̃ ̃ ²"
PRINT "² ̃̃ ²"
PRINT "² ̃ ̃ OLA! ²"
PRINT "² Alfonso....... ²"
PRINT "² ²"
PRINT "² ²"
PRINT "²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²"
SLEEP 5
CLS
COLOR 10, 1, 2
PRINT "HOLA!,Alfonso, vamos a hacer tablas"
PRINT "Ahora vamos acer Multiplicaciones(tablas)"
COLOR 14: PRINT "Buenos Dias"
FOR d = 600 TO 640
SOUND d, 1
NEXT
SLEEP 2
CLS
COLOR 14: PRINT "Buenos Dias"
FOR d = 600 TO 640
SOUND d, 1
NEXT
SLEEP 2
CLS
TOP:
COLOR 2: PRINT "puede ser este cosas "
PRINT
PRINT "(T)tablas"
PRINT "(C)alculator"
PRINT "(J)juego"
PRINT "(S)alir de programa"
ReHit: F$ = INPUT$(1) 'INPUT$ will wait for a keypress.
1 IF LCASE$(F$) = "t" THEN GOTO TABLAS
IF LCASE$(F$) = "c" THEN GOTO Calculater
IF LCASE$(F$) = "j" THEN GOTO GAME
IF LCASE$(F$) = "s" THEN END
GOTO ReHit
TABLAS: PRINT "Esos son los tablas"
RANDOMIZE TIMER
CLS
FOR i = 0 TO 100
x = INT(RND * 10) + 1 'if you want say only 9s or only 7s, change
'this to x=9 or x=7 ...
y = INT(RND * 10) + 1
PRINT x; "X"; y; "=";
INPUT "", n
IF x * y <> n THEN
PRINT "NOT CORRECT"
INPUT "Entra el primero numero: ", a
INPUT "Entra el segundo numero: ", b
PRINT "Respuesta corecto es: "; a * b 'now I am closer, on the
'previous that I sent 'you I had forgotten the b on this line.
ELSE
PRINT "CORRECT"
PRINT
END IF
NEXT
GOTO TOP:
Calculater:
PRINT "Eso es Calculador"
5 CLS
PRINT "1) ADD"
PRINT "2) MULTIPLY"
PRINT "3) DIVIDE"
PRINT "4) SQUARE ROOT"
PRINT "5) EXIT"
INPUT i
IF i = 1 GOTO 10
IF i = 2 GOTO 20
IF i = 3 GOTO 30
IF i = 4 GOTO 40
IF i = 5 GOTO TOP:
10 CLS: PRINT "INPUT NUMBER"
INPUT a
CLS
PRINT "INPUT NEXT NUMBER"
INPUT b
CLS
PRINT a + b
PRINT "PRESS SPACE TO RUN"
SLEEP 0
GOTO 5
20 CLS: PRINT "INPUT NUMBER"
INPUT C
CLS
PRINT "INPUT NEXT NUMBER"
INPUT d
CLS
PRINT C * d
PRINT "PRESS SPACE TO RUN"
SLEEP 0
GOTO 5
30 CLS: PRINT "INPUT NUMBER"
INPUT E
CLS
PRINT "INPUT NEXT NUMBER"
INPUT F
CLS
PRINT E / F
PRINT "PRESS SPACE TO RUN"
SLEEP 0
GOTO 5
40 CLS: PRINT "INPUT NUMBER"
INPUT G
CLS
PRINT SQR(G)
PRINT "PRESS SPACE TO RUN"
SLEEP 0
GOTO 5
GOTO TOP:
'----------------------------------insert calculator
GAME:
DEFINT A-Z
DECLARE SUB Align (Tclr, Trow, txt$)
SCREEN 0
WIDTH 80
'DEFINT A-Z
'DECLARE SUB Align (Tclr, Trow, txt$)
Align 14, 5, "MIRA ,LO QUE HIZO"
Align 14, 8, " AQUI ES TU JUEGO"
Align 15, 10, "TECLA INTRO PARA SALIR " + Prt$ + "NO, PARA JUEGAR" + Qt$
DO: LOOP UNTIL INKEY$ <> ""
CLS
TOPB:
FOR i% = 2 TO 24
Align 13, i%, "El Cielo es Caiendo!"
Align 13, i% - 1, SPACE$(19)
SOUND 2000 / i%, 1
NEXT i%
Align 14, 5, "Alfonso, siempre quiere jugar"
Align 18, 15, "Dice Blinky blinky blinky, estoy abburido"
Align 15, 10, "Tecla el Q para salir"
IF INKEY$ = "Q" THEN END
GOTO TOPB:
SUB Align (Tclr, r0w, txt$)
c0l = 41 - (LEN(txt$) \ 2)
COLOR Tclr: LOCATE r0w, c0l: PRINT txt$;
END SUB
Enjoy it, and let me know if there are any problems...
from Garry
thanks
It has been so long, I forgot,..when you run this, once you start with the multiplication tabels, you can not exit until, yu complete the tabels, I had done that on purpose, so that he had to complete the tabels, you can exit with control -pause, but I would like to make it so yu can exit the "tablas", but not the prgram, just return to the start menu,..but never did gigure out how.....if anyone can show me that...
from Garry
So, any other members, feel free, to post similar, question/samples or comments, in this part GENERAL FORUM, as well as specific categorys....hope this ends some of the confusion.
--------------------------
When I did the pogram, I did not have internet access in my, home, I had copied the tutorial to my portable USB HD, or a data stick, I don't remember, at a internet cafe,...then at home ,off line, studying the tutoria, and useing samples in it, I put something together that worked, but it was close to 300
lines long!, when I posted it, on petesqbsite, a guy , called IOPNN, showed me a better way,
RANDOMIZE TIMER
CLS
FOR i = 0 TO 100
x = INT(RND * 10) + 1 'if you want say only 9s or only 7s, change
'this to x=9 or x=7 ...
y = INT(RND * 10) + 1
PRINT x; "X"; y; "=";
INPUT "", n
IF x * y <> n THEN
PRINT "NOT CORRECT"
INPUT "Entra el primero numero: ", a
INPUT "Entra el segundo numero: ", b
PRINT "Respuesta corecto es: "; a * b 'now I am closer, on the
'previous that I sent 'you I had forgotten the b on this line.
ELSE
PRINT "CORRECT"
PRINT
END IF
Much shorter, Later, Ted Felix helped too,...
This part came from "Clippys Demos" (tutorial)
DEFINT A-Z
DECLARE SUB Align (Tclr, Trow, txt$)
SCREEN 0
WIDTH 80
'DEFINT A-Z
'DECLARE SUB Align (Tclr, Trow, txt$)
Align 14, 5, "MIRA ,LO QUE HIZO"
Align 14, 8, " AQUI ES TU JUEGO"
Align 15, 10, "TECLA INTRO PARA SALIR " + Prt$ + "NO, PARA JUEGAR" + Qt$
DO: LOOP UNTIL INKEY$ <> ""
CLS
TOPB:
FOR i% = 2 TO 24
Align 13, i%, "El Cielo es Caiendo!"
Align 13, i% - 1, SPACE$(19)
SOUND 2000 / i%, 1
NEXT i%
Align 14, 5, "Alfonso, siempre quiere jugar"
Align 18, 15, "Dice Blinky blinky blinky, estoy abburido"
Align 15, 10, "Tecla el Q para salir"
IF INKEY$ = "Q" THEN END
GOTO TOPB:
SUB Align (Tclr, r0w, txt$)
c0l = 41 - (LEN(txt$) \ 2)
COLOR Tclr: LOCATE r0w, c0l: PRINT txt$;
END SUB
from Garry