Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Jumping metagame

form shortest path

  • Please log in to reply
3 replies to this topic

#1 tachyon

tachyon

    CC Lurker

  • New Member
  • Pip
  • 5 posts

Posted 13 December 2008 - 02:25 PM

Hi everybody,

I would like to proprose something like a metagame. If anyone is interested in testing himself in algorithm analysis and programming performance (and have some fun too :)) will be welcome.

These are the rules of my invented game:

- You will have a board of N x N squares.
- Each square can have a number or can be empty. If it has a number, it will show the number of squares to jump from that square to any other (horizontal and vertical directions); if it is empty you can't jump to that square.
- Everytime you jump to a square the value of the square changes to the difference between the previous square value and the actual square value (absolute value).
- There will always be an initial square and a final square.

There also a few obvious things, like:

- The value of the final square is irrelevant,
- You can't jump to a square with the same value as the one you are jumping from, because it will produce a zero-jump,
- etc...

I don't know if the rules of the game are clear. If you have any question, please, ask.

An example:

C| - 0 -
B| 3 2 3
A| 3 - 1
--------
_| 1 2 3

Initial square: A3
Final square: C2

Here we have a 3x3 board and we need to go from the initial square to the final one. The shortest path will be this one: A3-B3, B3-B1, B1-B2, B2-C2 (4 jumps). There is also a 7 jump path: A3-B3, B3-B1, B1-A1, A1-A3, A3-B3, B3-B2, B2-C2.

So here is the metagame:

Whoever gets the 6x6 board where the shortest path to solve it is the highest wins (the initial and final square can be anyone in the board).

Well... Actually there is nothing to win but my congratulations, and, since I haven't decided a name for this stupid game, the winner can do it. Let's say that the final date to post results is 01 January 2009 00:00 (GMT +01:00), just to put a limit.

So, if you want to give it a try, choose your favourite programming language, and whenever you have a good board, post it here and I will validate it.

That's all. Thank you for your time.

Edited by tachyon, 13 December 2008 - 06:07 PM.
Mistake while rewriting

  • 0

#2 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 13 December 2008 - 03:10 PM

Your references to blue square and green one make me suspect you have taken this from another location. It's not taken from the web, which makes me suspect this is a homework assignment you're trying to get the logic for.
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#3 tachyon

tachyon

    CC Lurker

  • New Member
  • Pip
  • 5 posts

Posted 13 December 2008 - 06:36 PM

Sorry for that; now it is edited. I firstly thought to include an image to illustrate the example and then I saw that I couldn't because I needed to have 10 post or greater to do that, but I forgot to remove that reference.

Here is the link to the image (w/o http in front of it):

img214.imageshack.us/img214/1673/tablerouk7.gif

This is not a homework. In fact I have built a mostly nice board generator and a board solver. I have enough free time to invest part of it in this kind of things :D. I am just trying to give something to people who enjoy these things as much as I do.
  • 0

#4 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 13 December 2008 - 06:52 PM

It sounds like the sort of thing that I would create an engine for solving and solve recursively.
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/






Also tagged with one or more of these keywords: form, shortest path

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download