During my first practice run of this event, I just used normal English, but realized that a great deal of ambiguity got in my way. To combat this, I began to use notation that would likely be found in C, C++, and javascript. To practice, we used 2d drawings on paper. My code would look something like this:
(keep in mind that I attempted to teach these methods to my partner, who has no experience in programming in a few short hours)
//unit is the length from tip of index finger to first joint
data_type point[num x, num y];
"x" represents the offset from the left of the page, going right
"y" represents the offset from the top of the page, going down
function line(point p1, point p2);
draw a line connect points "p1" and "p2"
------------------------------------------------
point p1 = [10, 2];
point p2 = [10, 6];
point p3 = [14, 2];
point p4 = [14, 6];
line(p1, p2);
line(p1, p3);
line(p3, p4);
line(p2, p4);
//draws a square
The point is that the basic functions resolve to English instead of either bytecode or assembly, so my partner can run the script himself. It does seem like a lot to draw a square, but it was just a sample to show the basics of how my system worked. We then moved onto the 3d work of legos. (surprisingly, the final model for the competition included bent angles, that I ended up dealing with in comments).
//unit is one peg on lego block
data_type block[num horizontal, num vertical];
"horizontal" represents the number of pegs running horizontally across the lego block
"vertical" represents the number of pegs running vertically across the lego block
//this model was eventually thwarted by cylinder and pipe pieces
data_type point[num x, num y, num layer];
"x" represents the offset from the left of the grid, starting at 0, going right
"y" represents the offset from the top of the grid, starting at 0, going down
"layer" represents the number of thicknesses of basic lego blocks at which the point ocurrs, starting at 0
function place(block b, point p);
place a block represented by block "b" at point "p" on the grid
----------------------------------------------------------------------
block b1 = [2, 4];
for(num it = 0; it < 6; it++)
{
place(b1, [it*2, 0, 0]);//creates row of b1 bricks
}
place(b1, [0, 5, 0]);
place(b1, [0, 9, 0]);
place(b1, [11, 5, 0]);
place(b1, [11, 9, 0]);
//...basically, this went on forever
The code I just mentioned did not ever mention the entire first layer... it was pitiful. By the time I was on the third layer out of maybe 16, it was announced that there were only six minutes remaining. In short, I need to figure out a way to make this system so that it can be written much more simply, either by modification to my lego framework, or by a modification to the entire language, which I have dubbed "kimscript" (after my partner). There is another competition this Friday, with the same event, so any advice anyone has would be much appreciated. Thank you in advance!
p.s. Please let me know if any of this information is unclear
Edited by tabula.alba, 10 April 2010 - 03:24 PM.


Sign In
Create Account

Back to top









