View Single Post
  #3   Spotlight this post!  
Unread 08-09-2005, 10:09
jdiwnab's Avatar
jdiwnab jdiwnab is offline
Really the Inventor Guy
AKA: Bryan Hartley
FRC #0617
Team Role: College Student
 
Join Date: Nov 2004
Rookie Year: 2002
Location: Highland Springs, VA
Posts: 260
jdiwnab is a jewel in the roughjdiwnab is a jewel in the roughjdiwnab is a jewel in the rough
Re: Karel++ Noob help

Why not
Code:
class robot_pwn: ur_robot
{
	void movE( int n );
};

void robot_pwn :: movE( int n )
{
	int i
	for(i=0; i <= n; i++)
	{
		  move( );
	}
}
I hope this is the correct syntax, but you get the idea. You pass the number of "moves" you want to a function and it loops through the move funtion for that number of times. You wouldn't need a bunch of functions and be limited to 15 moves. You could put (depending on the compiler's limits) put 10,000 moves. You can then add whatever else, like turnRight(int degree); and turnLeft(int degree); for how far you want to turn.
__________________
Proof that Macs will win the platform war: How did Scotty know how to use MacDraft in Star Trek IV?
// random()
I have 100 gmail invites. PM me if you want one.
If they want us to think outside of the box, why do they make us fit in a 38x28x60 inch box?
Beware of Geeks bearing GIFs
Help me test my server software