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 / Assessment code

Author
Message
Rebelhope
14
Years of Service
User Offline
Joined: 26th Jan 2010
Location:
Posted: 26th Jan 2010 20:19
i'm new to the forum and i need some help with a code assessment for a high school quiz heres what i have to do

1)Comment my name(Which i did)

2)The user is asked by the computer to input the name of each character.each name is stored in an array

3)the x and z position of each character is randomly generated.x is stored in an array and z is stored in aqn array.Make sure the randomize function has been used

4)the user is then presented with a list of all charcters the user is asked by the computer to type in the name of a character

5)the program will search for the name in the array. once the name has been found the name,x and z are printed for that character

plz help me

Thank You
BCIT
14
Years of Service
User Offline
Joined: 26th Jan 2010
Location:
Posted: 27th Jan 2010 00:05
1st, don't expect the coders here to do the project for you. Be more specific with what you need help on.

If you are looking to store the names of say 5 characters then you will have to declare an array, for example: dim names$(5)

To input the name of each character you need to use the "input" command and loop through all 5 elements in your array. Here is sample code:



Declare an array to store the X values and an array to store the Z values. Loop through both arrays, generating and storing random numbers in your arrays.
29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 27th Jan 2010 00:29 Edited at: 27th Jan 2010 00:33
I'm going to guess that you're one of BCIT's students

First, TDKs tutorials would be a good place to start:

http://forum.thegamecreators.com/?m=forum_view&t=99497&b=10

Look at:

Section 1

Numeric Variables
String Variables
Single Dimension Arrays

Section 2

For to next loops

In the code snippet below is a clue on how to do the first bit. Copy and paste it into the DBC editor and run it, follow then on screen instructions and have a play around with it.



Have fun.
Double B
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 27th Jan 2010 07:31
This may be a little off-subject, but I think I may be one of BCIT's students too! Ms. Miller, is that you?
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 27th Jan 2010 21:16
You think you might be?

"With games, we create these elaborate worlds in our minds, and the computer is there to do the bookkeeping." - Will Wright

Login to post a reply

Server time is: 2024-04-25 12:47:22
Your offset time is: 2024-04-25 12:47:22