Go to Post I get in enough trouble mentoring one team. If I did five teams I'd be less one wife. - Koko Ed [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 10:53.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi