Page 1 of 3

ARF Contest C #XVIII (2007-07-26 to 08-02 18:00 GMT)

PostPosted: Wed Jul 25, 2007 11:14 pm
by NickyNick
Hello peeps,
welcome to the "C" League Contest #18 - White Tree!

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

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

Naming convention is:
[Score]-[Time]-[YourForumName]-[SolutionName]

Example:
1-59_99-MyAss-ImCrazySpeedManiac

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

So, the rules of this contest:
1) The goal is to break as many tensioned clothes on the level as you can. Each broken cloth gives you one point. The clothes must be broken by :armadillo:
2) You must complete the level
3) You can spend any amount of money :D
4) You can build whatever you want and anywhere, except the clothes (do not weld them with any stuff!)
5) The total score determines the winner. In case of equal score, time is determinant

Enjoy :D

PostPosted: Wed Jul 25, 2007 11:18 pm
by scimaster
Did you use C code to make this level, too?

PostPosted: Wed Jul 25, 2007 11:50 pm
by gamma57
Sweet. Fractal Madness!

I think a Cantor Dust plinko type game would be funny.

PostPosted: Thu Jul 26, 2007 4:56 pm
by NickyNick
Yeah, here is the code for this fractal:
Code: Select all
void DrawTree_stage (ARLevel& level, int grade, float length, float angle, int index, float x, float y, float rotation)
{
   float eps = 1e-4;


   int i,j;
   bool found;
   float new_x, new_y;
   int link_type;

   if (grade <= 1)
      link_type = LINK_TYPE_PLATE;
   else
      link_type = LINK_TYPE_BAR;

   // left branch
   new_x = x + cos(rotation + angle) * length;
   new_y = y + sin(rotation + angle) * length;

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

   if (found)
      i = j;
   else
   {
      level.addPoint (new_x, new_y, POINT_TYPE_ANCHOR);
      i = level.points_num-1;
   }

   level.addLink (&level.points[index], &level.points[i], link_type);

   if (grade > 1)
      DrawTree_stage (level, grade-1, length/2, angle, i, new_x, new_y, rotation + angle);

   // middle branch
   new_x = x + cos(rotation) * length;
   new_y = y + sin(rotation) * length;

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

   if (found)
      i = j;
   else
   {
      level.addPoint (new_x, new_y, POINT_TYPE_ANCHOR);
      i = level.points_num-1;
   }

   level.addLink (&level.points[index], &level.points[i], link_type);

   if (grade > 1)
      DrawTree_stage (level, grade-1, length/2, angle, i, new_x, new_y, rotation);

   // right branch
   new_x = x + cos(rotation - angle) * length;
   new_y = y + sin(rotation - angle) * length;

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

   if (found)
      i = j;
   else
   {
      level.addPoint (new_x, new_y, POINT_TYPE_ANCHOR);
      i = level.points_num-1;
   }

   level.addLink (&level.points[index], &level.points[i], link_type);

   if (grade > 1)
      DrawTree_stage (level, grade-1, length/2, angle, i, new_x, new_y, rotation - angle);
}

void DrawTree (int grade, float length, float angle)
{
   ARLevel level;
   level.Init ();
   level.loadLevel ("blank.lvl");
   // blank is empty level

   int link_type;
   float x,y;

   link_type = LINK_TYPE_BAR;
   x = 0;
   y = 0;

   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);

   DrawTree_stage (level, grade, length/2, angle, 1, x,y+length, D3DX_PI/2);

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


PostPosted: Sat Jul 28, 2007 12:08 am
by Teh Flan
gamma57 wrote:Sweet. Fractal Madness!

I think a Cantor Dust plinko type game would be funny.

i made a plinko-like lvl if you want it :D

PostPosted: Sat Jul 28, 2007 1:06 am
by scimaster
SHURE!!

PostPosted: Sat Jul 28, 2007 1:54 am
by scimaster
Here is a plinko level I made.

PostPosted: Sat Jul 28, 2007 10:38 am
by DrRoy
8 items & $66 left :)

ЗЫ. Коля, ты ЖЛОБ!!!
Почему так мало денег дал???????
Или можно с отрицаловкой закончить?

PostPosted: Sat Jul 28, 2007 10:48 am
by NickyNick
DrRoy wrote:ЗЫ. Коля, ты ЖЛОБ!!!
Почему так мало денег дал???????

Я не жлоб :) Просто я хочу, чтобы главным было не время (настроил кучу всего, разломал все подряд и скорей, скорей к выходу), а именно очки - штоп не так легко было 27 достичь :mrgreen:

PostPosted: Sat Jul 28, 2007 10:51 am
by NickyNick
DrRoy wrote:Или можно с отрицаловкой закончить?

It is not allowed to spend more than 3000$.

PostPosted: Sat Jul 28, 2007 4:44 pm
by ioncorpse
Все равно жлоб :D :D

Don't even tried to finish this level.
Hard level = a lot of time = few competitors, medium level = much more competitors = alomost perfect solutions..... and so on.

PostPosted: Sat Jul 28, 2007 5:59 pm
by NickyNick
Well, I've tried to solve the level with 3000$ and it is really damn hard... :oops: :oops:
So, you can spend any amount of money! Woo hoo :D

PostPosted: Sat Jul 28, 2007 6:42 pm
by Overlord
Woo Hoo! Now I can participate!

PostPosted: Sat Jul 28, 2007 9:33 pm
by McGinge
So you are telling us that altho you have set a budget of 3000, we can spend as much as we want??

PostPosted: Sun Jul 29, 2007 2:12 pm
by TomHD
3+- And thats without finishing