Weekly Qbasic and Qb64 Lesson Topics
March 19, 2024, 02:01:26 am
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Want to see a specific Tutorial? ASK!
 
  Home Help Search Arcade Links Staff List Login Register  

What I have so Far,Learning program

Pages: [1] 2
  Print  
Author Topic: What I have so Far,Learning program  (Read 1644 times)
GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« on: May 11, 2011, 08:11:07 am »

This is not much, but here is what I have so far,..it is a idea I have for a "learning Program"....
Code:
   LOCATE 5, 30
PRINT "INTRODUCTION"
PLAY "10aaa4gg1bb10e2g1a"
LOCATE 8, 4
PRINT " This is a program to learn, for very young children, and adults too"
PRINT " Eso es una programa, para ni¤os, y tambien adultos"
PRINT " Es deficil, porque no estoy seguro, por donde empieza"
PRINT " This is hard because I am not sure where to start."
PRINT " It has become obvious, if the person or child dose not know how to read,"
PRINT " I either need to use some voice instruction, or they need some, guidance."
PRINT "Neccistas un guia, o voz, por algunos los quein,no sabes nada de leer"
INPUT ; "press enter to continue,prende intro para continuar ", dummy$
_DELAY 3

SCREEN 12
WIDTH 40
COLOR 15: LOCATE 10, 12: PRINT SPACE$(20)
COLOR 14: LOCATE 10, 12: INPUT "Name: ", name$
PRINT "hello,hola "; name$
INPUT ; "press enter to continue,prende intro para continuar ", dummy$
CLS

COLOR 5: LOCATE 12, 18
WIDTH 40
PRINT "A"
'_playsnd later, "this is A
INPUT "Letter: ", letter$
'-------------------------------
'IF    Not A , try again



'----------------------------------
'  ELSE
PRINT " Bien,te escribe ,Good You wrote "; letter$
_DELAY 1
INPUT ; "press enter to continue,prende intro para continuar ", dummy$
PRINT "Good,you typed,"; letter$
INPUT ; "press enter to continue,prende intro paracontinuar ", dummy$
PRINT "Sorry , thats all for now"



   
Any sugestions are welcome..
from Garry
Report Spam   Logged

Share on Facebook Share on Twitter

OlDosLover
Guest
« Reply #1 on: May 11, 2011, 08:19:09 am »

Hi all,
    I see you are comparing what was the user entered to a constant (letters of the alphabet).
Code:
PRINT "A"

INPUT "Letter: ", letter$
'-------------------------------
IF    letter$ <> "A" then
  'redo (redirect) this input or fall through to the next statement below the end if.
End If

or

While letter$ <> "A"
  INPUT "Letter: ", letter$
WEND
Could you post a description of what you want your program to do from start to finish please Garry. This would be our "definition of the problem" with which we would break it down into smaller problem and solve.
OlDosLover.
« Last Edit: May 11, 2011, 08:28:58 am by OlDosLover » Report Spam   Logged
OlDosLover
Guest
« Reply #2 on: May 11, 2011, 09:27:59 am »

Hi all,
    Here's a stripped down version of your program Garry. It works except for the exit of the program.
Code:
SCREEN 12
LOCATE 5, 30
PRINT "INTRODUCTION"

LOCATE 8, 4
PRINT " This is a program to learn, for very young children, and adults too"
PRINT " Eso es una programa, para ni¤os, y tambien adultos"
PRINT " Es deficil, porque no estoy seguro, por donde empieza"
PRINT " This is hard because I am not sure where to start."
PRINT " It has become obvious, if the person or child dose not know how to read,"
PRINT " I either need to use some voice instruction, or they need some, guidance."
PRINT "Neccistas un guia, o voz, por algunos los quein,no sabes nada de leer"
PRINT
PRINT "press enter to continue,prende intro para continuar "
dummy$ = INPUT$(1)

CLS

DO
  PRINT "Press the LETTER please"
  z = INT(RND * 26) + 66
  PRINT CHR$(z)
  WHILE Letter$ <> CHR$(z)
    INPUT "Letter: ", Letter$
    Letter$ = UCASE$(Letter$)
  WEND
  PRINT " Bien,te escribe ,Good You wrote "; Letter$
  _DELAY 1
  CLS
LOOP UNTIL _KEYDOWN(27)

PRINT "Sorry , thats all for now"
SLEEP
SYSTEM
It would probably better to use inkey than input.
OlDosLover.
« Last Edit: May 11, 2011, 09:29:48 am by OlDosLover » Report Spam   Logged
OlDosLover
Guest
« Reply #3 on: May 11, 2011, 10:07:05 am »

Hi all,
    Here is a better version that generates random letters that fall downward the screen. If the user misses the letter at bottom of the sceen it continues on. If the user pressed the corrct letter then it prints that.
Code:
SCREEN 12
LOCATE 5, 30
PRINT "INTRODUCTION"

LOCATE 8, 4
PRINT " This is a program to learn, for very young children, and adults too"
PRINT " Eso es una programa, para ni¤os, y tambien adultos"
PRINT " Es deficil, porque no estoy seguro, por donde empieza"
PRINT " This is hard because I am not sure where to start."
PRINT " It has become obvious, if the person or child dose not know how to read,"
PRINT " I either need to use some voice instruction, or they need some, guidance."
PRINT "Neccistas un guia, o voz, por algunos los quein,no sabes nada de leer"
PRINT
PRINT "press enter to continue,prende intro para continuar "
dummy$ = INPUT$(1)
RANDOMIZE TIMER

CLS


DO
  PRINT "Press the LETTER please"
  z = INT(RND * 26) + 65
  Dir = INT(RND * 2) + 1
  RRow% = 1: CCol% = 40: DDelay! = 1

  DO
    LOCATE RRow%, CCol%
    PRINT CHR$(z)
    Letter$ = INKEY$
    IF UCASE$(Letter$) = CHR$(z) THEN EXIT DO
    RRow% = RRow% + 1: IF Dir = 1 THEN CCol% = CCol% + 1 ELSE CCol% = CCol% - 1
    _DELAY DDelay!
    DDelay! = DDelay! - .03 '<-- greater than .03 leads to error
  LOOP WHILE RRow% < 29
  PRINT " Bien,te escribe ,Good You wrote "; Letter$
  _DELAY 1
  CLS
LOOP UNTIL _KEYDOWN(27)
PRINT "Sorry , thats all for now"
SLEEP
SYSTEM
    This was the first learning program that i wrote for my daughter about 18 years ago. This is the QB64 equivalent.
OlDosLover.
Report Spam   Logged
GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« Reply #4 on: May 11, 2011, 07:34:38 pm »

Hello All,
Quote
Could you post a description of what you want your program to do from start to finish please Garry. This would be our "definition of the problem" with which we would break it down into smaller problem and solve.
OlDosLover.   
Ok,I may also put a program I have, (for Dos), on Drop Box,
it dosen't run real well,...but it would be a good example,...I am not sure I still have it. It should be ,hopefully later tonight,...I will write a description,...It seems like it is fairly complex, in some ways, but your approach, to break it down,...is good, each stage, probably is not that complicated, I am sure you have seen Clippys, qbasics demo,...I like the "flow", it has, how the first page ,is a index of chapters,..you can either, start at chapt 1, or enter the chapter number....
Then each chapter is also, "pages" or segments,...the only thing I don't particuly like, is he never put in a , "go back" option,...so is one wants to go back to the previous "page" or a previous chapter, the only way is to exit and start again, select the chapter, work your way up to the part you want---
 A similar,...but instead of code, early learning of first, the letters, and numbers,
,simple words, spelling them correctly, and perhaps, toward the end some very basic math,...a small , "music", chapter, where the child can enter the basic notes, and perhaps play a simple tune,..and then of course a simple drawing/paint option,.....Perhaps, it be better, instead of entering a chapter number,  a "click" menu, Letters, Numbers, Words and Spelling, Math, Music, Drawing,... we do have various "draw and paint",. programs,so that would be pretty easy, in away, this is not to bad of a description,....Where is the best place to start ?,...it seems, like the "menu" or index,...Like I mentioned, assumeing the user, is a very young child, and can not hardly read yet,...we will need to also do some "sound tracks",...the idea is, to make it as much possible, something a child, could do, without much if any supervision,.... We have already, been covering alot of the "bits and pieces",...in your lessons , and tuts,.....Unseens GDK, may very well be the better way to go,...for one, the colors, are so much nicer "vivid", etc,....I already have found, it is pretty easy to insert _sndplay ( I think it was, I have sort of forgotten,) but In the catch the Bunny it was real easy to insert the music, useng midi, or wav, it would be relatively easy to make recordings, and put the "voice" in.
 I do have some code that, can make the computer "talk", useing  MS sam,..but the words are not all that clear,...I think recordings would be better.
 I guess this may seem like alot, but there is no hurry---I am still going to take the time, to write, a better description, I probably will have to attach it as a text file, or put it on drop box,......Obviuously, this will take some time, and perhaps, several people, if others get interested,...If we really got ambitous,we could do one ver1, for kindargarden, ages, Later another, more advanced, that also included some very basic codeing lessons, along with, math,...At the moment it almost seems over whelming, and impossible, but this is cause I am a little tired,...I haven't tryd any of your code yet, but will, as soon as I close this, just to explain why I didn't mention any of it,...in this post, I am anxious to see, the one you did for your daughter,...in relation to my grandchildren, and the one about to be born, it will still be a couple of years, before any of them could use this,...So there is lots of time...
from Garry
Report Spam   Logged

OlDosLover
Guest
« Reply #5 on: May 12, 2011, 02:04:43 am »

Hi all,
    From your post i have garnered this as the code idea:
Quote
   EARLY LEARNING PROGRAM
Letter recognition
Number recognition

Simple Spelling
Siimple Maths
Simple Music
Simple Drawing

A master menu , mouse selection, for all of the above topics

    This is achievable. As to the GDK colors , the GDK uses the same _rgb32(r,g,b) as standard QB64 programs. It may be the choice of colors and the use of many similar individual colors that unseen used to compose a picture. This could be done in GDK. This could also be done in standard QB64 and then converted into the GDK.
    I'd prefer that it be done in standard QB64 and later converted. GDK is always being improved. Unseen is the only one fluent in the library. By having 2 versions (standard and gdk) gives the community a choice. ATM we can break this up into simple sections that get stuck back together to compose the complete program.
    If this is what you envisioned in your mind Garry , then id say you should PM all our members and ask who wants to help. The program could be divided into sections and or code,music,graphics. By keeping this flexable and giving people a choice we may get more support.
OlDosLover.
« Last Edit: May 12, 2011, 02:10:15 am by OlDosLover » Report Spam   Logged
GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« Reply #6 on: May 12, 2011, 07:42:10 am »

Thats pretty much it in your summary,..and agree on the GDK,.. I actually like your description, real well,Mine would probably get to long and overly detailed, thus confuseing people, more then discribeing,..,...
----From Garry
Here is the new topic:
New Project, learning program

http://weeklyqbasicandqb64lesson.smfforfree.com/index.php/topic,171.msg943.html#msg943

Quote
then id say you should PM all our members and ask who wants to help.   
I made the note, everyone is welcome to help (particpate),...but also will do the PMs, later...
from Garry
« Last Edit: May 12, 2011, 07:57:38 am by GarrisonRicketson » Report Spam   Logged

OlDosLover
Guest
« Reply #7 on: May 12, 2011, 03:05:41 pm »

Hi all,
    Garry id like to do the main screen and main menu part. I have an idea that would work and look good. Id make the menu so that on clicking the relevant menu item the code jumps to that section. The individual programs would slot into this "structure" easily enough. One thing is lets make this version 1 and just get it to work. Better ideas will come about once we have a working program.
Id also suggest version 1 be mostly a text program and leave the fancy graphics to version 2.
OlDosLover.
Report Spam   Logged
GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« Reply #8 on: May 13, 2011, 07:39:28 am »

This sounds good, I still didn't do anything with more description,
but yea,I agree,...Sorry on the delay,replying, actually I thought I had, replied,
last night,...
from garry
Report Spam   Logged

GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« Reply #9 on: June 11, 2011, 07:27:04 pm »

I was going back thru this, and allthough I understand some, there is something I can not quite figure out,...
Code:
DO
    PRINT "Press the LETTER please"
    z = INT(RND * 26) + 66
    PRINT CHR$(z)
    WHILE Letter$ <> CHR$(z)
        INPUT "Letter: ", Letter$ '//// somewhere in here, I want it to print "sorry, that is not the correct letter, try again " if the letter is not correct
        Letter$ = UCASE$(Letter$)
    WEND
    PRINT " Bien,te escribe ,Good You wrote "; Letter$
    _DELAY 1
    CLS
LOOP UNTIL _KEYDOWN(27)

PRINT "Sorry , thats all for now"
SLEEP
SYSTEM
Ok hope I make sense, as it is, if the letter is not correct, it just displays:
LETTER:  and what I was trying to do is make it say "sorry try again" (or somethin like that) if the letter did not match,.. If the correct letter is entered, it dose say:  " Bien,te escribe ,Good You wrote " and a new letter appears , with the LETTER: prompt,...that part is fine,
since this is not a IF statement I caouldnt use ELSE, WHILE and WEND, are new to me.
Thanks From Garry
Report Spam   Logged

OlDosLover
Guest
« Reply #10 on: June 11, 2011, 07:48:11 pm »

Hi all,
    While ... Wend is like Do ... Loop. The syntax is
WHILE condition true WEND. So in this case where
Quote
WHILE Letter$ <> CHR$(z)
is written , it means in plain english, While the generated letter does not equal the inputted letter. Which leads to repetition and allows user to select another letter.
    If you want to respond to an incorrect letter then simply add a comparison and message off that comparisson.
Code:
WHILE Letter$ <> CHR$(z)
        INPUT "Letter: ", Letter$ '//// somewhere in here, I want it to print "sorry, that is not the correct letter, try again " if the letter is not correct
        Letter$ = UCASE$(Letter$)
        If ucase$(Letter$) <> chr$(z) then
           Print "You selected ";Letter$;" which is wrong.Please enter ";chr$(z)
        end if
    WEND
OlDosLover.
« Last Edit: June 11, 2011, 07:51:54 pm by OlDosLover » Report Spam   Logged
GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« Reply #11 on: June 11, 2011, 08:07:11 pm »

Thanks a bunch Oldoslover,
 That was a simple one, but it would of taken me hours, looking thru tutorials, and then I might never have found what fits this,...the < > greater then ,less then symbols, are significant of "not equal too " ?
From Garry
Report Spam   Logged

OlDosLover
Guest
« Reply #12 on: June 11, 2011, 08:18:17 pm »

Hi all,
    Respectfully if you dont know this then you should research tutorials so you understand it. As programmers we have to use combinations of those symbols to make our programs work. Therefor to read and understand another programmers program you need to know them.
something = something equal
something => something equal or greater than
something =< something equal or less than
something <> something not equal
This stuff should be in the wiki. This is part of the reason you should compose a program description in english. That way you can relate the action wanted into the code that produces that action. Makeing a program work is half the job. Understanding how and why it works is the other half.
OlDosLover.
« Last Edit: June 12, 2011, 12:12:06 am by OlDosLover » Report Spam   Logged
OlDosLover
Guest
« Reply #13 on: June 11, 2011, 09:53:29 pm »

Hi all,
    Here's an example like im talking about. Anyone should be able to follow the idea and the methods.
Quote
            LETTER DROP
   This is an early learning program that has randomly selected letters of the alphabet falling from the top of the screen to the bottom of the screen. As the letter is falling the end user can press the corresponding letter. On entering a letter the program acknowledges a correct selection by rewarding the user with a message of praise and then repeats with another letter allowing the process to continue. On entering a wrong letter the program could ignore it or warn the user that entry is wrong.
   From our description we need 26 letters of the alphabet. We need to select one randomly. We need the letter to fall downward the screen. While the letter is falling the user can press the corresponding letter or an incorrect letter. On reaching the bottom of the screen and no entry or correct entry we assume that the user got it wrong. If the user gets the letter right then we remove that letter from our show list. Eventually the user is left with a list of incorrect letters that should continue to fall until entryed correctly.
   From the more detailed description we can start to code the program. We need a "list" of the 26 letters. Lets discuss how we could create this list.
1] Create the 26 letters in an array
2] randomly generate a number between 65 and 90 which is the ASCII value for capital A to Z
Pro's and Con's
1]    a] We get all the correct letters with no duplicates
   b] They are not randomly placed in the array
2]   a] Each letter is random
   b] Is possible a letter can be repeated more than once at any time
   Now what seemed so easy a minute ago is now complicated. We need a combination of both 1 and 2. If we could create the array and fill it with the correct sequence of numbers representing the leters then we are assured there is none missing or duplicated. Then now if we could shuffle the array randomly then we would have achieved our aim.
Code:
Code:
REM
DEFINT A-Z

SCREEN 12
'create and fill our alphabet array
OPTION BASE 1 'set all arrays to start a element 1 and not as zero
DIM Alphabet%(26) 'our container for the letters
count% = 1
FOR a% = 65 TO 90
  Alphabet%(count%) = a% 'assign the value of a into the correct element of the array
  PRINT CHR$(a%), Alphabet%(count%)
  count% = count% + 1 'count upward 1 to 26 to represent the correct element of the array to be used
NEXT a%

_DELAY 1
PRINT

'shuffle our alphabet array so the order is different
FOR a = 1 TO 26
  elementotswap = INT(RND * 26) + 1 'create randomly 1 to 26
  SWAP Alphabet%(a), Alphabet%(elementotswap) 'swap current with random
  PRINT CHR$(a + 64), Alphabet%(a), CHR$(Alphabet%(a)) ' show proof
NEXT a
SLEEP
SYSTEM

Is this clearer or better?
OlDosLover.
« Last Edit: June 11, 2011, 09:59:53 pm by OlDosLover » Report Spam   Logged
GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« Reply #14 on: June 11, 2011, 11:48:35 pm »

Quote
  Respectfully if you dont know this then you should research tutorials so you understand it
Ok well sorry, all though I did know > is greater then , < is less then ,but no I didnt, know combined <> is not equal too,...Probably thats what I need to do, is just spend all my time looking at the tutorials, and try to figure it, instead of bothering people with "silly" questions,.. I realize most of what I am trying to learn is so basic, that it must seem ridiculess, some of the things I ask about ,sorry.
From Garry
Report Spam   Logged


Pages: [1] 2
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum


Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy