View Single Post
  #1   Spotlight this post!  
Unread 08-09-2005, 01:29
henryBsick's Avatar
henryBsick henryBsick is offline
Why wait for the last 20?
AKA: Henry B. Sick
FRC #0125 (NUTRONS)
Team Role: Mentor
 
Join Date: Nov 2003
Rookie Year: 2001
Location: Bahston, MA
Posts: 645
henryBsick has a reputation beyond reputehenryBsick has a reputation beyond reputehenryBsick has a reputation beyond reputehenryBsick has a reputation beyond reputehenryBsick has a reputation beyond reputehenryBsick has a reputation beyond reputehenryBsick has a reputation beyond reputehenryBsick has a reputation beyond reputehenryBsick has a reputation beyond reputehenryBsick has a reputation beyond reputehenryBsick has a reputation beyond repute
Send a message via AIM to henryBsick
Karel++ Noob help

Ok, heres the story... I got this nifty new Karel++ book today in my intro to Computer Programming class. In my haste to learn I read waaaay ahead and thought of a neat thing to do. I based the length of move commands in how you write the word "move" It is binary based using capitals for on/off.
example:

movE---move one space
moVe---move two spaces
moVE---move three spaces
ect...

The skinny is M=8, O=4, V=2, E=1.

Here is the actual code... the task it performs is just filler to make it a complete code.

Code:
class robot_pwn: ur_robot{
	void movE( ); //1
	void moVe( ); //2
	void moVE( ); //3
	void mOve( ); //4
	void mOvE( ); //5
	void mOVe( ); //6
	void mOVE( ); //7
	void Move( ); //8
	void MovE( ); //9
	void MoVe( ); //10
	void MoVE( ); //11
	void MOve( ); //12
	void MOvE( ); //13
	void MOVe( ); //14
	void MOVE( ); //15
	void turnRight( ); //self explanatory genius
	
};

void robot_pwn :: movE( )
{
	move( );
}

void robot_pwn :: moVe( )
{
	move( );
	move( );
}

void robot_pwn :: moVE( )
{
	move( );
	move( );
	move( );
}

void robot_pwn :: mOve( )
{
	move( );
	move( );
	move( );
	move( );
}

void robot_pwn :: mOvE( )
{
	move( );
	move( );
	move( );
	move( );
	move( );
}

void robot_pwn :: mOVe( )
{
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
}

void robot_pwn :: mOVE( )
{
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
}

void robot_pwn :: Move( )
{
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
}

void robot_pwn :: MovE( )
{
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
}

void robot_pwn :: MoVe( )
{
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
}

void robot_pwn :: MoVE( )
{
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
}

void robot_pwn :: MOve( )
{
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
}

void robot_pwn :: MOvE( )
{
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
}

void robot_pwn :: MOVe( )
{
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
}

void robot_pwn :: MOVE( )
{
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
	move( );
}

void robot_pwn :: turnRight( )
{
	turnLeft( );
	turnLeft( );
	turnLeft( );
}

task
{	robot_pwn Blitz(1,1, East, 9); //w00t w00t for 9 beepers
	Blitz.turnOff( ); //sad existence for such a complicated binary-move code
}
Anyone out there with any Karel++ experince... please let me know if what I attempted is possible.


n00b coder,

-Henry
__________________
Mechanical Engineer
Digital Lumens
NU ME: 2011