Skip to content

jhoenicke/icfp2011

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The code is in three modules:
  engine.ml/engine.mli:  
    Contains the basic game mechanism (cards, slots, moves, etc)
  strategy.ml/strategy.mli:
    The KI of the game.
  main.ml:
    The main method


The strategy is implemented as priority based task queues.  A task is
a list of instructions, which can be simple moves or arbitrary ocaml code.
We implement several strategies.

Revive
======

When a used slot is killed the slot is revived by putting its number in
an arbitrary free and living slot and invoking revive on it.

Ping-Pong Zombie
================

We try to install a zombie process that will install a zombie process in
our slots to keep itself running. This way we can concentrate on other 
things and the zombie process will keep the most important registers of
the opponent low.

When the zombie is killed by the opponent, we will try to reinstall it
immediately.

One-by-One slot attack
======================

We attack every slot one-by one.  For this we determine the health and
build a zombie that helps the slot with itself.  This will usually kill
the slot immediately.

Advanced Reviver
================

Instead of reviving every slot one by one, we create in the beginning
a short program that revives and increments as many slots as fit in
the 1000 apply limit.


Quick Attack
============

In the last minute I tried a different simpler but highly successful
strategy: We try to install a zombie as fast as possible that drains
all the life points from the slots of the opponent.  It does this by
repeatedly invoking help with 8192 points on all slots until the
function apply limit of 1000 is reached.  If the opponent does not
react fast enough it will successful kill him in only 207 turns.
However, this simple strategy can easily be defeated.  Most
importantly, the help command will abort if there are not enough
health points, so if the opponent spent two much health points on his
register 0, the first attack will not work.


Full Strategy:
==============
 1. Quick Attack
     if the opponent does not react, this succeeds in 207 turns.
 2. Prepare Advanced Revival
     in case the opponent does something nasty.
 3. Install Ping-Pong Zombie
 4. One-by-one Slot Attack
 5. Quick Decrement Attack

Now the strategy is to first do a quick attack as in the paragraph
above, then install the advanced reviver