I have an assignment to make a text-based snakes and ladders game using Dev-C++. I have so far made a splash screen and a menu (with colours and sounds, pretty cool) using the winmm.a library and the switch/case construct. I have even been able to get player names with a simple character array. However, I have no idea how to instruct the system on player positions, dice spinning and player movements. I’ve been told to use random numbers for the dice, but I don’t know anything about that. I need to be able to initialize player_position for at least 2 players, have them roll the dice, move the players to a new location and determine whether there’s a snake or ladder there, then move them to a new location. I’ve been going through Daniweb for the past week looking for tips and I found some, but not enough. I need help, please, this assignment is due in 5days.
I don’t want it to be done for me, I just want to be pointed in the right direction so that I can do it myself. My friends have no problems with cheating and I figure the best way to change their minds is by setting an example. Oh yes, is there any way I can make it full-screen?
Don’t laugh, but here’s the first thing I tried in order to get the board set up:
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int board[101];
int snake;
int ladder;
snake = board[5],[15],[25],[30],[45],[53],[62],[78],[81],[93],[96];
ladder = board[7],[12],[28],[35],[40],[59],[65],[73],[88]
cout >> snake;
system("PAUSE");
return EXIT_SUCCESS;
}
i'm sure you can see from here that i'm trying to set positions for snakes and ladders on the board so that whatever random number pops up from the dice, locations will already by marked.
Thanks.