User Tools

Site Tools


icypc_instructions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
icypc_instructions [2010/11/11 12:36] jtkorbicypc_instructions [2011/11/08 11:54] (current) jtkorb
Line 1: Line 1:
 ====== How to Set Up for ICYPC Ladder Competition ====== ====== How to Set Up for ICYPC Ladder Competition ======
  
-  - Create ~/icypc (directory in your home directory)+  - Create ''~/icypc'' (directory in your home directory)
   - Make world readable/executable (''chmod 755'')   - Make world readable/executable (''chmod 755'')
-  - Create executable shell scripts in ~/icypc +  - Create executable shell scripts in ''~/icypc'' (see the next section for examples): 
-    * ~/icypc/hunter +    * ''~/icypc/hunter'' 
-    * ~/icypc/planter+    * ''~/icypc/planter''
     * etc     * etc
 +  - Naming convention: Please do not use ''-'' or ''.'' characters in your script names (just alphanumerics).
   - Be sure to make them executable (again, ''chmod 755'' will do it)   - Be sure to make them executable (again, ''chmod 755'' will do it)
-  - Register program(s) at ladder website (permanent URL coming soon)+  - Register program(s) at ladder website: [[https://pc.cs.purdue.edu/icypc]] 
 +  - To help with some automation to locate competitors, please ensure that the only executable files in ''~/icypc'' are competitor scripts.
  
-===== Script Examples =====+A quick way to ensure that your icypc directory and all files are world-readable and (where appropriate) world-executable: 
 + 
 +  % chmod -R o+rX ~/icypc 
 + 
 +This command recursively (''-R'') sets all permissions in your ''~/icypc'' directory and subdirectories to world ("o" for "other") readable ("r") and executable ("X", which sets the execute bit only on directories and files that are already executable). 
 + 
 +Note that this command makes everything in your ''icypc'' directory readable, including source code if it is there. 
 + 
 +You might find it useful to create subdirectories in ''~/icypc'' (or elsewhere) to contain your source code and a working copy of your binaries (e.g., .class files for Java).  Then, when you've sufficiently debugged your competitor and want to take on other players on the ladder, copy your binaries to the ''~/icypc'' directory for execution by your competitor script. 
 + 
 +====== Ladder Rules ====== 
 + 
 +  - Any time a challenger beats a defender, the two competitors swap positions in the ladder. 
 +  - If a challenger scores 0 points in a match, that competitor is //benched//, making it unavailable for future matches until it has been //readied// again for competition (e.g., by resubmitting it by the original author). 
 + 
 +====== Script Examples ======
  
 **''hunter''** **''hunter''**
-  #!/bin/bash+  #!/bin/sh
   cd /homes/YOUR-LOGIN-ID/icypc   cd /homes/YOUR-LOGIN-ID/icypc
   /p/java-1.6/bin/java java_example.Hunter   /p/java-1.6/bin/java java_example.Hunter
  
 **''camper''** **''camper''**
-  #!/bin/bash+  #!/bin/sh
   cd /homes/YOUR-LOGIN-ID/icypc   cd /homes/YOUR-LOGIN-ID/icypc
   c++_example/camper   c++_example/camper
      
-Note that your script must be world-executable and all files needed by it must be world-readable.  For example, you might set permissions like this...+====== Viewing Instructions ======
  
-  % chmod -R o+rX /homes/YOUR-LOGIN-ID/icypc+You can view a replay of any ladder match. (Trace files are kept in ''/homes/cs390cp/traces''.)
  
-This command recursively sets all permissions in your icypc directory to world ("o" for "other"readable ("r") and executable ("X", which sets the execute bit only if on directories and files that are already exeuctable).+  * To view a match in 2D (''NNN'' is the match number)
 + 
 +  % /homes/cs390cp/bin/view2d NNN 
 + 
 +  * To view a match in 3D (''NNN'' is the match number)
 + 
 +  % /homes/cs390cp/bin/view3d NNN 
 + 
 +  * To view the stdout from the match: 
 + 
 +  % /homes/cs390cp/bin/viewso NNN 
 + 
 +  * To view the stderr from the match: 
 + 
 +  % /homes/cs390cp/bin/viewse NNN 
 + 
  
 ====== To Play a "Friendly" Competition with One Another ====== ====== To Play a "Friendly" Competition with One Another ======
Line 35: Line 67:
   % java -jar icypc.jar -player pipe 1 /homes/li400/icypc/hunter -player pipe 1 /homes/wzhang/icypc/planter   % java -jar icypc.jar -player pipe 1 /homes/li400/icypc/hunter -player pipe 1 /homes/wzhang/icypc/planter
  
-There is an example "battle" script in /homes/jtk/icypc/battle, which takes four arguments:+There is an example "battle" script in ''/homes/cs390cp/bin/battle'', which takes four arguments:
  
-  % /homes/jtk/icypc/battle li400 hunter wzhang planter+  % /homes/cs390cp/bin/battle li400 hunter wzhang planter
      
-Also, see the "hunter" and "camper" scripts in that directory for examples of running Java and C++ competitors.  There is also a "twoer" script that uses a two hunter plus two planter strategy. +Also, see the "hunter" and "camper" scripts in /homes/jtk/icypc for examples of running Java and C++ competitors.  There is also a "twoer" script that uses a two hunter plus two planter strategy.
- +
-====== Advanced Instructions ====== +
- +
-To set up the web ladder or configure the 3D viewer: [[icypc_challenge_installation|here]]+
icypc_instructions.1289507807.txt.gz · Last modified: 2010/11/11 12:36 by jtkorb