ClioSport.net

Register a free account today to become a member!
Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

  • When you purchase through links on our site, we may earn an affiliate commission. Read more here.

ceebot4---HelPPP



  Honda Civic 2.0 TypeR
basicly i use ceebot4 (programming program) and i was wondering if anyone has the code for project 1 would be very helpfullllllllllllllllllllll :) thankyou this is what i got but when i try and run it says there is a problem (which ive marked below in yellow) if i get rid of it says there is a problem with the labyrinth (marked green)

anyone help?
extern void object::Labyrinth ()
{
int choice;
do
{
choice=Menu();
if (choice == 5)
{
Quit();
break;
}
Action(choice);
}while (true);

}

//*****Prints a message on top of the screen. After a few //seconds, the message disappears automatically.
//Put in the brackets the messge to be displayed:********


//***********menu_here************************
int object::Menu()
{
message ("1 - Move Forward" + " 2 -Move Backward");
message ("3 - Turn Left" + " 4 - turn Right");
message ("5 - Quit");
do
{
string input = dialog ("what's your choice?");
int choice = strval (input);
if (choice==1||choice==2||choice==3||choice==4||choice==5)
{
return choice;
}
else
{
message("invalid input!");
}
}while (true);

}

//************action_here*********************
void object::Action(int choice)
{
float num;
num=getNum("How much do you want to turn/move?");

if(choice==1)
{
move(num);
}
else if(choice==2)
{
move(-num);
}
else if(choice==3)
{
turn (num);
}

else if(choice==4)

{
turn (-num);
}

}
//***********getNum_here*********************

float object:: getNum (string prompt)
{
string input;
float number;
input = dialog(prompt);
number = strval(input);
return number;
}
//********quit*************
void object::Quit()

{
message ("Goodbye");
object item = radar (GoalArea);
float dist = distance (item.position, this.position);
message ("You are still " +dist+ " metres away from the GoalArea");

}




//{
//float number;
//float average;
//int count =0;
//string input;
//int messege;
//turn (180);
//move (10);


//{
//input = dialog("what do you want to do?");
//number = strval (input);

//}

//}

//}



PROJECT

extern void object::Labyrinth ()
{
float totaldist = 0;
float turns = 0;
int choice;
do
{
choice=Menu();
if (choice == 5)
{
Quit();
break;
}
else if (choice == 1||choice==2)
{
totaldist += Action(choice);
}
else if (choice == 3||choice==4)
{
turns += Action(choice);
}
else if (choice == 6)
{
Stats (totaldist, turns);
}
}while (true);

}

//*****Prints a message on top of the screen. After a few //seconds, the message disappears automatically.
//Put in the brackets the messge to be displayed:********


//***********menu_here************************
int object::Menu()
{
message ("1 - Move Forward" + " 2 -Move Backward");
message ("3 - Turn Left" + " 4 - turn Right");
message ("5 - Quit");
do
{
string input = dialog ("what's your choice?");
int choice = strval (input);
if (choice==1||choice==2||choice==3||choice==4||choice==5)
{
return choice;
}
else
{
message("invalid input!");
}
}while (true);

}

//************action_here*********************
float object::Action(int choice)
{
float num;
num=getNum("How much do you want to turn/move?");

if(choice==1)
{
move(num);
}
else if(choice==2)
{
move(-num);
}
else if(choice==3)
{
turn (num);
}

else if(choice==4)

{
turn (-num);
}
return num;

}
//***********getNum_here*********************

float object:: getNum (string prompt)
{
string input;
float number;
input = dialog(prompt);
number = strval(input);
return number;
}
//********quit*************
void object::Quit()

{
message ("Goodbye");
object item = radar (GoalArea);
float dist = distance (item.position, this.position);
message ("You are still " +dist+ " metres away from the GoalArea");

}


//***************statistics*****************
void object::Stats(float totaldist, float turns)

{
message ("the total distance is " + totaldist);
message ("the number of is " + totaldist);
message ("The time taken in seconds taken so far");





//{
//float number;
//float average;
//int count =0;
//string input;
//int messege;
//turn (180);
//move (10);


//{
//input = dialog("what do you want to do?");
//number = strval (input);

//}

//}

//}
}
 


Top