Jump to content
IGNORED

Bible multiple choice program for kids


Recommended Posts

Hello. i am making a short program that quizzes kids on the bible.

 

ran into an issue: the answer is bunched up so instead of "The Earth" it comes out as TheEarth which is annoying.

 

also, how do i separate good and bad answers (I.E that's wrong, try again or that's right next answer)

 

this is a simple program, just need these two problems sorted out

 

(Yes i am a proud christian, mock me if you will)

Link to comment
Share on other sites

(Yes i am a proud christian, mock me if you will)

 

Generally no one cares, but you do invite that kind of abuse with statements like this and makes it seem like you enjoy being mocked.

 

ANYWAY, I am interested in neither discussing nor debating that point. It would be helpful to see parts of your program which are giving you problems. Otherwise your problem description is vague and could have many different solutions, none of which directly address your specific issue.

Link to comment
Share on other sites

I assume you're using the built-in BASIC language? Can you post what you have so far?

 

I would guess you need to study how to read and compare string variables. Some pages that might help:

http://www.lemon64.com/forum/viewtopic.php?t=44907&sid=842c9725abb7a8de8765196b4b44f3fd

http://retro64.altervista.org/blog/very-basic-basic-simple-tips-for-entering-strings-with-input-commodore-64-basic/

http://retro.lonningdal.net/home.php?page=Adventure&part=100

Link to comment
Share on other sites

Actually you have a bunch of issues.

 

1) God created .. not god. Try using upper case.

 

2) CHR$(13) is the return character so use the first line below if want next line or use a space at end of quotes like the second line if you want a space.

 

70 print "God created the";CHR$(13);a$

70 print "God created the ";a$

 

 

3) Use simple IF string checks like shown at https://www.c64-wiki.com/wiki/RETURN_(Key)

 

4) Learn to use Google search... sorry to sound condescending but you should easily find simple examples for the above.

 

and finally your question is just plain wrong. The correct answer is Everything... The Genesis origin is obviously an overly simplified story of the Big Bang , Solar System creation and evolution dumbed down to the knowledge level of the people thousands of years ago. Adam and Even is a story of mankind becoming conscious. Cain and Able is the story of man experiencing civilization. The tower of Babel explained different languages .. etc and on and on.

 

The point is if you really are Christian only the belief in the Savior matters. Genesis is just a bunch of dumb down explanations for ancient people since their understanding of science was extremely primitive.

Edited by thetick1
Link to comment
Share on other sites

Actually you have a bunch of issues.

 

1) God created .. not god. Try using upper case.

 

2) CHR$(13) is the return character so use the first line below if want next line or use a space at end of quotes like the second line if you want a space.

 

70 print "God created the";CHR$(13);a$

70 print "God created the ";a$

 

 

3) Use simple IF string checks like shown at https://www.c64-wiki.com/wiki/RETURN_(Key)

 

4) Learn to use Google search... sorry to sound condescending but you should easily find simple examples for the above.

 

and finally your question is just plain wrong. The correct answer is Everything... The Genesis origin is obviously an overly simplified story of the Big Bang , Solar System creation and evolution dumbed down to the knowledge level of the people thousands of years ago. Adam and Even is a story of mankind becoming conscious. Cain and Able is the story of man experiencing civilization. The tower of Babel explained different languages .. etc and on and on.

 

The point is if you really are Christian only the belief in the Savior matters. Genesis is just a bunch of dumb down explanations for ancient people since their understanding of science was extremely primitive.

... agreed

Link to comment
Share on other sites

I would define a data structure. Something like this:

 

 

10 read q$:if q$="@@" then end
15 read c,a$(1),a$(2),a$(3),a$(4)
20 print chr$(147);q$:for i=1 to 4:print i;". ";a$(i):next
25 get u$:if u$<"1" or u$>"4" then 25
30 u=val(u$)
35 if u<>c then print"wrong answer! try again!":poke 198,0:wait 198,1:goto 20
40 print"correct answer!":poke 198,0:wait 198,1:goto 10
100 data"in the beginning god created the",1
105 data"earth","peanut","chestnut","casserole"
110 data"moses divided the",3
115 data"fishes","whole numbers","red sea","piles of sand"
120 data "@@"
  • Like 1
Link to comment
Share on other sites

Ha Carlsson .. guess you still program in Commodore BASIC. It was the first programing I learned about 40 years ago and have not used much since .. other than LOAD"$",8,1. I need to get some sleep as I have some bash and java to work on tomorrow at work.

Link to comment
Share on other sites

Not very often, though obviously I still know the syntax and how to use it.

 

In a lot of ways, a quiz program is similar to a text adventure. Both could be worked out with countless rows of PRINT statements which allows for very dynamic gameplay but is extremely tedious and hard to maintain. Both can also be driven by an engine and data structures like those DATA statements, which puts more rules and rigidness to it, but makes shorter and easier to follow code. A certain amount of dynamic can be wedged into the program anyway, though for the Bible multiple choice quiz perhaps not so much dynamic is required.

 

Then again I think there are modern, better tools for setting up quizzes than using a C64 if the goal is not so much the programming challenge, but to get a useful application that will apply to kids in a Bible study group.

 

(Personally I am of the faith that evolution is one big machine controlled by God pushing buttons every now and then to have evolution have its go, a bit like how someone would play The Sims. In that faith, both evolution and religion can co-exist, and God uses evolution as a tool to make things happen instead of directly creating or removing things like setting breakpoints into The Sims and change memory content with a monitor program. Besides it says that God created Human in His own image, and since humans by nature are lazy, it should mean that God also doesn't work more than absolutely required, which is where the evolution machine comes in handy as it does most of the dull work for God)

Edited by carlsson
Link to comment
Share on other sites

Not very often, though obviously I still know the syntax and how to use it.

 

In a lot of ways, a quiz program is similar to a text adventure. Both could be worked out with countless rows of PRINT statements which allows for very dynamic gameplay but is extremely tedious and hard to maintain. Both can also be driven by an engine and data structures like those DATA statements, which puts more rules and rigidness to it, but makes shorter and easier to follow code. A certain amount of dynamic can be wedged into the program anyway, though for the Bible multiple choice quiz perhaps not so much dynamic is required.

 

Then again I think there are modern, better tools for setting up quizzes than using a C64 if the goal is not so much the programming challenge, but to get a useful application that will apply to kids in a Bible study group.

 

(Personally I am of the faith that evolution is one big machine controlled by God pushing buttons every now and then to have evolution have its go, a bit like how someone would play The Sims. In that faith, both evolution and religion can co-exist, and God uses evolution as a tool to make things happen instead of directly creating or removing things like setting breakpoints into The Sims and change memory content with a monitor program. Besides it says that God created Human in His own image, and since humans by nature are lazy, it should mean that God also doesn't work more than absolutely required, which is where the evolution machine comes in handy as it does most of the dull work for God)

can we...not start a debate?

Link to comment
Share on other sites

 

I would define a data structure. Something like this:

10 read q$:if q$="@@" then end
15 read c,a$(1),a$(2),a$(3),a$(4)
20 print chr$(147);q$:for i=1 to 4:print i;". ";a$(i):next
25 get u$:if u$<"1" or u$>"4" then 25
30 u=val(u$)
35 if u<>c then print"wrong answer! try again!":poke 198,0:wait 198,1:goto 20
40 print"correct answer!":poke 198,0:wait 198,1:goto 10
100 data"in the beginning god created the",1
105 data"earth","peanut","chestnut","casserole"
110 data"moses divided the",3
115 data"fishes","whole numbers","red sea","piles of sand"
120 data "@@"

could i filter out the pokes and still have a running program?

Link to comment
Share on other sites

Why would you omit the POKEs? Actually that is a space saving way to wait for a keypress. The POKE clears the keyboard buffer, the WAIT runs a busy loop waiting for any key to be pressed. Without clearing the keyboard buffer, the WAIT will pick up any remaining keypresses in the buffer which will make it not behave as intended.

 

You can replace it with an extra line: 45 GET K$:IF K$="" THEN GOTO 45

 

However in the case of line 35, you already are inside an IF statement so it would need to break out into a subroutine or some form of spaghetti code to run another IF statement inside of it.

 

Also if you're really getting into C64 programming, POKE will be one of your best friends so better get acquinted early on.

Edited by carlsson
Link to comment
Share on other sites

Hello. i am making a short program that quizzes kids on the bible.

Oh, the editor of our club newsletter collects Bible programs. If you finish yours, could he have a copy of it to add to his collection?

 

Truly,

Robert Bernardo

Fresno Commodore User Group - www.dickestel.com/fcug.htm

Southern California Commodore & Amiga Network - www.portcommodore.com/sccan

August 11-12 Commodore Vegas Expo v14 2018 - www.portcommodore.com/commvex

Link to comment
Share on other sites

Why would you omit the POKEs? Actually that is a space saving way to wait for a keypress. The POKE clears the keyboard buffer, the WAIT runs a busy loop waiting for any key to be pressed. Without clearing the keyboard buffer, the WAIT will pick up any remaining keypresses in the buffer which will make it not behave as intended.

 

You can replace it with an extra line: 45 GET K$:IF K$="" THEN GOTO 45

 

However in the case of line 35, you already are inside an IF statement so it would need to break out into a subroutine or some form of spaghetti code to run another IF statement inside of it.

 

Also if you're really getting into C64 programming, POKE will be one of your best friends so better get acquinted early on.

 

True statement and pretty neat convention. I never once programmed a such a wait-for-keypress loop -- the program did other things while waiting -- but that is a pretty cool trick. Under-rated tool, WAIT.

Link to comment
Share on other sites

Yes, since WAIT will monitor any memory address for a change of value or even a particular value, it can be used for all sorts of inputs like keyboard, joystick and other I/O, but also other sources for a memory address to change, like an internal timer or other changes that may happen during interrupt.

 

By the way, if you would define additional arrays you could read all the questions and answers into those and randomize the order, which I leave as an exercise to the user. There also is a pointer to the next DATA statement at address 65-66 that one can alter to read data in a non-sequential way or simulate the RESTORE lineno syntax otherwise not present, but it isn't entirely straightforward to use so not relevant in the beginner's course.

 

Memory map: http://sta.c64.org/cbm64mem.html

Link to comment
Share on other sites

One thing noticed: line 15 creates an array of 11 string variables all named A$. I’m not sure if that was your intent, or if you were expecting A$ to be 10 characters long. Most BASICs create arrays of string variables with that syntax. Others (like Atari BASIC) use DIM to define the maximum length of the string variable. That may be causing you some headache also.

Link to comment
Share on other sites

Oh, the editor of our club newsletter collects Bible programs. If you finish yours, could he have a copy of it to add to his collection?

 

Truly,

Robert Bernardo

Fresno Commodore User Group - www.dickestel.com/fcug.htm

Southern California Commodore & Amiga Network - www.portcommodore.com/sccan

August 11-12 Commodore Vegas Expo v14 2018 - www.portcommodore.com/commve

i could email a snapshot possibly. can he open .vsf files?

Link to comment
Share on other sites

i could email a snapshot possibly. can he open .vsf files?

Hmm, I don't know. What can he use to read such a file?

 

Truly,

Robert Bernardo

Fresno Commodore User Group - www.dickestel.com/fcug.htm

Southern California Commodore & Amiga Network - www.portcommodore.com/sccan

August 11-12 Commodore Vegas Expo v14 2018 - http://www.portcommodore.com/commvex

Edited by RobertB
Link to comment
Share on other sites

got an error in 82

 

full code

 

sin
love
anger
parental control
? anger
?syntax error in 82
ready.
82 if inkey$=" love" print "wrong"
83 if inkey$=" parental control" goto 81
84 if inkey$="anger" goto 81
run
in roman's, paul says we are free from w
hat?
sin
love
anger
parental control
? anger
i had decided to use the inkey$ command but that leads to an error in 82
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...