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 Professional Discussion / i need help with arrays

Author
Message
Coding Beast
12
Years of Service
User Offline
Joined: 13th Dec 2012
Location:
Posted: 22nd Mar 2013 16:14
i have a quiz game that i need help with arrays on. If anyone can help me i give the option of downloading so you can run the game and see what you can help me with.

if i fail i try again

Attachments

Login to view attachments
BMacZero
19
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 23rd Mar 2013 06:35
You need to be more specific about what your problem is. As much as I want to help you, I can't reasonably scroll through 1000+ lines of code and try to figure out what you need.

Chris Tate
DBPro Master
16
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 23rd Mar 2013 12:26 Edited at: 23rd Mar 2013 12:29
The code is here



Insert the code into the forum post field, Use [ code lang=dbp ] [ / code ] without the spaces, or simply press the code button to format code.

Arrays

You are right in asking for help with arrays because using them will reduce your program to less than 200 lines.

You create arrays using the DIM statement outlined here.

In your case you are checking answers to questions using



The rule of thumb is never define the exact same design twice in computing, and in particular in programming.

A good way to implement that rule is to store multiple instances of a structure in an array; here is an example of how to create the quiz:

Creating a quiz in DarkBASIC

Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 23rd Mar 2013 14:14
There seems to be a lot of people trying to create a quiz currently?

Check out the post I made here... where I made a very simple quiz engine with scoring. This will help you to create a good quiz game with multiple questions, but is basic enough to learn for yourself by adding features.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
ShellfishGames
12
Years of Service
User Offline
Joined: 6th Feb 2013
Location:
Posted: 23rd Mar 2013 14:57 Edited at: 23rd Mar 2013 15:02
Apparently there are not only a lot of people trying to create a quiz game, but also a lot of people helping them out by writing complete "quiz engines". (here's mine and OBese87 posted one as well as a tutorial here)
No offense to anybody, but it looks like at least three of us have wasted quite some time. Although I have to admit that writing this quiz engine was a welcome distraction.

Chris Tate
DBPro Master
16
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 23rd Mar 2013 15:16
Plenty of examples; no excuse for struggling to figure out how to make one now.

Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 23rd Mar 2013 16:50
Think I'll add mine to the codebase....

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]

Login to post a reply

Server time is: 2025-05-17 18:21:41
Your offset time is: 2025-05-17 18:21:41