1 / 49

Intel Programming Contest 2012 Puzzle and Contest Rules

Intel Programming Contest 2012 Puzzle and Contest Rules. Document Revision History. version 1.0 – original version. Content of This Presentation. The Contest Rules Getting Started, and Downloading the SDK The Puzzle (Melee) game rules

bin
Download Presentation

Intel Programming Contest 2012 Puzzle and Contest Rules

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Intel Programming Contest 2012Puzzle and Contest Rules

  2. Document Revision History • version 1.0 – original version

  3. Content of This Presentation • The Contest Rules • Getting Started, and Downloading the SDK • The Puzzle (Melee) game rules • The SDK, and the GUI game board (which you can use to play the game, develop strategies, and your player) • Submission Information

  4. Contest Rules and Information • When: • Start time: 21.3.2012 • End time  : 28.4.2012 – Midnight (No late submissions will be accepted) • Who: • The contest is opened to active students (any degree) of one of the following universities: Haifa University, Technion, HUJI, Ben Gurion, Bar Ilan and Tel Aviv University – in one of the following faculties: Computer Science, Computer Engineering, Software Engineering and Information Systems. • Team sizes will be limited to maximum of 2 people  • Prizes: • 1st prize: ASUS UX31Ei5- 2557M • 2nd prize: Xtreamer ultra • 3rd prize: Kindle touch • On 2 person teams each one of the players will get a prize. • Results will be published within 2 weeks of the end of the contest. • Information on the place and time where the prizes will be delivered to the winners will be published at a later time. • The full set of rules and regulations (“התקנון”) is available at the Intel Haifa site.

  5. Contest Rules and Information (Cont’d) • Ongoing information on the competition, corrections, clarifications etc. will be published to the contest blog: • http://ipc2012.blogspot.com/ • Please post any question you might have on our discussion group: • https://groups.google.com/forum/?fromgroups#!forum/intel-programming-contest-2012 • You are encouraged to visit the above 2 sources frequently through out the competition as there might be important notification / changes posted there. • We will post any important comments from the discussion group on the blog, but it might not be immediate.

  6. Getting Started – prep work • Team up! • Working with a partner is much more fun • Don’t worry, it won’t make your prize smaller  • Team size should be up to 2 persons • You can still work alone if you want • Prepare a work area with food and drinks • Move to the next slide…

  7. SDK (Software Development Kit) The SDK includes a gui and test harness you can use to run and test your player. It also includes 2 example solutions, which you can reuse for your player. (Specific information on the SDK capabilities later in this Presentation) The SDK is available for download as a VMware virtual machine (It runs OpenSUSE 11, and has everything you need pre-installed). This is the exact environment in which the players will be competed against each other. Note that although you can develop on any platform, the final result should compile and run on the virtual machine.

  8. The SDK – Download and Install • Download and install the latest VMplayerfrom here. • You may need to register on the VMware site; don’t worry, it’s free! • Download the pre-configured VM, and unzip it: Link • Go into the directory where you unzipped the VM, and double-click on the .vmx file located in it • Username: ishallwinPassword: fameandglory • Try the GUI • ~/Desktop/ipc2012/melee_gui • The source code for the SDK is available as a separate package here • In case of bug fixes, all you need to do is download the SDK into the virtual machine.

  9. Disclaimer • The organizers tried their best to properly define the puzzle and correctly write the reference code and SDK • However, we are humans and make mistakes… • Please: • send us feedback ASAP if you see mistakes, inaccuracy or inconsistency in the documentation or in the code (via the forum) • re-visit the contest blog and forum for potential daily updates during the competition. • There might be minor adjustments to the contest definition and rules during the competition – please visit the blog regularly for updates!! • The official rules are the ones stated in the latest version of this document that will be posted on the contest blog • organize your code in such a way that you can easily update to newer versions of the SDK, in case such need arises. • Your submission will have to be compliant to the final version of the rules

  10. The Puzzle MELEE : a confused struggle; especially: a hand-to-hand fight among several people (Webster)

  11. The Puzzle in Brief Win by domination on the Melee board

  12. Definitions • N – is the size of the board, N is an even number • Melee board is of size N x N squares • Stones are colored green or yellow • K squares are designated forbidden squares, K is an even number, K ~= N*N/16 • A regular square can host zero or more yellow stones, and zero or more green stones • A forbidden square can not host any stones ever

  13. Original setup • K squares are randomly selected as forbidden squares • Forbidden squares are never adjacent to other forbidden squares • K ~= N*N/16 • K is even • In this example • N is 6 • K is 2 N forbidden square regular square N

  14. Original setup, cont’d 1 1 1 1 • Half the regular squares are randomly populated with one green stone each • The remaining half of the regular squares are populated with one yellow stone each • The number of stones of each color is: • (N*N – K)/2 • In this example • (6*6 – 2)/2 = 17 • The number 1 on each stone denotes that there’s one stone • Each regular square has exactly one stone, either yellow or green. 5 1 1 1 1 4 1 1 1 1 1 1 1 3 1 1 Y coordinates 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 2 3 4 5 X coordinates

  15. The Melee State Machine Board Yellow State Si+Y State Si+1 Yellow Player Moves melee.in melee.out Board State Si Evaluator Board Green State Si+G Green Player Moves melee.out melee.in the two players make simultaneous and independent moves at this turn

  16. Legal Step • Each stone can be moved to any of the adjacent regular squares. • The stone can not be moved off the board. • The stone cannot be moved to a forbidden square • The stone can stay on its own square. Not moving at all is also a legal step. • The green circles denote the destination locations for a legal step for the example stones 1 1

  17. Player moves all stones • At each turn of the game, each player makes a legal step with all of its stones. • The stones can be stacked on top of each other • In the example on this page, the before setup of the green stones changes to the after setup as a result of a legal step on each stone • The numbers on the stones denote the stone count in the stack • Notice that one stone did not move at all, that is also a legal step. 1 1 2 1 2 3 1 2 2 2 2 Before After • The green arrows above show the step for each stone • In the case of a stack of 2 or more stones, each stone can be moved independently to any legal destination. • the number next to the arrow indicates the number of stones that have been moved • Lack of arrow indicates that the stone(s) was not moved at all

  18. State Machine Example Yellow Moves output file that describes yellow steps Board State Si+Y 2 melee.in melee.out 2 3 1 1 Evaluator 1 1 2 2 1 2 1 Yellow and Green players make simultaneous and independent moves from each other 2 3 1 2 1 3 1 3 2 5 2 2 1 2 2 Board State Si Board State Si+Y+G Board State Si+1 1 3 1 2 3 melee.in melee.out Board State Si+G file that describes board state Si 2 5 output file that describes green steps 2 Green Moves

  19. The Evaluator • The Evaluator is written by the contest organizers • The Evaluator does the following: • Merges states Si+Y and Si+G into Si+Y+G • From board state Si+Y+G computes board state Si+1 • Computes state of every stone in Si+1 from state Si+Y+G • No stone on board Si+1 is affected by any other stone from board Si+1 • Post evaluation (Si+1), if a square has stones of both colors, their count must be equal Evaluator 2 2 4 4 1 1 1 Board State Si+1 Board State Si+Y+G

  20. Capturing Opponent’s Stones by Stomping If - on the same square - one player has more stones than the opponent, then the stones of the opponent are captured and removed from the board Evaluator 2 2 1 stomp Board State Si+Y+G Board State Si+1

  21. Capturing Opponent’s Stones by Stomping cont’d • In the example below: • yellow 8 stomps green 3 • green 5 stomps yellow 4 • yellow 2 and green 2 don’t affect each other since their count is equal Evaluator 3 8 8 stomp 2 2 2 2 5 5 4 stomp Board State Si+Y+G Board State Si+1

  22. Capturing Opponent’s Stones by Trapping Given a square Q and its (max eight) adjacent neighbor squares R, if R contains stones of exact count 1, 2 and 3 belonging to one player, they trap and capture all of opponent’s stone(s) on square Q (if any). The captured stone(s) are removed from board. Evaluator R R R R R Q 5 2 2 3 3 trap R R R 1 1 Board State Si+Y+G Board State Si+1

  23. Capturing Opponent’s Stones by Trapping cont’d The same stones can participate in more than one trap. In the example below, yellow 2 and 3 participate in two separate traps Evaluator 1 4 1 trap 5 2 2 3 3 trap 1 1 Board State Si+Y+G Board State Si+1

  24. Combined effects of Stomping and Trapping • In the example below: • Yellow 1, 2, 3 traps green 8 • Green 8 stomps yellow 6 • Green 1, 2, 3 traps yellow 3 Stones can participate in multiple stomps and traps at a time. The effect of all stomps and traps are carried to state Si+1 Evaluator 3 2 3 2 trap 8 3 2 6 2 trap stomp 1 5 1 5 1 1 Board State Si+Y+G Board State Si+1

  25. Examples of steps In the next few slides we show some examples of legal steps Move a stack of stones together 4 4 4 Board State Si Board State Si+G

  26. Examples of steps cont’d Spread the stones 1 1 4 2 2 1 1 Board State Si Board State Si+G

  27. Examples of steps cont’d Gather stones into a bigger stack 1 2 2 4 1 Board State Si Board State Si+G

  28. Examples of steps cont’d Swap two stacks of stones. Two modesare shown here, end results are the same. 2 Board State Si 2 7 7 7 2 2 Board State Si Board State Si+G 5 7

  29. Contest Specifics • N the size of the board is 24 • Max turns 72 • Each turn will last 3 seconds • at each turn your executable will start from scratch and need to finish in 3 second or will be killed • make sure you write a melee.out file in the given 3 seconds, or else your stones won’t move at all in that turn • You win by either: • removing all of the opponent’s stones • having more stones than the opponent at the end of the game (after turn 72) • Draw: • if both players have the equal amount of stones at the end of the game • Scoring • Win: 3 points • Draw: 1 point • Loss: 0 points

  30. Judging • Each submission will be run against each submission, T times • T will be determined based on number of submissions and number of available servers, most likely it will be in the vicinity of 4. • The starting position boards will be generated randomly. • Each board will be used for 2 games – One with Player A as the Green player, and B as the yellow player, and another one with the same board, but roles reversed. • This is done to minimize the impact of the initial board selection on the overall competition scores. • Your score will be the sum of all scores you racked up from each and every game. • In the (unlikely) event of ties between two submissions, we’ll run them against each other as many times as needed, until a winner emerges. • AKA, Tie breaker.

  31. Executable and File I/O • You need to create an executable called melee • It needs to read a file melee.in that contains the board state Si • It needs to write a file melee.out that contains the steps you take • The opponent’s last move is written out to file melee.lastmove. You can read the file if you want to analyze the opponent’s steps/strategy. • You can write/read additional files if you like – to keep a chronicle of the game, statistics, cachesor any other reason. • The Entire IO, executable load time, JVM warm-up (in case of Java VM based languages), etc. should be within the 3 seconds allowed play time.

  32. N NW NE melee.in file format W E SW SE N, board size S 10 . 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 3,0 0,0 . 2,0 . 0,0 0,0 0,0 0,0 0,0 0,0 3,0 0,0 2,0 0,0 0,0 0,0 0,0 0,0 0,0 0,4 0,33 3,0 1,0 0,0 0,0 0,0 0,0 6,0 1,0 1,1 3,0 0,0 2,0 0,0 0,0 0,0 0,0 2,0 0,0 . 3,0 0,0 0,0 0,0 0,0 0,0 0,0 2,0 0,0 2,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 . 0,0 0,0 0,0 0,0 0,0 0,0 . Y 9 Y 8 Y 0 X 0 X 1 Forbidden Square Your stone count Opponent stone count X 9

  33. melee.out file format Your program will write the steps you took during the turn 6 2 3 NE 0 7 1 S 3 3 3 SW … etc… Direction of the step must be one of: N meaning north NE meaning north east E meaning east SE meaning south east S meaning south SW meaning south west W meaning west NW meaning north west X Y Stone count being moved Direction of the step N melee.out NW NE W E The stones that are not moved, stay in place SW SE S

  34. Error Handling • If your program crashes • we’ll take the final melee.out file that you wrote (if any) • if you did not write melee.out, none of your stones will be moved in that turn • the game goes on • If the melee.out file you write is not there on time, is corrupted, or is unreadable: • none of your stones will be moved in that turn • the game goes on • If you make an illegal step: • step off board • step on a forbidden square • step with more stones than you actually possess • those steps will be ignored, those stones won’t be moved • Messages will be printed by the GUI for all these errors • Try to avoid them to reduce confusion

  35. Other Restrictions • You are NOT ALLOWED to interfere with the opponents player, the runtime or any other part of the operating system. Any such interference will disqualify the player. Examples of such interference include but are not limited to: • Changing permissions so that the opponent cannot run • Running a daemon, or any other background process to slow down the opponent. • Please play nice, and win by having the best strategy!

  36. The Game’s Software Development Kit (SDK)

  37. SDK • Get the SDK Online on our Blog: • Download the VMWare machine – it contains everything pre-installed and ready to go. • There is also a stand alone package on the site containing only the melee board GUI and test-harness and the demo players. • The main use of this bundle is in case we update the SDK, so you don’t have to re-download the full virtual machine. • Note that if you decide to use it on your own Linux box itmight require installation of additional libraries like Tcl8.4, TK8.4, GCC and some other packages. • Our recommendation is: go with the VM. • It includes: • melee_gui: interactive gameplay and visualization • gymelee: A baseline C++ reference solution • plmelee: perl reference solution, not very good, but illustrative • tclmelee: tcl reference solution, not very good, but illustrative • You can reuse code from the reference solutions if you’d like.

  38. melee_gui quickstart The gui will look like this when you bring it up:

  39. melee_gui quickstart Turn off "Options->Show Future State Mode" to reduce clutter... Then, click and drag middle-mouse button upwards to zoom in:

  40. melee_gui quickstart Click and drag left mouse button to move a stone: Notice on the right that the stone you moved has now disappeared...

  41. melee_gui quickstart Turn on the "Options->Show Future State Mode" to see what you did... Notice that there's a hollow color "2" where you dropped the stone. This indicates that if you commit your turn now, it will become 2 stones

  42. melee_guiquickstart And if moved all adjacent stones to that square, it would look like this: The green hollow circles show the stone count at state Si+G

  43. melee_gui quickstart Then, click the commit button (or hit enter key) to complete your turn: Basically: - the solid colors show you what you have now - the hollow colors show you what you will have at state Si+G (pre-evaluation)

  44. melee_gui options % melee_gui -h -playerA <program> use <program> as player A. (defaults to HUMAN) -playerB <program> use <program> as player B. (defaults to HUMAN) -log <file> write out log of moves to this file (useful with -replay) -replay <file> replay the game stored in <file> -srand <seed> set the random seed to <seed>. (default=[clock seconds]) -nullgt run in non-gui mode -startboard <file> use a board that was saved from a previous game as the starting point. -startpaused start the game in pause mode. -timelimit <limit> give each player <limit> seconds for each turn. (default=3) -roundlimit <limit> give each player <limit> turns in the game. (default=72) -size <N> set the board size to <N>. (default=24) Usage Examples: To get help on running the gui: melee_gui-h To run the melee and play the game interactively using the gui: melee_gui To play the game against your program called "melee": melee_gui-playerB ./melee To play your program against Gyuszi's reference implementation: melee_gui-playerA ./melee -playerB ./gymelee/melee To play your program against itself: melee_gui-playerA ./melee -playerB ./melee To play your program against itself and save the log: melee_gui-playerA ./melee -playerB ./melee -log game1.log To replay the previous game, but start paused so you can see the action unfold: melee_gui-playerA ./melee -playerB ./melee -replay game1.log -startpaused To play with a smaller board than default (note: size must be a positive even integer): melee_gui-size 10 To run melee and initialize the board from a file that was previously saved (using File->Save): melee_guifile.melee

  45. melee_gui options cont’d In manual mode, you can specify the number of stones you move at a time by hitting the desired number on the keyboard. Stone select will show you that option. In the picture above, we wanted to move 3 green stones from the stack of 4.

  46. melee_gui bindings Left-click and drag: move a stone Middle-click and drag up: zoom in Middle-click and drag down: zoom out Hit "f" key to fit the board in the window Hit "Control-n" to start a new game from scratch Hit "Control-r" to reset the game back to its initial state Hit "Control-s" to save the current board state to a file Hit "Control-o" to load the board state from a previously saved file Hit "Control-z" to undo the last round Hit "Control-y" to redo the last round (after an undo) Hit "Control-p" to pause the game Hit "Control-u" to turn on/off the future state (hollow stones) Hit a number on the keyboard to specify the number of stones to be moved from a stack. Shift-Left-Click rotates the board in 3D

  47. melee_gui 3D mode Shift-Left-Click rotates the board in 3D

  48. Submitting your Player • Submissions should be send by 28.4.2012 midnight to: ipc2012@intel.com • The submission should include • 1 single compressed file (ZIP or gzip) named <team_name>.zip, or <team_name>.tar.gz. The file should include: • An executable called melee as described in this document • A scripted named compile that generates melee (it can be empty if no compilation is needed from source code). • A README file containing a brief explanation of your player and strategy. • All your source code • Any supporting library you are using. • To run your player we will do something like this: • gtar-zxvfsubmission.tgz • ./compile • ./melee • Your team name • Your names, email addresses, phone number and the university, faculty and degree you are studying for. • You will need to submit a brief description of you implementation / strategy (As a README file – see above) • Your submission must compile / run on the Linux virtual machine provided for download on the contest blog. • You can use any programming language available on the VM (if you want a language not available, please contact us through the forum) • You can use open-source libraries • rule of thumb : if the library is licensed under an Open Source license (OSI approved), then you can use those libraries in your submission. • Do not use any proprietary code: • we should be able to publish your submission as an open source code. • You are encouraged to use multithreading • You cannot run daemons on the machines to snoop into other submissions, slowing down other processes or otherwise trying to cause harm to others

  49. Good Luck – And Have Fun!

More Related