Page 1 of 4

ARF Contest A #VC (2007-07-16 to 07-19 20:00 GMT)

PostPosted: Mon Jul 16, 2007 9:13 pm
by NickyNick
Welcome to the "A" League Contest #95 - Oriental!

Submissions to: t.nick.a@gmail.com

Contest rules link: http://armadillo.metaclassofnil.com/forum/viewtopic.php?t=232

Naming convention is:
[DollarsRemaining]-[YourForumName]-[SolutionName]

Example:
2999-MyAss-JustWantToKickSome

GMT Time link: http://wwp.greenwichmeantime.com/

Special thanks to Ioncorpse for giving idea for this contest :D

PostPosted: Mon Jul 16, 2007 9:26 pm
by McGinge
Im lovin this Nick; more of the same!! :D

PostPosted: Mon Jul 16, 2007 9:28 pm
by NickyNick
Btw, I think it is the first contest level generated by the program :wink: I would never draw that Dragon Curve fractal by hands :lol:

PostPosted: Mon Jul 16, 2007 9:29 pm
by McGinge
You generated that?? Its great!! I love the dilemma; which way to go!!! :D

PostPosted: Mon Jul 16, 2007 10:00 pm
by gamma57
Thats like the 10th or so iteration. Cool program whatever you used!

PostPosted: Mon Jul 16, 2007 10:16 pm
by NickyNick
9th if exactly :wink: How could you determine it so close? :)

PostPosted: Mon Jul 16, 2007 10:22 pm
by JustcallmeDrago
How did you even know it was an iteration? Where's this program mentioned? :shock:

PostPosted: Mon Jul 16, 2007 10:26 pm
by McGinge
A rubbish opening 2532 +D... I thought it would be easy to get a fairly good score, but it seems that the last section is slightly harder than anticipated...

PostPosted: Mon Jul 16, 2007 10:30 pm
by NickyNick
I used Tim McSweeney's Python parser scripts, which I've translated to C++, and wrote simple program for generating Dragon Curve on the level.
You can find those scripts with my ARTweaker program, here: http://armadillo.metaclassofnil.com/forum/viewtopic.php?t=1283. And here is code for Dragon Curve:
Code: Select all
void DrawDragonCurve (int grade)
{
   float eps = 1e-4;


   ARLevel level;
   level.Init ();
   level.loadLevel ("blank.lvl");
   // blank is empty level

   int i,j;
   int turns;
   int rotation;
   float x, y;
   float length;
   int link_type;

   turns = (1 << grade) - 1;
   // 0 - up
   // 1 - right
   // 2 - down
   // 3 - left
   rotation = 0;
   x = 0;
   y = 0;
   length = 1;
   link_type = LINK_TYPE_BAR;

   level.addPoint (x, y, POINT_TYPE_ANCHOR);
   level.addPoint (x, y+length, POINT_TYPE_ANCHOR);
   level.addLink (&level.points[0], &level.points[1], link_type);

   y += length;

   bool turn, found;
   int i1,i2;
   i1 = 1;
   for (i=1; i<=turns; i++)
   {
      turn = (((i & -i) << 1) & i) != 0;
      if (turn)
         rotation++;
      else
         rotation--;
      if (rotation < 0)
         rotation += 4;
      if (rotation > 3)
         rotation -= 4;

      switch (rotation)
      {
      case 0:
         y += length;
         break;
      case 1:
         x += length;
         break;
      case 2:
         y -= length;
         break;
      case 3:
         x -= length;
         break;
      }

      found = false;
      j = 0;
      while ((j < level.points_num) && !found)
      {
         if ((fabs(level.points[j].x - x) < eps) && (fabs(level.points[j].y - y) < eps))
            found = true;
         else
            j++;
      }      

      if (found)
         i2 = j;
      else
      {
         level.addPoint (x, y, POINT_TYPE_ANCHOR);
         i2 = level.points_num-1;
      }

      level.addLink (&level.points[i1], &level.points[i2], link_type);

      i1 = i2;
   }

   level.saveLevel ("DragonCurve.lvl");
}

PostPosted: Mon Jul 16, 2007 10:43 pm
by McGinge
erm.... rite... I OBVIOUSLY understand what you've written there... :roll: 2700+D by the way, still rubbish though...

PostPosted: Mon Jul 16, 2007 11:25 pm
by JonathanF
I'm not really a fan of Python, it's too dynamic for my likes.

PostPosted: Mon Jul 16, 2007 11:29 pm
by McGinge
You gotta admit the levels good though... :D

PostPosted: Mon Jul 16, 2007 11:31 pm
by JonathanF
It was made in C++ ;)

But a level is a level, and creating a level requires a minimal knowledge in algorithms... ;)

PostPosted: Tue Jul 17, 2007 12:09 am
by twifosp
Greetings all!

I just found this forum and I'm glad to know this game doesn't end with the built in levels. A contest a week is awesome! Especially with cool levels like this. I hope I can compete on the same level as some of you!

First go 2110+

Someone posted 2700+ D... does that mean dark as in using force paddles?

PostPosted: Tue Jul 17, 2007 12:52 am
by JustcallmeDrago
twifosp wrote:Greetings all!

I just found this forum and I'm glad to know this game doesn't end with the built in levels. A contest a week is awesome! Especially with cool levels like this. I hope I can compete on the same level as some of you!

First go 2110+

Someone posted 2700+ D... does that mean dark as in using force paddles?


Yes. Using the force (force paddles, as you said, or node stacking, which is used to break things) or having the armadillo go outside the boundaries, where there is no collision detection (he can go through things) automatically make a solution dark.

Contest Rules Link: http://armadillo.metaclassofnil.com/forum/viewtopic.php?t=232