|
-
Apr 25th, 2005, 03:41 PM
#1
Thread Starter
New Member
making a game
hello ppl!
i have been handed some coursework with a deadline of thursday 28th april so quick replies would be appreciated! basically wat i need to do is make a snakes and ladders game, however, because our school is crap, the teachers have been very unhelpful and the class has been taught pretty much nothing about visual basic. i am using visual basic 6, and i have got this far....
For d = 1 To 100 'for all values in the array
board(d) = 0 'turn them into 0
Next d 'complete initialisation of array
no_of_snakes = 10 'the number of snakes = 10
no_of_ladders = 10 'the number of ladders = 10
snakecount = 0 'set the count for number of snakes to 0
Do
size_of_snake = InputBox("Enter size of snake between 10 and 30?")
If size_of_snake < 10 Or size_of_snake > 30 Then
size_of_snake = InputBox("The size of the snake has to be between 10 and 30, please retry")
End If
Do While size_of_snake >= 10 And size_of_snake <= 30
Exit Do
position_of_snake = InputBox("Enter start position of snake")
If position_of_snake < 11 Or position_of_snake > 99 Then
position_of_snake = InputBox("The position of the snake has to be between 11 and 99")
End If
Do While position_of_snake < 11 Or position_of_snake > 99
Exit Do
board(position_of_snake) = size_of_snake * -1
snakecount = snakecount + 1
Loop
Loop Until snakecount = no_of_snakes
i have dimmed all the things that need to be dimmed, as integers
the task tells us to have 10 ladders and 10 snakes which have to be between 30 and 10 in size. i have got that far and am now stuck, because for some reason that code doesnt work, i cannot get the loop to work properly! any help would be appreciated, thank u!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|