Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Project two.

Author
Message
Technobabble91
14
Years of Service
User Offline
Joined: 3rd Jul 2009
Location:
Posted: 5th Jul 2009 02:40
Ok I am setting up a a second challenge for myself. Make a text based trivia program.

Now I think this will be rather complex, and frankly I have No idea where to start.I Do think that for starters I will just have it as a linear program with a fixed list of questions.

I'm off to learn more, and report back success and failures as I see them.

I don't why I exist, so I have no reason not take your money and run.
Technobabble91
14
Years of Service
User Offline
Joined: 3rd Jul 2009
Location:
Posted: 5th Jul 2009 07:59
Ok I am running into My first problem. Big one. I can't going through the command list find anything that would help me store the answers. I think either variables or an array, but my second problem Is how do I make it choose?

Oh sheesh My second program is already off to a rocky start, and I'm not even using 3d yet.

I don't why I exist, so I have no reason not take your money and run.
AcP2142
14
Years of Service
User Offline
Joined: 22nd Jun 2009
Location: Sitting on top of TGC forums
Posted: 5th Jul 2009 08:59
This should be good. Sorry but I cannot help you with the game itself at all but if you ever need feedback on how it runs I am here. I am personally a noob and as a matter of fact only have a trial version of DarkBASIC at the moment. Just ask me if you ever need anything.

The only thing constant in life is CHANGE.
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 5th Jul 2009 12:25
If you need help, you should also post the code you have written in a nice little code box so we can look at it and give you advice:



Just highlight your code and hit the "code" button in the top right corner of your post box.

TheComet


Make the path of your enemies easier with Waypoint Pro!
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 5th Jul 2009 15:45
As a newcomer, it might be useful for you to check out my new web site.

I've registered a new domain name and I'm in the process of building a completely new web site entirely for my Dark Basic stuff, so there's not a lot there yet.

I'm in the process of re-vamping all my old tutorials and adding some new ones. The one's you might be interested in are already there though.

TDKMan.com

Barrie (TDK_Man)

TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 5th Jul 2009 16:01
@ Technobabble91

I forgot about telling you that... Yeah, visit TDK's website. It works wonders... Even I learn new things by reading through it.

TheComet


Make the path of your enemies easier with Waypoint Pro!
Technobabble91
14
Years of Service
User Offline
Joined: 3rd Jul 2009
Location:
Posted: 5th Jul 2009 16:11
Awesome. Thank you for all the advice.

I don't why I exist, so I have no reason not take your money and run.
Technobabble91
14
Years of Service
User Offline
Joined: 3rd Jul 2009
Location:
Posted: 6th Jul 2009 03:35
Ok how do I define which key to press?
Like a question is: Green is made of:
(A) Gupies
(B) Red and Blue
(C) Yellow and blue
(D) Green is not a color

How do you Get it to recogniz A B C or D? Sorry if this is a really stupid question.

I don't why I exist, so I have no reason not take your money and run.
pictionaryjr
15
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 7th Jul 2009 07:12
You would do something like this, of course the answer would change depending on the question.

AcP2142
14
Years of Service
User Offline
Joined: 22nd Jun 2009
Location: Sitting on top of TGC forums
Posted: 7th Jul 2009 07:24
Question... how come you didn't put an input command into that code? Did you figure he would know enough to do that or are you just too stupid. lol

The only thing constant in life is CHANGE.
pictionaryjr
15
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 7th Jul 2009 07:57
I did put an input command in it lol.
Technobabble91
14
Years of Service
User Offline
Joined: 3rd Jul 2009
Location:
Posted: 7th Jul 2009 08:10
Well now I feel stupid.
That was so easy!
(Sulks)
Well thankyou for the help just wish I had thought of it first.

I don't why I exist, so I have no reason not take your money and run.
AcP2142
14
Years of Service
User Offline
Joined: 22nd Jun 2009
Location: Sitting on top of TGC forums
Posted: 7th Jul 2009 08:46
what? :0 that wasn't there before. lol. i guess i am the stupid one in this case. i am ashamed. hahaha.

The only thing constant in life is CHANGE.
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 8th Jul 2009 04:25 Edited at: 8th Jul 2009 04:52
Pictionary gave you a nice example of the simplest way to do this, but if you're going to have multiple questions it's best to store the data somewhere or you'd have to write out the same routines again and again a hundred times!
Depending on how much you know this may go over your head but I'll introduce you to arrays.

Okay, each question has five strings: the question and four answers.
We'll make two arrays to keep this easy to follow.
We'll also need a third array to tell us which answer is correct.

Notice how "correct" doesn't have a "$", that's because it's a numerical array, while the other two are string arrays.
Also note that arrays can use location 0 to store values, remember that.


Next we'll look at how to use these arrays to store our questions...

TGC Forum - converting error messages into sarcasm since 2002.
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 8th Jul 2009 04:36 Edited at: 8th Jul 2009 04:53
Now we need some data to fill those arrays with

You can put data statements anywhere in your program and read the data into single variables or arrays. There is a data pointer that moves along the list every time you read data, you can move this cursor to a label ( eg like_this: ) by using the restore command.

Now we move on to displaying the questions...

TGC Forum - converting error messages into sarcasm since 2002.
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 8th Jul 2009 04:49
Reading data from an array is done in the same way as writing to it, we just have to call the location in the array.


See how far you can take this code.
Can you ask multiple questions?
Can you keep score of how many correct answers are given?
For extra brownie points can you split the questions into categories that the player can choose from?

Have fun.

TGC Forum - converting error messages into sarcasm since 2002.
AcP2142
14
Years of Service
User Offline
Joined: 22nd Jun 2009
Location: Sitting on top of TGC forums
Posted: 8th Jul 2009 07:52
Great work Obese. A lot better than pictionary's but he was just tring to make a simple one that Technobabble would understand. Anyway... I love this quote.
Quote: "For extra brownie points can you split the questions into categories that the player can choose from?"
Since when did we have brownie points on the TGC forums lol.

The only thing constant in life is CHANGE.
Technobabble91
14
Years of Service
User Offline
Joined: 3rd Jul 2009
Location:
Posted: 11th Jul 2009 16:18
I did complete this, but at the same time learned something. I am REALLY bad at logic, and trying to convey logic to a pure logic machine is downright hard. I think i'll stick to making doodles and modeling every now and then.

I don't why I exist, so I have no reason not take your money and run.

Login to post a reply

Server time is: 2024-05-20 10:33:29
Your offset time is: 2024-05-20 10:33:29