View Single Post
Old 06-20-2007, 10:03 AM   #2 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 637
DJMaze is on a distinguished road
the trick is to use points
{s} produces: {{0,0},{1,0}}
{r,s} produces: {{0,0},{0,1}}

an array is good but use a dynamic points array.

Code:
POINT points[] = { {0,0}, // start {2,0}, // s,s // r {2,2}, // s,s // r {0,2}, // s,s // r {0,0}, // s,s }
The main focus is on the 'r' which makes it turn.
So first find all double r's and substract s's from it, but this all depends on the whole string of commands.

Quote:
1) You are given the command string {s,s,r,r,s,s}.
The minimum command is {s,s}
what if the command is {s,s,r,r,s,s,s,s}?
There's no way you can shorten it because it results in the points.
{0,0},{2,0},{-2,0}
__________________

UT: Ultra-kill... God like!
DJMaze is offline   Reply With Quote