+Play a game of Trap the Cap. If players make illegal moves, disqualify them
+and restart the game. Terminate the game if there‘s a winner,
+there‘s only one player left, or the game has gone on too long.
+
+A class to record each of the states previously found in a game. Note that
+this is a deep copy of the pieces and what they‘ve captured, so
+you‘ll need to convert back
+
+Read a game description file and convert it into a Game object and set of Move
+objects. Note that Game.read_game method
+returns multiple values, so this one does too.
+
# File lib/libttc.rb, line 90
+ definitialize(spokes, spoke_length, arc_length)
+ # A hash of all positions, indexed by position names
+ @positions = Hash.new
+ @centre = Position.new('ac'+spoke_length.to_s, false, false)
+ @positions['ac'+spoke_length.to_s] = centre
+ a1_corner = nil
+ end_of_previous_arc = nil
+
+ # Do each arc-spoke-base set
+ (?a...(?a+spokes)).eachdo|arc_code|
+ arc = arc_code.chr
+ base = Position.new(arc, false, true)
+ this_arc = Array.new
+
+ # build the arc
+ (1..arc_length).eachdo|arc_position|
+ position_name = arc+arc_position.to_s
+ arc_place = Position.new(position_name, arc_position==4, false)
+ arc_place.neighbours = []
+ @positions[position_name] = arc_place
+ this_arc<<arc_place
+ a1_corner = a1_corner||arc_place
+ end
+ (0...arc_length).eachdo|arc_position|
+ ifarc_position>0
+ this_arc[arc_position].neighbours<<this_arc[arc_position-1]
+ end
+ ifarc_position< (arc_length-1)
+ this_arc[arc_position].neighbours<<this_arc[arc_position+1]
+ end
+ end
+
+ # build the spoke
+ this_spoke = Array.new
+ (1..(spoke_length-1)).eachdo|spoke_position|
+ position_name = arc+"c"+spoke_position.to_s
+ spoke_place = Position.new(position_name, spoke_position==3, false)
+ spoke_place.neighbours = []
+ @positions[position_name] = spoke_place
+ this_spoke<<spoke_place
+ end
+ (0...(spoke_length-1)).eachdo|spoke_position|
+ ifspoke_position>0
+ this_spoke[spoke_position].neighbours<<this_spoke[spoke_position-1]
+ end
+ ifspoke_position<spoke_length-2
+ this_spoke[spoke_position].neighbours<<this_spoke[spoke_position+1]
+ end
+ end
+
+ # tie the spoke and arc together,
+ this_arc[0].neighbours<<this_spoke[0]
+ this_spoke[0].neighbours<<this_arc[0]
+
+ # tie the spoke to the centre, and
+ this_spoke[-1].neighbours<<@centre
+ @centre.neighbours<<this_spoke[-1]
+
+ # tie the base to the arc
+ base = Position.new(arc, false, true)
+ @positions[arc] = base
+ base.neighbours<<this_arc[0]
+ this_arc[0].neighbours<<base
+
+ # record the ends of the arc for tying to adjacent arcs
+ ifend_of_previous_arc
+ end_of_previous_arc.neighbours<<this_arc[0]
+ this_arc[0].neighbours<<end_of_previous_arc
+ end
+ end_of_previous_arc = this_arc[-1]
+
+ end# arc
+
+ # tie both ends of the rim together
+ a1_corner.neighbours<<end_of_previous_arc
+ end_of_previous_arc.neighbours<<a1_corner
+
+ cache_valid_moves
+
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Board.src/.svn/text-base/M000025.html.svn-base b/doc/classes/Board.src/.svn/text-base/M000025.html.svn-base
new file mode 100644
index 0000000..4db9d1c
--- /dev/null
+++ b/doc/classes/Board.src/.svn/text-base/M000025.html.svn-base
@@ -0,0 +1,18 @@
+
+
+
+
+
+ to_s (Board)
+
+
+
+
+
# File lib/libttc.rb, line 171
+ defto_s
+ layout
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Board.src/.svn/text-base/M000026.html.svn-base b/doc/classes/Board.src/.svn/text-base/M000026.html.svn-base
new file mode 100644
index 0000000..14896fe
--- /dev/null
+++ b/doc/classes/Board.src/.svn/text-base/M000026.html.svn-base
@@ -0,0 +1,26 @@
+
+
+
+
+
+ layout (Board)
+
+
+
+
+
# File lib/libttc.rb, line 176
+ deflayout
+ out_string = ""
+ @positions.keys.sort.eachdo|position|
+ out_string<<sprintf("%s touches ", @positions[position])
+ @positions[position].neighbours.eachdo|neighbour|
+ out_string<<sprintf("%s, ", neighbour)
+ end
+ out_string<<sprintf("\n")
+ end
+ out_string
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Board.src/.svn/text-base/M000027.html.svn-base b/doc/classes/Board.src/.svn/text-base/M000027.html.svn-base
new file mode 100644
index 0000000..b6a5ed9
--- /dev/null
+++ b/doc/classes/Board.src/.svn/text-base/M000027.html.svn-base
@@ -0,0 +1,46 @@
+
+
+
+
+
+ cache_valid_moves (Board)
+
+
+
+
+
# File lib/libttc.rb, line 191
+ defcache_valid_moves
+ # A hash of arrays. The has key is the name of a positions. The array
+ # element [i] stores the positions that are i spaces from here
+ @valid_moves = Hash.new
+ # A hash of hashes. Given two names, return the shortest distance between
+ # the two locations
+ @distance_between = Hash.new
+ @positions.eachdo|place, position|
+ @valid_moves[place] = Array.new
+ @distance_between[place] = Hash.new
+ @valid_moves[place][0] = [place]
+ @distance_between[place][place] = 0
+ # Find the shortest routes by Dijkstra's algorithm
+ agenda = [position]
+ closed_list = [position]
+ i = 1
+ whilenotagenda.empty?
+ @valid_moves[place][i] = []
+ new_agenda = []
+ agenda.eachdo|pos|
+ valid_extensions = pos.neighbours.reject {|new_position|closed_list.include?(new_position) }
+ @valid_moves[place][i] +=valid_extensions
+ valid_extensions.each {|ext|@distance_between[place][ext.place] ||=i }
+ closed_list+=valid_extensions
+ new_agenda+=valid_extensions
+ end
+ agenda = new_agenda
+ i+=1
+ end
+ end
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Board.src/.svn/text-base/M000034.html.svn-base b/doc/classes/Board.src/.svn/text-base/M000034.html.svn-base
new file mode 100644
index 0000000..5294404
--- /dev/null
+++ b/doc/classes/Board.src/.svn/text-base/M000034.html.svn-base
@@ -0,0 +1,95 @@
+
+
+
+
+
+ new (Board)
+
+
+
+
+
# File lib/libttc.rb, line 82
+ definitialize(spokes, spoke_length, arc_length)
+ # A hash of all positions, indexed by position names
+ @positions = Hash.new
+ @centre = Position.new('ac'+spoke_length.to_s, false, false)
+ @positions['ac'+spoke_length.to_s] = centre
+ a1_corner = nil
+ end_of_previous_arc = nil
+
+ # Do each arc-spoke-base set
+ (?a...(?a+spokes)).eachdo|arc_code|
+ arc = arc_code.chr
+ base = Position.new(arc, false, true)
+ this_arc = Array.new
+
+ # build the arc
+ (1..arc_length).eachdo|arc_position|
+ position_name = arc+arc_position.to_s
+ arc_place = Position.new(position_name, arc_position==4, false)
+ arc_place.neighbours = []
+ @positions[position_name] = arc_place
+ this_arc<<arc_place
+ a1_corner = a1_corner||arc_place
+ end
+ (0...arc_length).eachdo|arc_position|
+ ifarc_position>0
+ this_arc[arc_position].neighbours<<this_arc[arc_position-1]
+ end
+ ifarc_position< (arc_length-1)
+ this_arc[arc_position].neighbours<<this_arc[arc_position+1]
+ end
+ end
+
+ # build the spoke
+ this_spoke = Array.new
+ (1..(spoke_length-1)).eachdo|spoke_position|
+ position_name = arc+"c"+spoke_position.to_s
+ spoke_place = Position.new(position_name, spoke_position==3, false)
+ spoke_place.neighbours = []
+ @positions[position_name] = spoke_place
+ this_spoke<<spoke_place
+ end
+ (0...(spoke_length-1)).eachdo|spoke_position|
+ ifspoke_position>0
+ this_spoke[spoke_position].neighbours<<this_spoke[spoke_position-1]
+ end
+ ifspoke_position<spoke_length-2
+ this_spoke[spoke_position].neighbours<<this_spoke[spoke_position+1]
+ end
+ end
+
+ # tie the spoke and arc together,
+ this_arc[0].neighbours<<this_spoke[0]
+ this_spoke[0].neighbours<<this_arc[0]
+
+ # tie the spoke to the centre, and
+ this_spoke[-1].neighbours<<@centre
+ @centre.neighbours<<this_spoke[-1]
+
+ # tie the base to the arc
+ base = Position.new(arc, false, true)
+ @positions[arc] = base
+ base.neighbours<<this_arc[0]
+ this_arc[0].neighbours<<base
+
+ # record the ends of the arc for tying to adjacent arcs
+ ifend_of_previous_arc
+ end_of_previous_arc.neighbours<<this_arc[0]
+ this_arc[0].neighbours<<end_of_previous_arc
+ end
+ end_of_previous_arc = this_arc[-1]
+
+ end# arc
+
+ # tie both ends of the rim together
+ a1_corner.neighbours<<end_of_previous_arc
+ end_of_previous_arc.neighbours<<a1_corner
+
+ cache_valid_moves
+
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Board.src/.svn/text-base/M000035.html.svn-base b/doc/classes/Board.src/.svn/text-base/M000035.html.svn-base
new file mode 100644
index 0000000..ed822f1
--- /dev/null
+++ b/doc/classes/Board.src/.svn/text-base/M000035.html.svn-base
@@ -0,0 +1,18 @@
+
+
+
+
+
+ to_s (Board)
+
+
+
+
+
# File lib/libttc.rb, line 163
+ defto_s
+ layout
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Board.src/.svn/text-base/M000036.html.svn-base b/doc/classes/Board.src/.svn/text-base/M000036.html.svn-base
new file mode 100644
index 0000000..3aa04d2
--- /dev/null
+++ b/doc/classes/Board.src/.svn/text-base/M000036.html.svn-base
@@ -0,0 +1,26 @@
+
+
+
+
+
+ layout (Board)
+
+
+
+
+
# File lib/libttc.rb, line 168
+ deflayout
+ out_string = ""
+ @positions.keys.sort.eachdo|position|
+ out_string<<sprintf("%s touches ", @positions[position])
+ @positions[position].neighbours.eachdo|neighbour|
+ out_string<<sprintf("%s, ", neighbour)
+ end
+ out_string<<sprintf("\n")
+ end
+ out_string
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Board.src/.svn/text-base/M000037.html.svn-base b/doc/classes/Board.src/.svn/text-base/M000037.html.svn-base
new file mode 100644
index 0000000..4847c58
--- /dev/null
+++ b/doc/classes/Board.src/.svn/text-base/M000037.html.svn-base
@@ -0,0 +1,45 @@
+
+
+
+
+
+ cache_valid_moves (Board)
+
+
+
+
+
# File lib/libttc.rb, line 182
+ defcache_valid_moves
+ # A hash of arrays. The has key is the name of a positions. The array element [i] stores the
+ # positions that are i spaces from here
+ @valid_moves = Hash.new
+ # A hash of hashes. Given two names, return the shortest distance between the two locations
+ @distance_between = Hash.new
+ @positions.eachdo|place, position|
+ @valid_moves[place] = Array.new
+ @distance_between[place] = Hash.new
+ @valid_moves[place][0] = [place]
+ @distance_between[place][place] = 0
+ # Find the shortest routes by Dijkstra's algorithm
+ agenda = [position]
+ closed_list = [position]
+ i = 1
+ whilenotagenda.empty?
+ @valid_moves[place][i] = []
+ new_agenda = []
+ agenda.eachdo|pos|
+ valid_extensions = pos.neighbours.reject {|new_position|closed_list.include?(new_position) }
+ @valid_moves[place][i] +=valid_extensions
+ valid_extensions.each {|ext|@distance_between[place][ext.place] ||=i }
+ closed_list+=valid_extensions
+ new_agenda+=valid_extensions
+ end
+ agenda = new_agenda
+ i+=1
+ end
+ end
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Board.src/.svn/text-base/M000054.html.svn-base b/doc/classes/Board.src/.svn/text-base/M000054.html.svn-base
new file mode 100644
index 0000000..36d997b
--- /dev/null
+++ b/doc/classes/Board.src/.svn/text-base/M000054.html.svn-base
@@ -0,0 +1,95 @@
+
+
+
+
+
+ new (Board)
+
+
+
+
+
# File lib/libttc.rb, line 94
+ definitialize(spokes, spoke_length, arc_length)
+ # A hash of all positions, indexed by position names
+ @positions = Hash.new
+ @centre = Position.new('ac'+spoke_length.to_s, false, false)
+ @positions['ac'+spoke_length.to_s] = centre
+ a1_corner = nil
+ end_of_previous_arc = nil
+
+ # Do each arc-spoke-base set
+ (?a...(?a+spokes)).eachdo|arc_code|
+ arc = arc_code.chr
+ base = Position.new(arc, false, true)
+ this_arc = Array.new
+
+ # build the arc
+ (1..arc_length).eachdo|arc_position|
+ position_name = arc+arc_position.to_s
+ arc_place = Position.new(position_name, arc_position==4, false)
+ arc_place.neighbours = []
+ @positions[position_name] = arc_place
+ this_arc<<arc_place
+ a1_corner = a1_corner||arc_place
+ end
+ (0...arc_length).eachdo|arc_position|
+ ifarc_position>0
+ this_arc[arc_position].neighbours<<this_arc[arc_position-1]
+ end
+ ifarc_position< (arc_length-1)
+ this_arc[arc_position].neighbours<<this_arc[arc_position+1]
+ end
+ end
+
+ # build the spoke
+ this_spoke = Array.new
+ (1..(spoke_length-1)).eachdo|spoke_position|
+ position_name = arc+"c"+spoke_position.to_s
+ spoke_place = Position.new(position_name, spoke_position==3, false)
+ spoke_place.neighbours = []
+ @positions[position_name] = spoke_place
+ this_spoke<<spoke_place
+ end
+ (0...(spoke_length-1)).eachdo|spoke_position|
+ ifspoke_position>0
+ this_spoke[spoke_position].neighbours<<this_spoke[spoke_position-1]
+ end
+ ifspoke_position<spoke_length-2
+ this_spoke[spoke_position].neighbours<<this_spoke[spoke_position+1]
+ end
+ end
+
+ # tie the spoke and arc together,
+ this_arc[0].neighbours<<this_spoke[0]
+ this_spoke[0].neighbours<<this_arc[0]
+
+ # tie the spoke to the centre, and
+ this_spoke[-1].neighbours<<@centre
+ @centre.neighbours<<this_spoke[-1]
+
+ # tie the base to the arc
+ base = Position.new(arc, false, true)
+ @positions[arc] = base
+ base.neighbours<<this_arc[0]
+ this_arc[0].neighbours<<base
+
+ # record the ends of the arc for tying to adjacent arcs
+ ifend_of_previous_arc
+ end_of_previous_arc.neighbours<<this_arc[0]
+ this_arc[0].neighbours<<end_of_previous_arc
+ end
+ end_of_previous_arc = this_arc[-1]
+
+ end# arc
+
+ # tie both ends of the rim together
+ a1_corner.neighbours<<end_of_previous_arc
+ end_of_previous_arc.neighbours<<a1_corner
+
+ cache_valid_moves
+
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Board.src/.svn/text-base/M000055.html.svn-base b/doc/classes/Board.src/.svn/text-base/M000055.html.svn-base
new file mode 100644
index 0000000..eb0e755
--- /dev/null
+++ b/doc/classes/Board.src/.svn/text-base/M000055.html.svn-base
@@ -0,0 +1,18 @@
+
+
+
+
+
+ to_s (Board)
+
+
+
+
+
# File lib/libttc.rb, line 175
+ defto_s
+ layout
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Board.src/.svn/text-base/M000056.html.svn-base b/doc/classes/Board.src/.svn/text-base/M000056.html.svn-base
new file mode 100644
index 0000000..a776b7c
--- /dev/null
+++ b/doc/classes/Board.src/.svn/text-base/M000056.html.svn-base
@@ -0,0 +1,18 @@
+
+
+
+
+
+ to_str (Board)
+
+
+
+
+
# File lib/libttc.rb, line 179
+ defto_str
+ to_s
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Board.src/.svn/text-base/M000057.html.svn-base b/doc/classes/Board.src/.svn/text-base/M000057.html.svn-base
new file mode 100644
index 0000000..fc1693e
--- /dev/null
+++ b/doc/classes/Board.src/.svn/text-base/M000057.html.svn-base
@@ -0,0 +1,26 @@
+
+
+
+
+
+ layout (Board)
+
+
+
+
+
# File lib/libttc.rb, line 185
+ deflayout
+ out_string = ""
+ @positions.keys.sort.eachdo|position|
+ out_string<<sprintf("%s touches ", @positions[position])
+ @positions[position].neighbours.eachdo|neighbour|
+ out_string<<sprintf("%s, ", neighbour)
+ end
+ out_string<<sprintf("\n")
+ end
+ out_string
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Board.src/.svn/text-base/M000058.html.svn-base b/doc/classes/Board.src/.svn/text-base/M000058.html.svn-base
new file mode 100644
index 0000000..66ad23c
--- /dev/null
+++ b/doc/classes/Board.src/.svn/text-base/M000058.html.svn-base
@@ -0,0 +1,46 @@
+
+
+
+
+
+ cache_valid_moves (Board)
+
+
+
+
+
# File lib/libttc.rb, line 200
+ defcache_valid_moves
+ # A hash of arrays. The has key is the name of a positions. The array
+ # element [i] stores the positions that are i spaces from here
+ @valid_moves = Hash.new
+ # A hash of hashes. Given two names, return the shortest distance between
+ # the two locations
+ @distance_between = Hash.new
+ @positions.eachdo|place, position|
+ @valid_moves[place] = Array.new
+ @distance_between[place] = Hash.new
+ @valid_moves[place][0] = [@positions[place]]
+ @distance_between[place][place] = 0
+ # Find the shortest routes by Dijkstra's algorithm
+ agenda = [position]
+ closed_list = [position]
+ i = 1
+ whilenotagenda.empty?
+ @valid_moves[place][i] = []
+ new_agenda = []
+ agenda.eachdo|pos|
+ valid_extensions = pos.neighbours.reject {|new_position|closed_list.include?(new_position) }
+ @valid_moves[place][i] +=valid_extensions
+ valid_extensions.each {|ext|@distance_between[place][ext.place] ||=i }
+ closed_list+=valid_extensions
+ new_agenda+=valid_extensions
+ end
+ agenda = new_agenda
+ i+=1
+ end
+ end
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Board.src/M000024.html b/doc/classes/Board.src/M000024.html
new file mode 100644
index 0000000..a37f686
--- /dev/null
+++ b/doc/classes/Board.src/M000024.html
@@ -0,0 +1,95 @@
+
+
+
+
+
+ new (Board)
+
+
+
+
+
# File lib/libttc.rb, line 90
+ definitialize(spokes, spoke_length, arc_length)
+ # A hash of all positions, indexed by position names
+ @positions = Hash.new
+ @centre = Position.new('ac'+spoke_length.to_s, false, false)
+ @positions['ac'+spoke_length.to_s] = centre
+ a1_corner = nil
+ end_of_previous_arc = nil
+
+ # Do each arc-spoke-base set
+ (?a...(?a+spokes)).eachdo|arc_code|
+ arc = arc_code.chr
+ base = Position.new(arc, false, true)
+ this_arc = Array.new
+
+ # build the arc
+ (1..arc_length).eachdo|arc_position|
+ position_name = arc+arc_position.to_s
+ arc_place = Position.new(position_name, arc_position==4, false)
+ arc_place.neighbours = []
+ @positions[position_name] = arc_place
+ this_arc<<arc_place
+ a1_corner = a1_corner||arc_place
+ end
+ (0...arc_length).eachdo|arc_position|
+ ifarc_position>0
+ this_arc[arc_position].neighbours<<this_arc[arc_position-1]
+ end
+ ifarc_position< (arc_length-1)
+ this_arc[arc_position].neighbours<<this_arc[arc_position+1]
+ end
+ end
+
+ # build the spoke
+ this_spoke = Array.new
+ (1..(spoke_length-1)).eachdo|spoke_position|
+ position_name = arc+"c"+spoke_position.to_s
+ spoke_place = Position.new(position_name, spoke_position==3, false)
+ spoke_place.neighbours = []
+ @positions[position_name] = spoke_place
+ this_spoke<<spoke_place
+ end
+ (0...(spoke_length-1)).eachdo|spoke_position|
+ ifspoke_position>0
+ this_spoke[spoke_position].neighbours<<this_spoke[spoke_position-1]
+ end
+ ifspoke_position<spoke_length-2
+ this_spoke[spoke_position].neighbours<<this_spoke[spoke_position+1]
+ end
+ end
+
+ # tie the spoke and arc together,
+ this_arc[0].neighbours<<this_spoke[0]
+ this_spoke[0].neighbours<<this_arc[0]
+
+ # tie the spoke to the centre, and
+ this_spoke[-1].neighbours<<@centre
+ @centre.neighbours<<this_spoke[-1]
+
+ # tie the base to the arc
+ base = Position.new(arc, false, true)
+ @positions[arc] = base
+ base.neighbours<<this_arc[0]
+ this_arc[0].neighbours<<base
+
+ # record the ends of the arc for tying to adjacent arcs
+ ifend_of_previous_arc
+ end_of_previous_arc.neighbours<<this_arc[0]
+ this_arc[0].neighbours<<end_of_previous_arc
+ end
+ end_of_previous_arc = this_arc[-1]
+
+ end# arc
+
+ # tie both ends of the rim together
+ a1_corner.neighbours<<end_of_previous_arc
+ end_of_previous_arc.neighbours<<a1_corner
+
+ cache_valid_moves
+
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Board.src/M000025.html b/doc/classes/Board.src/M000025.html
new file mode 100644
index 0000000..4db9d1c
--- /dev/null
+++ b/doc/classes/Board.src/M000025.html
@@ -0,0 +1,18 @@
+
+
+
+
+
+ to_s (Board)
+
+
+
+
+
# File lib/libttc.rb, line 171
+ defto_s
+ layout
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Board.src/M000026.html b/doc/classes/Board.src/M000026.html
new file mode 100644
index 0000000..14896fe
--- /dev/null
+++ b/doc/classes/Board.src/M000026.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+ layout (Board)
+
+
+
+
+
# File lib/libttc.rb, line 176
+ deflayout
+ out_string = ""
+ @positions.keys.sort.eachdo|position|
+ out_string<<sprintf("%s touches ", @positions[position])
+ @positions[position].neighbours.eachdo|neighbour|
+ out_string<<sprintf("%s, ", neighbour)
+ end
+ out_string<<sprintf("\n")
+ end
+ out_string
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Board.src/M000027.html b/doc/classes/Board.src/M000027.html
new file mode 100644
index 0000000..b6a5ed9
--- /dev/null
+++ b/doc/classes/Board.src/M000027.html
@@ -0,0 +1,46 @@
+
+
+
+
+
+ cache_valid_moves (Board)
+
+
+
+
+
# File lib/libttc.rb, line 191
+ defcache_valid_moves
+ # A hash of arrays. The has key is the name of a positions. The array
+ # element [i] stores the positions that are i spaces from here
+ @valid_moves = Hash.new
+ # A hash of hashes. Given two names, return the shortest distance between
+ # the two locations
+ @distance_between = Hash.new
+ @positions.eachdo|place, position|
+ @valid_moves[place] = Array.new
+ @distance_between[place] = Hash.new
+ @valid_moves[place][0] = [place]
+ @distance_between[place][place] = 0
+ # Find the shortest routes by Dijkstra's algorithm
+ agenda = [position]
+ closed_list = [position]
+ i = 1
+ whilenotagenda.empty?
+ @valid_moves[place][i] = []
+ new_agenda = []
+ agenda.eachdo|pos|
+ valid_extensions = pos.neighbours.reject {|new_position|closed_list.include?(new_position) }
+ @valid_moves[place][i] +=valid_extensions
+ valid_extensions.each {|ext|@distance_between[place][ext.place] ||=i }
+ closed_list+=valid_extensions
+ new_agenda+=valid_extensions
+ end
+ agenda = new_agenda
+ i+=1
+ end
+ end
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Board.src/M000034.html b/doc/classes/Board.src/M000034.html
new file mode 100644
index 0000000..5294404
--- /dev/null
+++ b/doc/classes/Board.src/M000034.html
@@ -0,0 +1,95 @@
+
+
+
+
+
+ new (Board)
+
+
+
+
+
# File lib/libttc.rb, line 82
+ definitialize(spokes, spoke_length, arc_length)
+ # A hash of all positions, indexed by position names
+ @positions = Hash.new
+ @centre = Position.new('ac'+spoke_length.to_s, false, false)
+ @positions['ac'+spoke_length.to_s] = centre
+ a1_corner = nil
+ end_of_previous_arc = nil
+
+ # Do each arc-spoke-base set
+ (?a...(?a+spokes)).eachdo|arc_code|
+ arc = arc_code.chr
+ base = Position.new(arc, false, true)
+ this_arc = Array.new
+
+ # build the arc
+ (1..arc_length).eachdo|arc_position|
+ position_name = arc+arc_position.to_s
+ arc_place = Position.new(position_name, arc_position==4, false)
+ arc_place.neighbours = []
+ @positions[position_name] = arc_place
+ this_arc<<arc_place
+ a1_corner = a1_corner||arc_place
+ end
+ (0...arc_length).eachdo|arc_position|
+ ifarc_position>0
+ this_arc[arc_position].neighbours<<this_arc[arc_position-1]
+ end
+ ifarc_position< (arc_length-1)
+ this_arc[arc_position].neighbours<<this_arc[arc_position+1]
+ end
+ end
+
+ # build the spoke
+ this_spoke = Array.new
+ (1..(spoke_length-1)).eachdo|spoke_position|
+ position_name = arc+"c"+spoke_position.to_s
+ spoke_place = Position.new(position_name, spoke_position==3, false)
+ spoke_place.neighbours = []
+ @positions[position_name] = spoke_place
+ this_spoke<<spoke_place
+ end
+ (0...(spoke_length-1)).eachdo|spoke_position|
+ ifspoke_position>0
+ this_spoke[spoke_position].neighbours<<this_spoke[spoke_position-1]
+ end
+ ifspoke_position<spoke_length-2
+ this_spoke[spoke_position].neighbours<<this_spoke[spoke_position+1]
+ end
+ end
+
+ # tie the spoke and arc together,
+ this_arc[0].neighbours<<this_spoke[0]
+ this_spoke[0].neighbours<<this_arc[0]
+
+ # tie the spoke to the centre, and
+ this_spoke[-1].neighbours<<@centre
+ @centre.neighbours<<this_spoke[-1]
+
+ # tie the base to the arc
+ base = Position.new(arc, false, true)
+ @positions[arc] = base
+ base.neighbours<<this_arc[0]
+ this_arc[0].neighbours<<base
+
+ # record the ends of the arc for tying to adjacent arcs
+ ifend_of_previous_arc
+ end_of_previous_arc.neighbours<<this_arc[0]
+ this_arc[0].neighbours<<end_of_previous_arc
+ end
+ end_of_previous_arc = this_arc[-1]
+
+ end# arc
+
+ # tie both ends of the rim together
+ a1_corner.neighbours<<end_of_previous_arc
+ end_of_previous_arc.neighbours<<a1_corner
+
+ cache_valid_moves
+
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Board.src/M000035.html b/doc/classes/Board.src/M000035.html
new file mode 100644
index 0000000..ed822f1
--- /dev/null
+++ b/doc/classes/Board.src/M000035.html
@@ -0,0 +1,18 @@
+
+
+
+
+
+ to_s (Board)
+
+
+
+
+
# File lib/libttc.rb, line 163
+ defto_s
+ layout
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Board.src/M000036.html b/doc/classes/Board.src/M000036.html
new file mode 100644
index 0000000..3aa04d2
--- /dev/null
+++ b/doc/classes/Board.src/M000036.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+ layout (Board)
+
+
+
+
+
# File lib/libttc.rb, line 168
+ deflayout
+ out_string = ""
+ @positions.keys.sort.eachdo|position|
+ out_string<<sprintf("%s touches ", @positions[position])
+ @positions[position].neighbours.eachdo|neighbour|
+ out_string<<sprintf("%s, ", neighbour)
+ end
+ out_string<<sprintf("\n")
+ end
+ out_string
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Board.src/M000037.html b/doc/classes/Board.src/M000037.html
new file mode 100644
index 0000000..4847c58
--- /dev/null
+++ b/doc/classes/Board.src/M000037.html
@@ -0,0 +1,45 @@
+
+
+
+
+
+ cache_valid_moves (Board)
+
+
+
+
+
# File lib/libttc.rb, line 182
+ defcache_valid_moves
+ # A hash of arrays. The has key is the name of a positions. The array element [i] stores the
+ # positions that are i spaces from here
+ @valid_moves = Hash.new
+ # A hash of hashes. Given two names, return the shortest distance between the two locations
+ @distance_between = Hash.new
+ @positions.eachdo|place, position|
+ @valid_moves[place] = Array.new
+ @distance_between[place] = Hash.new
+ @valid_moves[place][0] = [place]
+ @distance_between[place][place] = 0
+ # Find the shortest routes by Dijkstra's algorithm
+ agenda = [position]
+ closed_list = [position]
+ i = 1
+ whilenotagenda.empty?
+ @valid_moves[place][i] = []
+ new_agenda = []
+ agenda.eachdo|pos|
+ valid_extensions = pos.neighbours.reject {|new_position|closed_list.include?(new_position) }
+ @valid_moves[place][i] +=valid_extensions
+ valid_extensions.each {|ext|@distance_between[place][ext.place] ||=i }
+ closed_list+=valid_extensions
+ new_agenda+=valid_extensions
+ end
+ agenda = new_agenda
+ i+=1
+ end
+ end
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Board.src/M000054.html b/doc/classes/Board.src/M000054.html
new file mode 100644
index 0000000..36d997b
--- /dev/null
+++ b/doc/classes/Board.src/M000054.html
@@ -0,0 +1,95 @@
+
+
+
+
+
+ new (Board)
+
+
+
+
+
# File lib/libttc.rb, line 94
+ definitialize(spokes, spoke_length, arc_length)
+ # A hash of all positions, indexed by position names
+ @positions = Hash.new
+ @centre = Position.new('ac'+spoke_length.to_s, false, false)
+ @positions['ac'+spoke_length.to_s] = centre
+ a1_corner = nil
+ end_of_previous_arc = nil
+
+ # Do each arc-spoke-base set
+ (?a...(?a+spokes)).eachdo|arc_code|
+ arc = arc_code.chr
+ base = Position.new(arc, false, true)
+ this_arc = Array.new
+
+ # build the arc
+ (1..arc_length).eachdo|arc_position|
+ position_name = arc+arc_position.to_s
+ arc_place = Position.new(position_name, arc_position==4, false)
+ arc_place.neighbours = []
+ @positions[position_name] = arc_place
+ this_arc<<arc_place
+ a1_corner = a1_corner||arc_place
+ end
+ (0...arc_length).eachdo|arc_position|
+ ifarc_position>0
+ this_arc[arc_position].neighbours<<this_arc[arc_position-1]
+ end
+ ifarc_position< (arc_length-1)
+ this_arc[arc_position].neighbours<<this_arc[arc_position+1]
+ end
+ end
+
+ # build the spoke
+ this_spoke = Array.new
+ (1..(spoke_length-1)).eachdo|spoke_position|
+ position_name = arc+"c"+spoke_position.to_s
+ spoke_place = Position.new(position_name, spoke_position==3, false)
+ spoke_place.neighbours = []
+ @positions[position_name] = spoke_place
+ this_spoke<<spoke_place
+ end
+ (0...(spoke_length-1)).eachdo|spoke_position|
+ ifspoke_position>0
+ this_spoke[spoke_position].neighbours<<this_spoke[spoke_position-1]
+ end
+ ifspoke_position<spoke_length-2
+ this_spoke[spoke_position].neighbours<<this_spoke[spoke_position+1]
+ end
+ end
+
+ # tie the spoke and arc together,
+ this_arc[0].neighbours<<this_spoke[0]
+ this_spoke[0].neighbours<<this_arc[0]
+
+ # tie the spoke to the centre, and
+ this_spoke[-1].neighbours<<@centre
+ @centre.neighbours<<this_spoke[-1]
+
+ # tie the base to the arc
+ base = Position.new(arc, false, true)
+ @positions[arc] = base
+ base.neighbours<<this_arc[0]
+ this_arc[0].neighbours<<base
+
+ # record the ends of the arc for tying to adjacent arcs
+ ifend_of_previous_arc
+ end_of_previous_arc.neighbours<<this_arc[0]
+ this_arc[0].neighbours<<end_of_previous_arc
+ end
+ end_of_previous_arc = this_arc[-1]
+
+ end# arc
+
+ # tie both ends of the rim together
+ a1_corner.neighbours<<end_of_previous_arc
+ end_of_previous_arc.neighbours<<a1_corner
+
+ cache_valid_moves
+
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Board.src/M000055.html b/doc/classes/Board.src/M000055.html
new file mode 100644
index 0000000..eb0e755
--- /dev/null
+++ b/doc/classes/Board.src/M000055.html
@@ -0,0 +1,18 @@
+
+
+
+
+
+ to_s (Board)
+
+
+
+
+
# File lib/libttc.rb, line 175
+ defto_s
+ layout
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Board.src/M000056.html b/doc/classes/Board.src/M000056.html
new file mode 100644
index 0000000..a776b7c
--- /dev/null
+++ b/doc/classes/Board.src/M000056.html
@@ -0,0 +1,18 @@
+
+
+
+
+
+ to_str (Board)
+
+
+
+
+
# File lib/libttc.rb, line 179
+ defto_str
+ to_s
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Board.src/M000057.html b/doc/classes/Board.src/M000057.html
new file mode 100644
index 0000000..fc1693e
--- /dev/null
+++ b/doc/classes/Board.src/M000057.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+ layout (Board)
+
+
+
+
+
# File lib/libttc.rb, line 185
+ deflayout
+ out_string = ""
+ @positions.keys.sort.eachdo|position|
+ out_string<<sprintf("%s touches ", @positions[position])
+ @positions[position].neighbours.eachdo|neighbour|
+ out_string<<sprintf("%s, ", neighbour)
+ end
+ out_string<<sprintf("\n")
+ end
+ out_string
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Board.src/M000058.html b/doc/classes/Board.src/M000058.html
new file mode 100644
index 0000000..66ad23c
--- /dev/null
+++ b/doc/classes/Board.src/M000058.html
@@ -0,0 +1,46 @@
+
+
+
+
+
+ cache_valid_moves (Board)
+
+
+
+
+
# File lib/libttc.rb, line 200
+ defcache_valid_moves
+ # A hash of arrays. The has key is the name of a positions. The array
+ # element [i] stores the positions that are i spaces from here
+ @valid_moves = Hash.new
+ # A hash of hashes. Given two names, return the shortest distance between
+ # the two locations
+ @distance_between = Hash.new
+ @positions.eachdo|place, position|
+ @valid_moves[place] = Array.new
+ @distance_between[place] = Hash.new
+ @valid_moves[place][0] = [@positions[place]]
+ @distance_between[place][place] = 0
+ # Find the shortest routes by Dijkstra's algorithm
+ agenda = [position]
+ closed_list = [position]
+ i = 1
+ whilenotagenda.empty?
+ @valid_moves[place][i] = []
+ new_agenda = []
+ agenda.eachdo|pos|
+ valid_extensions = pos.neighbours.reject {|new_position|closed_list.include?(new_position) }
+ @valid_moves[place][i] +=valid_extensions
+ valid_extensions.each {|ext|@distance_between[place][ext.place] ||=i }
+ closed_list+=valid_extensions
+ new_agenda+=valid_extensions
+ end
+ agenda = new_agenda
+ i+=1
+ end
+ end
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Fixnum.html b/doc/classes/Fixnum.html
new file mode 100644
index 0000000..ba0b706
--- /dev/null
+++ b/doc/classes/Fixnum.html
@@ -0,0 +1,137 @@
+
+
+
+
+
+ Class: Fixnum
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/.svn/text-base/M000012.html.svn-base b/doc/classes/Game.src/.svn/text-base/M000012.html.svn-base
new file mode 100644
index 0000000..a799d4f
--- /dev/null
+++ b/doc/classes/Game.src/.svn/text-base/M000012.html.svn-base
@@ -0,0 +1,78 @@
+
+
+
+
+
+ apply_move (Game)
+
+
+
+
+
# File lib/libttc.rb, line 353
+ defapply_move(move, player = @current_player)
+ # Check the move is a valid one
+ raise(InvalidMoveError, "Piece #{move.piece} does not exist") unless@pieces.has_key?(move.piece.name)
+ raise(InvalidMoveError, "Player #{player} moving piece #{move.piece}") unlessmove.piece.colour==player
+ raise(InvalidMoveError, "Attempting to move captured piece #{move.piece}") ifmove.piece.captured
+ raise(InvalidMoveError, "Attempting to move #{move.piece} onto or via base without captured pieces") ifmove.via_base?andmove.piece.contains.empty?
+ ifmove.destination.safe?
+ if (@pieces.find_all {|k, p|p.position==move.destination}).length>=3
+ raise(InvalidMoveError, "Attempting to move #{move.piece} onto safe position #{move.destination} when there are already three or more pieces there")
+ end
+ end
+ ifmove.via_base?
+ moved_distance = board.distance_between[move.piece.position.place][player] +
+ board.distance_between[player][move.destination.place]
+ else
+ moved_distance = board.distance_between[move.piece.position.place][move.destination.place]
+ end
+ raise(InvalidMoveError, "Attempting to move piece #{move.piece} #{moved_distance} places") ifmoved_distance<1ormoved_distance>6
+
+ # Apply this move
+ move.piece.move_to(move.destination)
+
+ # Capture anything already there (unless it's a safe place or a base,
+ # or our own colour)
+ unlessmove.destination.safe?ormove.destination.base?
+ @pieces.eachdo|name, target_piece|
+ iftarget_piece.position==move.destinationand
+ target_piece!=move.pieceand
+ notmove.piece.contains.member?(target_piece) and
+ target_piece.colour!=player
+ move.piece.capture(target_piece)
+ end
+ end
+ end
+
+ # If the move was via our base, drop all captured pieces
+ ifmove.via_base?
+ capturers_base = board.positions[move.piece.colour]
+ move.piece.contains.eachdo|captured_piece|
+ captured_piece.move_tocapturers_base
+ captured_piece.captured = falseifcaptured_piece.colour==move.piece.colour
+ end
+ move.piece.contains = []
+ end
+
+ # Record the new stae
+ this_game_state = GameState.new(move, player, @pieces)
+ @history<<this_game_state
+
+ # Retain only players that have uncaptured pieces.
+ # If there's only one player with uncaptured pieces, declare a win.
+ potential_players = []
+ @players.eachdo|p|
+ if (@pieces.values.select {|piece|piece.colour==p}).any? {|piece|notpiece.captured}
+ potential_players<<p
+ end
+# potential_players << p if (@pieces.values.select {|p| p.colour == @current_player}).any? {|p| not p.captured}
+ end
+ ifpotential_players.length<=1
+ raise(GameWonNotice, "Game won by #{potential_players[0]}")
+ end
+ @players = potential_players.sort
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/.svn/text-base/M000013.html.svn-base b/doc/classes/Game.src/.svn/text-base/M000013.html.svn-base
new file mode 100644
index 0000000..76e5be0
--- /dev/null
+++ b/doc/classes/Game.src/.svn/text-base/M000013.html.svn-base
@@ -0,0 +1,27 @@
+
+
+
+
+
+ apply_moves (Game)
+
+
+
+
+
# File lib/libttc.rb, line 419
+ defapply_moves(moves)
+ moves.eachdo|move|
+ ifmove.via_base?
+ moved_distance = board.distance_between[move.piece.position.place][@current_player] +
+ board.distance_between[@current_player][move.destination.place]
+ else
+ moved_distance = board.distance_between[move.piece.position.place][move.destination.place]
+ end
+ self.apply_move(move, @current_player)
+ next_playerunlessmoved_distance==6
+ end
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/.svn/text-base/M000014.html.svn-base b/doc/classes/Game.src/.svn/text-base/M000014.html.svn-base
new file mode 100644
index 0000000..16ec0bd
--- /dev/null
+++ b/doc/classes/Game.src/.svn/text-base/M000014.html.svn-base
@@ -0,0 +1,26 @@
+
+
+
+
+
+ next_player (Game)
+
+
+
+
+
# File lib/libttc.rb, line 434
+ defnext_player
+ original_player = @current_player
+ begin
+ if@current_player==@players[-1]
+ @current_player = @players[0]
+ else
+ @current_player = @players[@players.index(@current_player) +1]
+ end
+ endwhile (@pieces.values.select {|p|p.colour==@current_player}).all? {|p|p.captured} and@current_player!=original_player
+ @current_player
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/.svn/text-base/M000015.html.svn-base b/doc/classes/Game.src/.svn/text-base/M000015.html.svn-base
new file mode 100644
index 0000000..8b36978
--- /dev/null
+++ b/doc/classes/Game.src/.svn/text-base/M000015.html.svn-base
@@ -0,0 +1,48 @@
+
+
+
+
+
+ possible_moves (Game)
+
+
+
+
+
# File lib/libttc.rb, line 448
+ defpossible_moves(die_result, player = @current_player)
+ moves = []
+ @pieces.eachdo|key, piece|
+ # only move current player's pieces, and only if they're not captured
+ ifpiece.colour==playerand (notpiece.captured)
+ (@board.valid_moves[piece.position.place][die_result]).eachdo|destination|
+ ifdestination.safe?
+ if (@pieces.find_all {|k, p|p.position==destination}).length<3
+ moves<<Move.new(piece, destination, false)
+ end
+ else
+ moves<<Move.new(piece, destination, false) unlessdestination.base?
+ end
+ end
+ # if we can move to our base (but not already on it), add moves via that...
+ if@board.distance_between[piece.position.place][player] <=die_resultand
+ notpiece.position.place==playerand
+ notpiece.contains.empty?
+ distance_after_base = die_result-board.distance_between[piece.position.place][player]
+ (@board.valid_moves[player][distance_after_base]).eachdo|destination|
+ ifdestination.safe?
+ if (@pieces.find_all {|k, p|p.position==destination}).length<3
+ moves<<Move.new(piece, destination, true)
+ end
+ else
+ moves<<Move.new(piece, destination, true)
+ end
+ end
+ end
+ end
+ end
+ moves
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/.svn/text-base/M000016.html.svn-base b/doc/classes/Game.src/.svn/text-base/M000016.html.svn-base
new file mode 100644
index 0000000..1231a36
--- /dev/null
+++ b/doc/classes/Game.src/.svn/text-base/M000016.html.svn-base
@@ -0,0 +1,24 @@
+
+
+
+
+
+ show_state (Game)
+
+
+
+
+
# File lib/libttc.rb, line 484
+ defshow_state
+ @pieces.keys.sort.eachdo|piece_name|
+ if@pieces[piece_name].captured
+ puts"Piece #{piece_name} captured, at #{@pieces[piece_name].position}"
+ else
+ puts"Piece #{piece_name} is at #{@pieces[piece_name].position}, holds #{(@pieces[piece_name].contains.collect{|c| c.name}).join(' ')}"
+ end
+ end
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/.svn/text-base/M000017.html.svn-base b/doc/classes/Game.src/.svn/text-base/M000017.html.svn-base
new file mode 100644
index 0000000..b1e7320
--- /dev/null
+++ b/doc/classes/Game.src/.svn/text-base/M000017.html.svn-base
@@ -0,0 +1,22 @@
+
+
+
+
+
+ read_game (Game)
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/.svn/text-base/M000022.html.svn-base b/doc/classes/Game.src/.svn/text-base/M000022.html.svn-base
new file mode 100644
index 0000000..d336636
--- /dev/null
+++ b/doc/classes/Game.src/.svn/text-base/M000022.html.svn-base
@@ -0,0 +1,72 @@
+
+
+
+
+
+ apply_move (Game)
+
+
+
+
+
# File lib/libttc.rb, line 341
+ defapply_move(move, player = @current_player)
+ # Check the move is a valid one
+ raise(InvalidMoveError, "Piece #{move.piece} does not exist") unless@pieces.has_key?(move.piece.name)
+ raise(InvalidMoveError, "Player #{player} moving piece #{move.piece}") unlessmove.piece.colour==player
+ raise(InvalidMoveError, "Attempting to move captured piece #{move.piece}") ifmove.piece.captured
+ raise(InvalidMoveError, "Attempting to move #{move.piece} onto or via base without captured pieces") ifmove.via_base?andmove.piece.contains.empty?
+ ifmove.destination.safe?
+ if (@pieces.find_all {|k, p|p.position==move.destination}).length>=3
+ raise(InvalidMoveError, "Attempting to move #{move.piece} onto safe position #{move.destination} when there are already three or more pieces there")
+ end
+ end
+ ifmove.via_base?
+ moved_distance = board.distance_between[move.piece.position.place][player] +
+ board.distance_between[player][move.destination.place]
+ else
+ moved_distance = board.distance_between[move.piece.position.place][move.destination.place]
+ end
+ raise(InvalidMoveError, "Attempting to move piece #{move.piece} #{moved_distance} places") ifmoved_distance<1ormoved_distance>6
+
+ # Apply this move
+ move.piece.move_to(move.destination)
+
+ # Capture anything already there (unless it's a safe place or a base, or our own colour)
+ unlessmove.destination.safe?ormove.destination.base?
+ @pieces.eachdo|name, target_piece|
+ iftarget_piece.position==move.destinationand
+ target_piece!=move.pieceand
+ notmove.piece.contains.member?(target_piece) and
+ target_piece.colour!=player
+ move.piece.capture(target_piece)
+ end
+ end
+ end
+
+ # If the move was via our base, drop all captured pieces
+ ifmove.via_base?
+ capturers_base = board.positions[move.piece.colour]
+ move.piece.contains.eachdo|captured_piece|
+ captured_piece.move_tocapturers_base
+ captured_piece.captured = falseifcaptured_piece.colour==move.piece.colour
+ end
+ move.piece.contains = []
+ end
+
+ # Record the new stae
+ this_game_state = GameState.new(move, player, @pieces)
+ @history<<this_game_state
+
+ # If there's only one player with uncaptured pieces, declare a win
+ potential_players = []
+ @players.eachdo|p|
+ potential_players<<pif (@pieces.values.select {|p|p.colour==@current_player}).any? {|p|notp.captured}
+ end
+ ifpotential_players.length<=1
+ raise(GameWonNotice, "Game won by #{potential_players[0]}")
+ end
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/.svn/text-base/M000023.html.svn-base b/doc/classes/Game.src/.svn/text-base/M000023.html.svn-base
new file mode 100644
index 0000000..4ab28cf
--- /dev/null
+++ b/doc/classes/Game.src/.svn/text-base/M000023.html.svn-base
@@ -0,0 +1,27 @@
+
+
+
+
+
+ apply_moves (Game)
+
+
+
+
+
# File lib/libttc.rb, line 401
+ defapply_moves(moves)
+ moves.eachdo|move|
+ ifmove.via_base?
+ moved_distance = board.distance_between[move.piece.position.place][@current_player] +
+ board.distance_between[@current_player][move.destination.place]
+ else
+ moved_distance = board.distance_between[move.piece.position.place][move.destination.place]
+ end
+ self.apply_move(move, @current_player)
+ next_playerunlessmoved_distance==6
+ end
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/.svn/text-base/M000024.html.svn-base b/doc/classes/Game.src/.svn/text-base/M000024.html.svn-base
new file mode 100644
index 0000000..c3acbeb
--- /dev/null
+++ b/doc/classes/Game.src/.svn/text-base/M000024.html.svn-base
@@ -0,0 +1,26 @@
+
+
+
+
+
+ next_player (Game)
+
+
+
+
+
# File lib/libttc.rb, line 416
+ defnext_player
+ original_player = @current_player
+ begin
+ if@current_player==@players[-1]
+ @current_player = @players[0]
+ else
+ @current_player = @players[@players.index(@current_player) +1]
+ end
+ endwhile (@pieces.values.select {|p|p.colour==@current_player}).all? {|p|p.captured} and@current_player!=original_player
+ @current_player
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/.svn/text-base/M000025.html.svn-base b/doc/classes/Game.src/.svn/text-base/M000025.html.svn-base
new file mode 100644
index 0000000..9d031de
--- /dev/null
+++ b/doc/classes/Game.src/.svn/text-base/M000025.html.svn-base
@@ -0,0 +1,48 @@
+
+
+
+
+
+ possible_moves (Game)
+
+
+
+
+
# File lib/libttc.rb, line 430
+ defpossible_moves(die_result, player = @current_player)
+ moves = []
+ @pieces.eachdo|key, piece|
+ # only move current player's pieces, and only if they're not captured
+ ifpiece.colour==playerand (notpiece.captured)
+ (@board.valid_moves[piece.position.place][die_result]).eachdo|destination|
+ ifdestination.safe?
+ if (@pieces.find_all {|k, p|p.position==destination}).length<3
+ moves<<Move.new(piece, destination, false)
+ end
+ else
+ moves<<Move.new(piece, destination, false) unlessdestination.base?
+ end
+ end
+ # if we can move to our base (but not already on it), add moves via that...
+ if@board.distance_between[piece.position.place][player] <=die_resultand
+ notpiece.position.place==playerand
+ notpiece.contains.empty?
+ distance_after_base = die_result-board.distance_between[piece.position.place][player]
+ (@board.valid_moves[player][distance_after_base]).eachdo|destination|
+ ifdestination.safe?
+ if (@pieces.find_all {|k, p|p.position==destination}).length<3
+ moves<<Move.new(piece, destination, true)
+ end
+ else
+ moves<<Move.new(piece, destination, true)
+ end
+ end
+ end
+ end
+ end
+ moves
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/.svn/text-base/M000026.html.svn-base b/doc/classes/Game.src/.svn/text-base/M000026.html.svn-base
new file mode 100644
index 0000000..e2d04c4
--- /dev/null
+++ b/doc/classes/Game.src/.svn/text-base/M000026.html.svn-base
@@ -0,0 +1,24 @@
+
+
+
+
+
+ show_state (Game)
+
+
+
+
+
# File lib/libttc.rb, line 466
+ defshow_state
+ @pieces.keys.sort.eachdo|piece_name|
+ if@pieces[piece_name].captured
+ puts"Piece #{piece_name} captured, at #{@pieces[piece_name].position}"
+ else
+ puts"Piece #{piece_name} is at #{@pieces[piece_name].position}, holds #{(@pieces[piece_name].contains.collect{|c| c.name}).join(' ')}"
+ end
+ end
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/.svn/text-base/M000027.html.svn-base b/doc/classes/Game.src/.svn/text-base/M000027.html.svn-base
new file mode 100644
index 0000000..fc46f3a
--- /dev/null
+++ b/doc/classes/Game.src/.svn/text-base/M000027.html.svn-base
@@ -0,0 +1,22 @@
+
+
+
+
+
+ read_game (Game)
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/.svn/text-base/M000037.html.svn-base b/doc/classes/Game.src/.svn/text-base/M000037.html.svn-base
new file mode 100644
index 0000000..7f2ca42
--- /dev/null
+++ b/doc/classes/Game.src/.svn/text-base/M000037.html.svn-base
@@ -0,0 +1,79 @@
+
+
+
+
+
+ apply_move! (Game)
+
+
+
+
+
# File lib/libttc.rb, line 379
+ defapply_move!(move, player = @current_player)
+ # Check the move is a valid one
+ raise(InvalidMoveError, "Piece #{move.piece} does not exist") unless@pieces.has_key?(move.piece.name)
+ raise(InvalidMoveError, "Player #{player} moving piece #{move.piece}") unlessmove.piece.colour==player
+ raise(InvalidMoveError, "Attempting to move captured piece #{move.piece}") ifmove.piece.captured
+ raise(InvalidMoveError, "Attempting to move #{move.piece} onto or via base without captured pieces") ifmove.via_base?andmove.piece.contains.empty?
+ ifmove.destination.safe?
+ if (@pieces.find_all {|k, p|p.position==move.destination}).length>=3
+ raise(InvalidMoveError, "Attempting to move #{move.piece} onto safe position #{move.destination} when there are already three or more pieces there")
+ end
+ end
+ ifmove.via_base?
+ moved_distance = board.distance_between[move.piece.position.place][player] +
+ board.distance_between[player][move.destination.place]
+ else
+ moved_distance = board.distance_between[move.piece.position.place][move.destination.place]
+ end
+ raise(InvalidMoveError, "Attempting to move piece #{move.piece} #{moved_distance} places (from #{move.piece.position} to #{move.destination})") ifmoved_distance<1ormoved_distance>6
+
+ # Apply this move
+ move.piece.move_to(move.destination)
+
+ # Capture anything already there (unless it's a safe place or a base,
+ # or our own colour, or already captured)
+ unlessmove.destination.safe?ormove.destination.base?
+ @pieces.eachdo|name, target_piece|
+ iftarget_piece.position==move.destinationand
+ target_piece!=move.pieceand
+ notmove.piece.contains.member?(target_piece) and
+ target_piece.colour!=playerand
+ nottarget_piece.captured
+ move.piece.capture(target_piece)
+ end
+ end
+ end
+
+ # If the move was via our base, drop all captured pieces
+ ifmove.via_base?
+ capturers_base = board.positions[move.piece.colour]
+ move.piece.contains.eachdo|captured_piece|
+ captured_piece.move_tocapturers_base
+ captured_piece.captured = falseifcaptured_piece.colour==move.piece.colour
+ end
+ move.piece.contains = []
+ end
+
+ # Record the new stae
+ this_game_state = GameState.new(move, player, @pieces)
+ @history<<this_game_state
+
+ # Retain only players that have uncaptured pieces.
+ # If there's only one player with uncaptured pieces, declare a win.
+ potential_players = []
+ @players.eachdo|p|
+ if (@pieces.values.select {|piece|piece.colour==p}).any? {|piece|notpiece.captured}
+ potential_players<<p
+ end
+ # potential_players << p if (@pieces.values.select {|p| p.colour == @current_player}).any? {|p| not p.captured}
+ end
+ ifpotential_players.length<=1
+ raise(GameWonNotice, "Game won by #{potential_players[0]}")
+ end
+ @players = potential_players.sort
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/.svn/text-base/M000038.html.svn-base b/doc/classes/Game.src/.svn/text-base/M000038.html.svn-base
new file mode 100644
index 0000000..76e138e
--- /dev/null
+++ b/doc/classes/Game.src/.svn/text-base/M000038.html.svn-base
@@ -0,0 +1,42 @@
+
+
+
+
+
+ undo_move! (Game)
+
+
+
+
+
# File lib/libttc.rb, line 445
+ defundo_move!
+ if@history.length>1
+ # general case
+ state_to_restore = @history[-2]
+ @current_player = @history[-1].player
+ @pieces.eachdo|name, piece|
+ copy_piece = state_to_restore.pieces_after_move[name]
+ piece.position = copy_piece.position
+ piece.captured = copy_piece.captured
+ piece.contains = []
+ copy_piece.contains.eachdo|p|
+# piece.capture(@pieces[p.name])
+ piece.contains<<@pieces[p.name]
+ end
+ end
+ @history.pop
+ elsif@history.length==1
+ # reset to start
+ @current_player = 'a'
+ @pieces.eachdo|name, piece|
+ piece.position = @board.positions[piece.colour]
+ piece.captured = false
+ piece.contains = []
+ end
+ @history.pop
+ end
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/.svn/text-base/M000039.html.svn-base b/doc/classes/Game.src/.svn/text-base/M000039.html.svn-base
new file mode 100644
index 0000000..e6beeb0
--- /dev/null
+++ b/doc/classes/Game.src/.svn/text-base/M000039.html.svn-base
@@ -0,0 +1,27 @@
+
+
+
+
+
+ apply_moves! (Game)
+
+
+
+
+
# File lib/libttc.rb, line 474
+ defapply_moves!(moves)
+ moves.eachdo|move|
+ ifmove.via_base?
+ moved_distance = board.distance_between[move.piece.position.place][@current_player] +
+ board.distance_between[@current_player][move.destination.place]
+ else
+ moved_distance = board.distance_between[move.piece.position.place][move.destination.place]
+ end
+ self.apply_move!(move, @current_player)
+ next_player!unlessmoved_distance==6
+ end
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/.svn/text-base/M000040.html.svn-base b/doc/classes/Game.src/.svn/text-base/M000040.html.svn-base
new file mode 100644
index 0000000..bb9306b
--- /dev/null
+++ b/doc/classes/Game.src/.svn/text-base/M000040.html.svn-base
@@ -0,0 +1,26 @@
+
+
+
+
+
+ next_player! (Game)
+
+
+
+
+
# File lib/libttc.rb, line 489
+ defnext_player!
+ original_player = @current_player
+ begin
+ if@current_player==@players[-1]
+ @current_player = @players[0]
+ else
+ @current_player = @players[@players.index(@current_player) +1]
+ end
+ endwhile (@pieces.values.select {|p|p.colour==@current_player}).all? {|p|p.captured} and@current_player!=original_player
+ @current_player
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/.svn/text-base/M000041.html.svn-base b/doc/classes/Game.src/.svn/text-base/M000041.html.svn-base
new file mode 100644
index 0000000..d8fff61
--- /dev/null
+++ b/doc/classes/Game.src/.svn/text-base/M000041.html.svn-base
@@ -0,0 +1,48 @@
+
+
+
+
+
+ possible_moves (Game)
+
+
+
+
+
# File lib/libttc.rb, line 504
+ defpossible_moves(die_result, player = @current_player)
+ moves = []
+ @pieces.eachdo|key, piece|
+ # only move current player's pieces, and only if they're not captured
+ ifpiece.colour==playerand (notpiece.captured)
+ (@board.valid_moves[piece.position.place][die_result]).eachdo|destination|
+ ifdestination.safe?
+ if (@pieces.find_all {|k, p|p.position==destination}).length<3
+ moves<<Move.new(piece, destination, false)
+ end
+ else
+ moves<<Move.new(piece, destination, false) unlessdestination.base?
+ end
+ end
+ # if we can move to our base (but not already on it), add moves via that...
+ if@board.distance_between[piece.position.place][player] <=die_resultand
+ notpiece.position.place==playerand
+ notpiece.contains.empty?
+ distance_after_base = die_result-@board.distance_between[piece.position.place][player]
+ (@board.valid_moves[player][distance_after_base]).eachdo|destination|
+ ifdestination.safe?
+ if (@pieces.find_all {|k, p|p.position==destination}).length<3
+ moves<<Move.new(piece, destination, true)
+ end
+ else
+ moves<<Move.new(piece, destination, true)
+ end
+ end
+ end
+ end
+ end
+ moves
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/.svn/text-base/M000042.html.svn-base b/doc/classes/Game.src/.svn/text-base/M000042.html.svn-base
new file mode 100644
index 0000000..4ba853e
--- /dev/null
+++ b/doc/classes/Game.src/.svn/text-base/M000042.html.svn-base
@@ -0,0 +1,26 @@
+
+
+
+
+
+ build_state_string (Game)
+
+
+
+
+
# File lib/libttc.rb, line 539
+ defbuild_state_string
+ outstr = "Current player = #{@current_player}\n"
+ @pieces.keys.sort.eachdo|piece_name|
+ if@pieces[piece_name].captured
+ outstr<<"Piece #{piece_name} captured, at #{@pieces[piece_name].position}\n"
+ else
+ outstr<<"Piece #{piece_name} is at #{@pieces[piece_name].position}, holds #{(@pieces[piece_name].contains.collect{|c| c.name}).join(' ')}\n"
+ end
+ end
+ outstr
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/.svn/text-base/M000043.html.svn-base b/doc/classes/Game.src/.svn/text-base/M000043.html.svn-base
new file mode 100644
index 0000000..2b3bc35
--- /dev/null
+++ b/doc/classes/Game.src/.svn/text-base/M000043.html.svn-base
@@ -0,0 +1,25 @@
+
+
+
+
+
+ show_state (Game)
+
+
+
+
+
# File lib/libttc.rb, line 552
+ defshow_state
+ putsbuild_state_string
+# @pieces.keys.sort.each do |piece_name|
+# if @pieces[piece_name].captured
+# puts "Piece #{piece_name} captured, at #{@pieces[piece_name].position}"
+# else
+# puts "Piece #{piece_name} is at #{@pieces[piece_name].position}, holds #{(@pieces[piece_name].contains.collect{|c| c.name}).join(' ')}"
+# end
+# end
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/.svn/text-base/M000044.html.svn-base b/doc/classes/Game.src/.svn/text-base/M000044.html.svn-base
new file mode 100644
index 0000000..55553f4
--- /dev/null
+++ b/doc/classes/Game.src/.svn/text-base/M000044.html.svn-base
@@ -0,0 +1,18 @@
+
+
+
+
+
+ to_s (Game)
+
+
+
+
+
# File lib/libttc.rb, line 563
+ defto_s
+ show_state
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/.svn/text-base/M000045.html.svn-base b/doc/classes/Game.src/.svn/text-base/M000045.html.svn-base
new file mode 100644
index 0000000..4ca247d
--- /dev/null
+++ b/doc/classes/Game.src/.svn/text-base/M000045.html.svn-base
@@ -0,0 +1,18 @@
+
+
+
+
+
+ to_str (Game)
+
+
+
+
+
# File lib/libttc.rb, line 567
+ defto_str
+ to_s
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/.svn/text-base/M000046.html.svn-base b/doc/classes/Game.src/.svn/text-base/M000046.html.svn-base
new file mode 100644
index 0000000..c3e7452
--- /dev/null
+++ b/doc/classes/Game.src/.svn/text-base/M000046.html.svn-base
@@ -0,0 +1,22 @@
+
+
+
+
+
+ read_game (Game)
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/M000012.html b/doc/classes/Game.src/M000012.html
new file mode 100644
index 0000000..a799d4f
--- /dev/null
+++ b/doc/classes/Game.src/M000012.html
@@ -0,0 +1,78 @@
+
+
+
+
+
+ apply_move (Game)
+
+
+
+
+
# File lib/libttc.rb, line 353
+ defapply_move(move, player = @current_player)
+ # Check the move is a valid one
+ raise(InvalidMoveError, "Piece #{move.piece} does not exist") unless@pieces.has_key?(move.piece.name)
+ raise(InvalidMoveError, "Player #{player} moving piece #{move.piece}") unlessmove.piece.colour==player
+ raise(InvalidMoveError, "Attempting to move captured piece #{move.piece}") ifmove.piece.captured
+ raise(InvalidMoveError, "Attempting to move #{move.piece} onto or via base without captured pieces") ifmove.via_base?andmove.piece.contains.empty?
+ ifmove.destination.safe?
+ if (@pieces.find_all {|k, p|p.position==move.destination}).length>=3
+ raise(InvalidMoveError, "Attempting to move #{move.piece} onto safe position #{move.destination} when there are already three or more pieces there")
+ end
+ end
+ ifmove.via_base?
+ moved_distance = board.distance_between[move.piece.position.place][player] +
+ board.distance_between[player][move.destination.place]
+ else
+ moved_distance = board.distance_between[move.piece.position.place][move.destination.place]
+ end
+ raise(InvalidMoveError, "Attempting to move piece #{move.piece} #{moved_distance} places") ifmoved_distance<1ormoved_distance>6
+
+ # Apply this move
+ move.piece.move_to(move.destination)
+
+ # Capture anything already there (unless it's a safe place or a base,
+ # or our own colour)
+ unlessmove.destination.safe?ormove.destination.base?
+ @pieces.eachdo|name, target_piece|
+ iftarget_piece.position==move.destinationand
+ target_piece!=move.pieceand
+ notmove.piece.contains.member?(target_piece) and
+ target_piece.colour!=player
+ move.piece.capture(target_piece)
+ end
+ end
+ end
+
+ # If the move was via our base, drop all captured pieces
+ ifmove.via_base?
+ capturers_base = board.positions[move.piece.colour]
+ move.piece.contains.eachdo|captured_piece|
+ captured_piece.move_tocapturers_base
+ captured_piece.captured = falseifcaptured_piece.colour==move.piece.colour
+ end
+ move.piece.contains = []
+ end
+
+ # Record the new stae
+ this_game_state = GameState.new(move, player, @pieces)
+ @history<<this_game_state
+
+ # Retain only players that have uncaptured pieces.
+ # If there's only one player with uncaptured pieces, declare a win.
+ potential_players = []
+ @players.eachdo|p|
+ if (@pieces.values.select {|piece|piece.colour==p}).any? {|piece|notpiece.captured}
+ potential_players<<p
+ end
+# potential_players << p if (@pieces.values.select {|p| p.colour == @current_player}).any? {|p| not p.captured}
+ end
+ ifpotential_players.length<=1
+ raise(GameWonNotice, "Game won by #{potential_players[0]}")
+ end
+ @players = potential_players.sort
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/M000013.html b/doc/classes/Game.src/M000013.html
new file mode 100644
index 0000000..76e5be0
--- /dev/null
+++ b/doc/classes/Game.src/M000013.html
@@ -0,0 +1,27 @@
+
+
+
+
+
+ apply_moves (Game)
+
+
+
+
+
# File lib/libttc.rb, line 419
+ defapply_moves(moves)
+ moves.eachdo|move|
+ ifmove.via_base?
+ moved_distance = board.distance_between[move.piece.position.place][@current_player] +
+ board.distance_between[@current_player][move.destination.place]
+ else
+ moved_distance = board.distance_between[move.piece.position.place][move.destination.place]
+ end
+ self.apply_move(move, @current_player)
+ next_playerunlessmoved_distance==6
+ end
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/M000014.html b/doc/classes/Game.src/M000014.html
new file mode 100644
index 0000000..16ec0bd
--- /dev/null
+++ b/doc/classes/Game.src/M000014.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+ next_player (Game)
+
+
+
+
+
# File lib/libttc.rb, line 434
+ defnext_player
+ original_player = @current_player
+ begin
+ if@current_player==@players[-1]
+ @current_player = @players[0]
+ else
+ @current_player = @players[@players.index(@current_player) +1]
+ end
+ endwhile (@pieces.values.select {|p|p.colour==@current_player}).all? {|p|p.captured} and@current_player!=original_player
+ @current_player
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/M000015.html b/doc/classes/Game.src/M000015.html
new file mode 100644
index 0000000..8b36978
--- /dev/null
+++ b/doc/classes/Game.src/M000015.html
@@ -0,0 +1,48 @@
+
+
+
+
+
+ possible_moves (Game)
+
+
+
+
+
# File lib/libttc.rb, line 448
+ defpossible_moves(die_result, player = @current_player)
+ moves = []
+ @pieces.eachdo|key, piece|
+ # only move current player's pieces, and only if they're not captured
+ ifpiece.colour==playerand (notpiece.captured)
+ (@board.valid_moves[piece.position.place][die_result]).eachdo|destination|
+ ifdestination.safe?
+ if (@pieces.find_all {|k, p|p.position==destination}).length<3
+ moves<<Move.new(piece, destination, false)
+ end
+ else
+ moves<<Move.new(piece, destination, false) unlessdestination.base?
+ end
+ end
+ # if we can move to our base (but not already on it), add moves via that...
+ if@board.distance_between[piece.position.place][player] <=die_resultand
+ notpiece.position.place==playerand
+ notpiece.contains.empty?
+ distance_after_base = die_result-board.distance_between[piece.position.place][player]
+ (@board.valid_moves[player][distance_after_base]).eachdo|destination|
+ ifdestination.safe?
+ if (@pieces.find_all {|k, p|p.position==destination}).length<3
+ moves<<Move.new(piece, destination, true)
+ end
+ else
+ moves<<Move.new(piece, destination, true)
+ end
+ end
+ end
+ end
+ end
+ moves
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/M000016.html b/doc/classes/Game.src/M000016.html
new file mode 100644
index 0000000..1231a36
--- /dev/null
+++ b/doc/classes/Game.src/M000016.html
@@ -0,0 +1,24 @@
+
+
+
+
+
+ show_state (Game)
+
+
+
+
+
# File lib/libttc.rb, line 484
+ defshow_state
+ @pieces.keys.sort.eachdo|piece_name|
+ if@pieces[piece_name].captured
+ puts"Piece #{piece_name} captured, at #{@pieces[piece_name].position}"
+ else
+ puts"Piece #{piece_name} is at #{@pieces[piece_name].position}, holds #{(@pieces[piece_name].contains.collect{|c| c.name}).join(' ')}"
+ end
+ end
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/M000017.html b/doc/classes/Game.src/M000017.html
new file mode 100644
index 0000000..b1e7320
--- /dev/null
+++ b/doc/classes/Game.src/M000017.html
@@ -0,0 +1,22 @@
+
+
+
+
+
+ read_game (Game)
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/M000022.html b/doc/classes/Game.src/M000022.html
new file mode 100644
index 0000000..d336636
--- /dev/null
+++ b/doc/classes/Game.src/M000022.html
@@ -0,0 +1,72 @@
+
+
+
+
+
+ apply_move (Game)
+
+
+
+
+
# File lib/libttc.rb, line 341
+ defapply_move(move, player = @current_player)
+ # Check the move is a valid one
+ raise(InvalidMoveError, "Piece #{move.piece} does not exist") unless@pieces.has_key?(move.piece.name)
+ raise(InvalidMoveError, "Player #{player} moving piece #{move.piece}") unlessmove.piece.colour==player
+ raise(InvalidMoveError, "Attempting to move captured piece #{move.piece}") ifmove.piece.captured
+ raise(InvalidMoveError, "Attempting to move #{move.piece} onto or via base without captured pieces") ifmove.via_base?andmove.piece.contains.empty?
+ ifmove.destination.safe?
+ if (@pieces.find_all {|k, p|p.position==move.destination}).length>=3
+ raise(InvalidMoveError, "Attempting to move #{move.piece} onto safe position #{move.destination} when there are already three or more pieces there")
+ end
+ end
+ ifmove.via_base?
+ moved_distance = board.distance_between[move.piece.position.place][player] +
+ board.distance_between[player][move.destination.place]
+ else
+ moved_distance = board.distance_between[move.piece.position.place][move.destination.place]
+ end
+ raise(InvalidMoveError, "Attempting to move piece #{move.piece} #{moved_distance} places") ifmoved_distance<1ormoved_distance>6
+
+ # Apply this move
+ move.piece.move_to(move.destination)
+
+ # Capture anything already there (unless it's a safe place or a base, or our own colour)
+ unlessmove.destination.safe?ormove.destination.base?
+ @pieces.eachdo|name, target_piece|
+ iftarget_piece.position==move.destinationand
+ target_piece!=move.pieceand
+ notmove.piece.contains.member?(target_piece) and
+ target_piece.colour!=player
+ move.piece.capture(target_piece)
+ end
+ end
+ end
+
+ # If the move was via our base, drop all captured pieces
+ ifmove.via_base?
+ capturers_base = board.positions[move.piece.colour]
+ move.piece.contains.eachdo|captured_piece|
+ captured_piece.move_tocapturers_base
+ captured_piece.captured = falseifcaptured_piece.colour==move.piece.colour
+ end
+ move.piece.contains = []
+ end
+
+ # Record the new stae
+ this_game_state = GameState.new(move, player, @pieces)
+ @history<<this_game_state
+
+ # If there's only one player with uncaptured pieces, declare a win
+ potential_players = []
+ @players.eachdo|p|
+ potential_players<<pif (@pieces.values.select {|p|p.colour==@current_player}).any? {|p|notp.captured}
+ end
+ ifpotential_players.length<=1
+ raise(GameWonNotice, "Game won by #{potential_players[0]}")
+ end
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/M000023.html b/doc/classes/Game.src/M000023.html
new file mode 100644
index 0000000..4ab28cf
--- /dev/null
+++ b/doc/classes/Game.src/M000023.html
@@ -0,0 +1,27 @@
+
+
+
+
+
+ apply_moves (Game)
+
+
+
+
+
# File lib/libttc.rb, line 401
+ defapply_moves(moves)
+ moves.eachdo|move|
+ ifmove.via_base?
+ moved_distance = board.distance_between[move.piece.position.place][@current_player] +
+ board.distance_between[@current_player][move.destination.place]
+ else
+ moved_distance = board.distance_between[move.piece.position.place][move.destination.place]
+ end
+ self.apply_move(move, @current_player)
+ next_playerunlessmoved_distance==6
+ end
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/M000024.html b/doc/classes/Game.src/M000024.html
new file mode 100644
index 0000000..c3acbeb
--- /dev/null
+++ b/doc/classes/Game.src/M000024.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+ next_player (Game)
+
+
+
+
+
# File lib/libttc.rb, line 416
+ defnext_player
+ original_player = @current_player
+ begin
+ if@current_player==@players[-1]
+ @current_player = @players[0]
+ else
+ @current_player = @players[@players.index(@current_player) +1]
+ end
+ endwhile (@pieces.values.select {|p|p.colour==@current_player}).all? {|p|p.captured} and@current_player!=original_player
+ @current_player
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/M000025.html b/doc/classes/Game.src/M000025.html
new file mode 100644
index 0000000..9d031de
--- /dev/null
+++ b/doc/classes/Game.src/M000025.html
@@ -0,0 +1,48 @@
+
+
+
+
+
+ possible_moves (Game)
+
+
+
+
+
# File lib/libttc.rb, line 430
+ defpossible_moves(die_result, player = @current_player)
+ moves = []
+ @pieces.eachdo|key, piece|
+ # only move current player's pieces, and only if they're not captured
+ ifpiece.colour==playerand (notpiece.captured)
+ (@board.valid_moves[piece.position.place][die_result]).eachdo|destination|
+ ifdestination.safe?
+ if (@pieces.find_all {|k, p|p.position==destination}).length<3
+ moves<<Move.new(piece, destination, false)
+ end
+ else
+ moves<<Move.new(piece, destination, false) unlessdestination.base?
+ end
+ end
+ # if we can move to our base (but not already on it), add moves via that...
+ if@board.distance_between[piece.position.place][player] <=die_resultand
+ notpiece.position.place==playerand
+ notpiece.contains.empty?
+ distance_after_base = die_result-board.distance_between[piece.position.place][player]
+ (@board.valid_moves[player][distance_after_base]).eachdo|destination|
+ ifdestination.safe?
+ if (@pieces.find_all {|k, p|p.position==destination}).length<3
+ moves<<Move.new(piece, destination, true)
+ end
+ else
+ moves<<Move.new(piece, destination, true)
+ end
+ end
+ end
+ end
+ end
+ moves
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/M000026.html b/doc/classes/Game.src/M000026.html
new file mode 100644
index 0000000..e2d04c4
--- /dev/null
+++ b/doc/classes/Game.src/M000026.html
@@ -0,0 +1,24 @@
+
+
+
+
+
+ show_state (Game)
+
+
+
+
+
# File lib/libttc.rb, line 466
+ defshow_state
+ @pieces.keys.sort.eachdo|piece_name|
+ if@pieces[piece_name].captured
+ puts"Piece #{piece_name} captured, at #{@pieces[piece_name].position}"
+ else
+ puts"Piece #{piece_name} is at #{@pieces[piece_name].position}, holds #{(@pieces[piece_name].contains.collect{|c| c.name}).join(' ')}"
+ end
+ end
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/M000027.html b/doc/classes/Game.src/M000027.html
new file mode 100644
index 0000000..fc46f3a
--- /dev/null
+++ b/doc/classes/Game.src/M000027.html
@@ -0,0 +1,22 @@
+
+
+
+
+
+ read_game (Game)
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/M000037.html b/doc/classes/Game.src/M000037.html
new file mode 100644
index 0000000..7f2ca42
--- /dev/null
+++ b/doc/classes/Game.src/M000037.html
@@ -0,0 +1,79 @@
+
+
+
+
+
+ apply_move! (Game)
+
+
+
+
+
# File lib/libttc.rb, line 379
+ defapply_move!(move, player = @current_player)
+ # Check the move is a valid one
+ raise(InvalidMoveError, "Piece #{move.piece} does not exist") unless@pieces.has_key?(move.piece.name)
+ raise(InvalidMoveError, "Player #{player} moving piece #{move.piece}") unlessmove.piece.colour==player
+ raise(InvalidMoveError, "Attempting to move captured piece #{move.piece}") ifmove.piece.captured
+ raise(InvalidMoveError, "Attempting to move #{move.piece} onto or via base without captured pieces") ifmove.via_base?andmove.piece.contains.empty?
+ ifmove.destination.safe?
+ if (@pieces.find_all {|k, p|p.position==move.destination}).length>=3
+ raise(InvalidMoveError, "Attempting to move #{move.piece} onto safe position #{move.destination} when there are already three or more pieces there")
+ end
+ end
+ ifmove.via_base?
+ moved_distance = board.distance_between[move.piece.position.place][player] +
+ board.distance_between[player][move.destination.place]
+ else
+ moved_distance = board.distance_between[move.piece.position.place][move.destination.place]
+ end
+ raise(InvalidMoveError, "Attempting to move piece #{move.piece} #{moved_distance} places (from #{move.piece.position} to #{move.destination})") ifmoved_distance<1ormoved_distance>6
+
+ # Apply this move
+ move.piece.move_to(move.destination)
+
+ # Capture anything already there (unless it's a safe place or a base,
+ # or our own colour, or already captured)
+ unlessmove.destination.safe?ormove.destination.base?
+ @pieces.eachdo|name, target_piece|
+ iftarget_piece.position==move.destinationand
+ target_piece!=move.pieceand
+ notmove.piece.contains.member?(target_piece) and
+ target_piece.colour!=playerand
+ nottarget_piece.captured
+ move.piece.capture(target_piece)
+ end
+ end
+ end
+
+ # If the move was via our base, drop all captured pieces
+ ifmove.via_base?
+ capturers_base = board.positions[move.piece.colour]
+ move.piece.contains.eachdo|captured_piece|
+ captured_piece.move_tocapturers_base
+ captured_piece.captured = falseifcaptured_piece.colour==move.piece.colour
+ end
+ move.piece.contains = []
+ end
+
+ # Record the new stae
+ this_game_state = GameState.new(move, player, @pieces)
+ @history<<this_game_state
+
+ # Retain only players that have uncaptured pieces.
+ # If there's only one player with uncaptured pieces, declare a win.
+ potential_players = []
+ @players.eachdo|p|
+ if (@pieces.values.select {|piece|piece.colour==p}).any? {|piece|notpiece.captured}
+ potential_players<<p
+ end
+ # potential_players << p if (@pieces.values.select {|p| p.colour == @current_player}).any? {|p| not p.captured}
+ end
+ ifpotential_players.length<=1
+ raise(GameWonNotice, "Game won by #{potential_players[0]}")
+ end
+ @players = potential_players.sort
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/M000038.html b/doc/classes/Game.src/M000038.html
new file mode 100644
index 0000000..76e138e
--- /dev/null
+++ b/doc/classes/Game.src/M000038.html
@@ -0,0 +1,42 @@
+
+
+
+
+
+ undo_move! (Game)
+
+
+
+
+
# File lib/libttc.rb, line 445
+ defundo_move!
+ if@history.length>1
+ # general case
+ state_to_restore = @history[-2]
+ @current_player = @history[-1].player
+ @pieces.eachdo|name, piece|
+ copy_piece = state_to_restore.pieces_after_move[name]
+ piece.position = copy_piece.position
+ piece.captured = copy_piece.captured
+ piece.contains = []
+ copy_piece.contains.eachdo|p|
+# piece.capture(@pieces[p.name])
+ piece.contains<<@pieces[p.name]
+ end
+ end
+ @history.pop
+ elsif@history.length==1
+ # reset to start
+ @current_player = 'a'
+ @pieces.eachdo|name, piece|
+ piece.position = @board.positions[piece.colour]
+ piece.captured = false
+ piece.contains = []
+ end
+ @history.pop
+ end
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/M000039.html b/doc/classes/Game.src/M000039.html
new file mode 100644
index 0000000..e6beeb0
--- /dev/null
+++ b/doc/classes/Game.src/M000039.html
@@ -0,0 +1,27 @@
+
+
+
+
+
+ apply_moves! (Game)
+
+
+
+
+
# File lib/libttc.rb, line 474
+ defapply_moves!(moves)
+ moves.eachdo|move|
+ ifmove.via_base?
+ moved_distance = board.distance_between[move.piece.position.place][@current_player] +
+ board.distance_between[@current_player][move.destination.place]
+ else
+ moved_distance = board.distance_between[move.piece.position.place][move.destination.place]
+ end
+ self.apply_move!(move, @current_player)
+ next_player!unlessmoved_distance==6
+ end
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/M000040.html b/doc/classes/Game.src/M000040.html
new file mode 100644
index 0000000..bb9306b
--- /dev/null
+++ b/doc/classes/Game.src/M000040.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+ next_player! (Game)
+
+
+
+
+
# File lib/libttc.rb, line 489
+ defnext_player!
+ original_player = @current_player
+ begin
+ if@current_player==@players[-1]
+ @current_player = @players[0]
+ else
+ @current_player = @players[@players.index(@current_player) +1]
+ end
+ endwhile (@pieces.values.select {|p|p.colour==@current_player}).all? {|p|p.captured} and@current_player!=original_player
+ @current_player
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/M000041.html b/doc/classes/Game.src/M000041.html
new file mode 100644
index 0000000..d8fff61
--- /dev/null
+++ b/doc/classes/Game.src/M000041.html
@@ -0,0 +1,48 @@
+
+
+
+
+
+ possible_moves (Game)
+
+
+
+
+
# File lib/libttc.rb, line 504
+ defpossible_moves(die_result, player = @current_player)
+ moves = []
+ @pieces.eachdo|key, piece|
+ # only move current player's pieces, and only if they're not captured
+ ifpiece.colour==playerand (notpiece.captured)
+ (@board.valid_moves[piece.position.place][die_result]).eachdo|destination|
+ ifdestination.safe?
+ if (@pieces.find_all {|k, p|p.position==destination}).length<3
+ moves<<Move.new(piece, destination, false)
+ end
+ else
+ moves<<Move.new(piece, destination, false) unlessdestination.base?
+ end
+ end
+ # if we can move to our base (but not already on it), add moves via that...
+ if@board.distance_between[piece.position.place][player] <=die_resultand
+ notpiece.position.place==playerand
+ notpiece.contains.empty?
+ distance_after_base = die_result-@board.distance_between[piece.position.place][player]
+ (@board.valid_moves[player][distance_after_base]).eachdo|destination|
+ ifdestination.safe?
+ if (@pieces.find_all {|k, p|p.position==destination}).length<3
+ moves<<Move.new(piece, destination, true)
+ end
+ else
+ moves<<Move.new(piece, destination, true)
+ end
+ end
+ end
+ end
+ end
+ moves
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/M000042.html b/doc/classes/Game.src/M000042.html
new file mode 100644
index 0000000..4ba853e
--- /dev/null
+++ b/doc/classes/Game.src/M000042.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+ build_state_string (Game)
+
+
+
+
+
# File lib/libttc.rb, line 539
+ defbuild_state_string
+ outstr = "Current player = #{@current_player}\n"
+ @pieces.keys.sort.eachdo|piece_name|
+ if@pieces[piece_name].captured
+ outstr<<"Piece #{piece_name} captured, at #{@pieces[piece_name].position}\n"
+ else
+ outstr<<"Piece #{piece_name} is at #{@pieces[piece_name].position}, holds #{(@pieces[piece_name].contains.collect{|c| c.name}).join(' ')}\n"
+ end
+ end
+ outstr
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/M000043.html b/doc/classes/Game.src/M000043.html
new file mode 100644
index 0000000..2b3bc35
--- /dev/null
+++ b/doc/classes/Game.src/M000043.html
@@ -0,0 +1,25 @@
+
+
+
+
+
+ show_state (Game)
+
+
+
+
+
# File lib/libttc.rb, line 552
+ defshow_state
+ putsbuild_state_string
+# @pieces.keys.sort.each do |piece_name|
+# if @pieces[piece_name].captured
+# puts "Piece #{piece_name} captured, at #{@pieces[piece_name].position}"
+# else
+# puts "Piece #{piece_name} is at #{@pieces[piece_name].position}, holds #{(@pieces[piece_name].contains.collect{|c| c.name}).join(' ')}"
+# end
+# end
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/M000044.html b/doc/classes/Game.src/M000044.html
new file mode 100644
index 0000000..55553f4
--- /dev/null
+++ b/doc/classes/Game.src/M000044.html
@@ -0,0 +1,18 @@
+
+
+
+
+
+ to_s (Game)
+
+
+
+
+
# File lib/libttc.rb, line 563
+ defto_s
+ show_state
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/M000045.html b/doc/classes/Game.src/M000045.html
new file mode 100644
index 0000000..4ca247d
--- /dev/null
+++ b/doc/classes/Game.src/M000045.html
@@ -0,0 +1,18 @@
+
+
+
+
+
+ to_str (Game)
+
+
+
+
+
# File lib/libttc.rb, line 567
+ defto_str
+ to_s
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/Game.src/M000046.html b/doc/classes/Game.src/M000046.html
new file mode 100644
index 0000000..c3e7452
--- /dev/null
+++ b/doc/classes/Game.src/M000046.html
@@ -0,0 +1,22 @@
+
+
+
+
+
+ read_game (Game)
+
+
+
+
+
+Play a game of Trap the Cap. If players make illegal moves, disqualify them
+and restart the game. Terminate the game if there‘s a winner,
+there‘s only one player left, or the game has gone on too long.
+
+A class to record each of the states previously found in a game. Note that
+this is a deep copy of the pieces and what they‘ve captured, so
+you‘ll need to convert back
+
# File lib/libttc.rb, line 305
+ definitialize(move, player, pieces)
+ @move = move
+ @player = player
+ @pieces_after_move = pieces
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/GameState.src/.svn/text-base/M000002.html.svn-base b/doc/classes/GameState.src/.svn/text-base/M000002.html.svn-base
new file mode 100644
index 0000000..7f6ef75
--- /dev/null
+++ b/doc/classes/GameState.src/.svn/text-base/M000002.html.svn-base
@@ -0,0 +1,20 @@
+
+
+
+
+
+ == (GameState)
+
+
+
+
+
# File lib/libttc.rb, line 311
+ def==(other)
+ @move.to_s==other.move.to_sand
+ @player==other.playerand
+ @piece_after_move==other.pieces_after_move
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/GameState.src/.svn/text-base/M000003.html.svn-base b/doc/classes/GameState.src/.svn/text-base/M000003.html.svn-base
new file mode 100644
index 0000000..cbc2dda
--- /dev/null
+++ b/doc/classes/GameState.src/.svn/text-base/M000003.html.svn-base
@@ -0,0 +1,20 @@
+
+
+
+
+
+ new (GameState)
+
+
+
+
+
# File lib/libttc.rb, line 294
+ definitialize(move, player, pieces)
+ @move = move
+ @player = player
+ @pieces_after_move = pieces
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/GameState.src/.svn/text-base/M000004.html.svn-base b/doc/classes/GameState.src/.svn/text-base/M000004.html.svn-base
new file mode 100644
index 0000000..9df9f44
--- /dev/null
+++ b/doc/classes/GameState.src/.svn/text-base/M000004.html.svn-base
@@ -0,0 +1,20 @@
+
+
+
+
+
+ == (GameState)
+
+
+
+
+
# File lib/libttc.rb, line 300
+ def==(other)
+ @move.to_s==other.move.to_sand
+ @player==other.playerand
+ @piece_after_move==other.pieces_after_move
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/GameState.src/.svn/text-base/M000008.html.svn-base b/doc/classes/GameState.src/.svn/text-base/M000008.html.svn-base
new file mode 100644
index 0000000..0b52bab
--- /dev/null
+++ b/doc/classes/GameState.src/.svn/text-base/M000008.html.svn-base
@@ -0,0 +1,28 @@
+
+
+
+
+
+ new (GameState)
+
+
+
+
+
# File lib/libttc.rb, line 323
+ definitialize(move, player, pieces)
+ @move = move
+ @player = player
+ @pieces_after_move = Hash.new
+ pieces.each {|k, p|@pieces_after_move[k] = p.dup}
+ @pieces_after_move.each_value {|p|p.contains = []}
+ # and now to make the captured pieces point to the copies
+ pieces.eachdo|k, p|
+ p.contains.eachdo|captured_piece|
+ @pieces_after_move[k].capture(@pieces_after_move[captured_piece.name])
+ end
+ end
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/GameState.src/.svn/text-base/M000009.html.svn-base b/doc/classes/GameState.src/.svn/text-base/M000009.html.svn-base
new file mode 100644
index 0000000..a497a37
--- /dev/null
+++ b/doc/classes/GameState.src/.svn/text-base/M000009.html.svn-base
@@ -0,0 +1,20 @@
+
+
+
+
+
+ == (GameState)
+
+
+
+
+
# File lib/libttc.rb, line 337
+ def==(other)
+ @move.to_s==other.move.to_sand
+ @player==other.playerand
+ @piece_after_move==other.pieces_after_move
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/GameState.src/M000001.html b/doc/classes/GameState.src/M000001.html
new file mode 100644
index 0000000..c82f29e
--- /dev/null
+++ b/doc/classes/GameState.src/M000001.html
@@ -0,0 +1,20 @@
+
+
+
+
+
+ new (GameState)
+
+
+
+
+
# File lib/libttc.rb, line 305
+ definitialize(move, player, pieces)
+ @move = move
+ @player = player
+ @pieces_after_move = pieces
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/GameState.src/M000002.html b/doc/classes/GameState.src/M000002.html
new file mode 100644
index 0000000..7f6ef75
--- /dev/null
+++ b/doc/classes/GameState.src/M000002.html
@@ -0,0 +1,20 @@
+
+
+
+
+
+ == (GameState)
+
+
+
+
+
# File lib/libttc.rb, line 311
+ def==(other)
+ @move.to_s==other.move.to_sand
+ @player==other.playerand
+ @piece_after_move==other.pieces_after_move
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/GameState.src/M000003.html b/doc/classes/GameState.src/M000003.html
new file mode 100644
index 0000000..cbc2dda
--- /dev/null
+++ b/doc/classes/GameState.src/M000003.html
@@ -0,0 +1,20 @@
+
+
+
+
+
+ new (GameState)
+
+
+
+
+
# File lib/libttc.rb, line 294
+ definitialize(move, player, pieces)
+ @move = move
+ @player = player
+ @pieces_after_move = pieces
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/GameState.src/M000004.html b/doc/classes/GameState.src/M000004.html
new file mode 100644
index 0000000..9df9f44
--- /dev/null
+++ b/doc/classes/GameState.src/M000004.html
@@ -0,0 +1,20 @@
+
+
+
+
+
+ == (GameState)
+
+
+
+
+
# File lib/libttc.rb, line 300
+ def==(other)
+ @move.to_s==other.move.to_sand
+ @player==other.playerand
+ @piece_after_move==other.pieces_after_move
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/GameState.src/M000008.html b/doc/classes/GameState.src/M000008.html
new file mode 100644
index 0000000..0b52bab
--- /dev/null
+++ b/doc/classes/GameState.src/M000008.html
@@ -0,0 +1,28 @@
+
+
+
+
+
+ new (GameState)
+
+
+
+
+
# File lib/libttc.rb, line 323
+ definitialize(move, player, pieces)
+ @move = move
+ @player = player
+ @pieces_after_move = Hash.new
+ pieces.each {|k, p|@pieces_after_move[k] = p.dup}
+ @pieces_after_move.each_value {|p|p.contains = []}
+ # and now to make the captured pieces point to the copies
+ pieces.eachdo|k, p|
+ p.contains.eachdo|captured_piece|
+ @pieces_after_move[k].capture(@pieces_after_move[captured_piece.name])
+ end
+ end
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/GameState.src/M000009.html b/doc/classes/GameState.src/M000009.html
new file mode 100644
index 0000000..a497a37
--- /dev/null
+++ b/doc/classes/GameState.src/M000009.html
@@ -0,0 +1,20 @@
+
+
+
+
+
+ == (GameState)
+
+
+
+
+
# File lib/libttc.rb, line 337
+ def==(other)
+ @move.to_s==other.move.to_sand
+ @player==other.playerand
+ @piece_after_move==other.pieces_after_move
+ end
+
+
\ No newline at end of file
diff --git a/doc/classes/GameTest.html b/doc/classes/GameTest.html
new file mode 100644
index 0000000..e6067b2
--- /dev/null
+++ b/doc/classes/GameTest.html
@@ -0,0 +1,287 @@
+
+
+
+
+
+ Class: GameTest
+
+
+
+
+
+
+
+
+
+
+
+Read a game description file and convert it into a Game object and set of Move
+objects. Note that Game.read_game method
+returns multiple values, so this one does too.
+
+
+
+
\ No newline at end of file
diff --git a/doc/files/lib/.svn/text-base/libttc_rb.html.svn-base b/doc/files/lib/.svn/text-base/libttc_rb.html.svn-base
new file mode 100644
index 0000000..b1f7c88
--- /dev/null
+++ b/doc/files/lib/.svn/text-base/libttc_rb.html.svn-base
@@ -0,0 +1,165 @@
+
+
+
+
+
+ File: libttc.rb
+
+
+
+
+
+
+
+
+
+
+
+
libttc.rb
+
+
+
Path:
+
lib/libttc.rb
+
+
+
+
Last Update:
+
Thu Mar 27 16:06:40 +0000 2008
+
+
+
+
+
+
+
+
+
+
+
+
+
Synopsis
+
+Library to support Trap the Cap play
+
+
Author
+
+Neil Smith
+
+
+This program is free software: you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the Free
+Software Foundation, either version 3 of the License, or (at your option)
+any later version.
+
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+more details.
+
+
+You should have received a copy of the GNU General Public License along
+with this program. If not, see <www.gnu.org/licenses/>.
+
+
Change history
+
+
Version 1.1:
07 Sep 2007
+
+
+
Changed format for showing moves via bases.
+
+
+
Raise error when moving via base without captured pieces
+
+
+
Raise error when moving onto a safe space with 3 or more pieces already
+there
+
+
+
+
+
\ No newline at end of file
diff --git a/doc/files/lib/libttc_rb.html b/doc/files/lib/libttc_rb.html
new file mode 100644
index 0000000..b1f7c88
--- /dev/null
+++ b/doc/files/lib/libttc_rb.html
@@ -0,0 +1,165 @@
+
+
+
+
+
+ File: libttc.rb
+
+
+
+
+
+
+
+
+
+
+
+
libttc.rb
+
+
+
Path:
+
lib/libttc.rb
+
+
+
+
Last Update:
+
Thu Mar 27 16:06:40 +0000 2008
+
+
+
+
+
+
+
+
+
+
+
+
+
Synopsis
+
+Library to support Trap the Cap play
+
+
Author
+
+Neil Smith
+
+
+This program is free software: you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the Free
+Software Foundation, either version 3 of the License, or (at your option)
+any later version.
+
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+more details.
+
+
+You should have received a copy of the GNU General Public License along
+with this program. If not, see <www.gnu.org/licenses/>.
+
+
Change history
+
+
Version 1.1:
07 Sep 2007
+
+
+
Changed format for showing moves via bases.
+
+
+
Raise error when moving via base without captured pieces
+
+
+
Raise error when moving onto a safe space with 3 or more pieces already
+there
+
+
+ Game state file read on STDIN
+ Move produced on STDOUT
+
+
Author
+
+Neil Smith
+
+
+This program is free software: you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the Free
+Software Foundation, either version 3 of the License, or (at your option)
+any later version.
+
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+more details.
+
+
+You should have received a copy of the GNU General Public License along
+with this program. If not, see <www.gnu.org/licenses/>.
+
+
+
+
\ No newline at end of file
diff --git a/doc/files/src/clockwise-cloud_rb.html b/doc/files/src/clockwise-cloud_rb.html
new file mode 100644
index 0000000..8b416a5
--- /dev/null
+++ b/doc/files/src/clockwise-cloud_rb.html
@@ -0,0 +1,170 @@
+
+
+
+
+
+ File: clockwise-cloud.rb
+
+
+
+
+
+
+
+
+
+
+
+
clockwise-cloud.rb
+
+
+
Path:
+
src/clockwise-cloud.rb
+
+
+
+
Last Update:
+
Fri Aug 31 20:04:34 +0100 2007
+
+
+
+
+
+
+
+
+
+
+
+
+
Synopsis
+
+Play one move of a Trap the Cap game
+
+
Usage
+
+clockwise-p1
+
+
+ Game state file read on STDIN
+ Move produced on STDOUT
+
+
Author
+
+Neil Smith
+
+
+This program is free software: you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the Free
+Software Foundation, either version 3 of the License, or (at your option)
+any later version.
+
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+more details.
+
+
+You should have received a copy of the GNU General Public License along
+with this program. If not, see <www.gnu.org/licenses/>.
+
# File src/clockwise-cloud.rb, line 31
+defmore_clockwise(this, other)
+ here = this.place
+ there = other.place
+
+ # if both are on a spoke, choose the one with the lowest number (nearer the rim)
+ ifhere=~/.c./andthere=~/.c./
+ # break ties by preferring the most clockwise arc
+ ifhere[-1] ==there[-1]
+ returnhere[0] <=>there[0]
+ else
+ return-1* (here[-1] <=>there[-1])
+ end
+ # If one is one a spoke and the other is on the rim, choose the one on the rim
+ elsifhere=~/.c./orthere=~/.c./
+ return-1* (here.length<=>there.length)
+ # If one is in the 'f' rim section and the other in the 'a' rim section, choose the 'a'
+ elsifhere[0,1] =='a'andthere[0,1] =='f'
+ return+1
+ elsifhere[0,1] =='f'andthere[0,1] =='a'
+ return-1
+ # Otherwise, choose the one with highest arc code
+ else
+ returnhere<=>there
+ end
+
+end
+
+
\ No newline at end of file
diff --git a/doc/files/src/clockwise-cloud_rb.src/M000001.html b/doc/files/src/clockwise-cloud_rb.src/M000001.html
new file mode 100644
index 0000000..0328a09
--- /dev/null
+++ b/doc/files/src/clockwise-cloud_rb.src/M000001.html
@@ -0,0 +1,41 @@
+
+
+
+
+
+ more_clockwise (src/clockwise-cloud.rb)
+
+
+
+
+
# File src/clockwise-cloud.rb, line 31
+defmore_clockwise(this, other)
+ here = this.place
+ there = other.place
+
+ # if both are on a spoke, choose the one with the lowest number (nearer the rim)
+ ifhere=~/.c./andthere=~/.c./
+ # break ties by preferring the most clockwise arc
+ ifhere[-1] ==there[-1]
+ returnhere[0] <=>there[0]
+ else
+ return-1* (here[-1] <=>there[-1])
+ end
+ # If one is one a spoke and the other is on the rim, choose the one on the rim
+ elsifhere=~/.c./orthere=~/.c./
+ return-1* (here.length<=>there.length)
+ # If one is in the 'f' rim section and the other in the 'a' rim section, choose the 'a'
+ elsifhere[0,1] =='a'andthere[0,1] =='f'
+ return+1
+ elsifhere[0,1] =='f'andthere[0,1] =='a'
+ return-1
+ # Otherwise, choose the one with highest arc code
+ else
+ returnhere<=>there
+ end
+
+end
+
+
\ No newline at end of file
diff --git a/doc/files/src/clockwise-p1_rb.html b/doc/files/src/clockwise-p1_rb.html
new file mode 100644
index 0000000..6e5729b
--- /dev/null
+++ b/doc/files/src/clockwise-p1_rb.html
@@ -0,0 +1,154 @@
+
+
+
+
+
+ File: clockwise-p1.rb
+
+
+
+
+
+
+
+
+
+
+
+
clockwise-p1.rb
+
+
+
Path:
+
src/clockwise-p1.rb
+
+
+
+
Last Update:
+
Fri Aug 31 12:19:53 +0100 2007
+
+
+
+
+
+
+
+
+
+
+
+
+
Synopsis
+
+Play one move of a Trap the Cap game
+
+
Usage
+
+clockwise-p1
+
+
+ Game state file read on STDIN
+ Move produced on STDOUT
+
# File src/clockwise-p1.rb, line 19
+defmore_clockwise(this, other)
+ here = this.destination.place
+ there = other.destination.place
+
+ # if both are on a spoke, choose the one with the lowest number (nearer the rim)
+ ifhere=~/.c./andthere=~/.c./
+ # break ties by preferring the most clockwise arc
+ ifhere[-1] ==there[-1]
+ returnhere[0] <=>there[0]
+ else
+ return-1* (here[-1] <=>there[-1])
+ end
+ # If one is one a spoke and the other is on the rim, choose the one on the rim
+ elsifhere=~/.c./orthere=~/.c./
+ return-1* (here.length<=>there.length)
+ # If one is in the 'f' rim section and the other in the 'a' rim section, choose the 'a'
+ elsifhere[0,1] =='a'andthere[0,1] =='f'
+ return+1
+ elsifhere[0,1] =='f'andthere[0,1] =='a'
+ return-1
+ # Otherwise, choose the one with highest arc code
+ else
+ returnhere<=>there
+ end
+
+end
+
+
\ No newline at end of file
diff --git a/doc/files/src/clockwise-p1_rb.src/M000002.html b/doc/files/src/clockwise-p1_rb.src/M000002.html
new file mode 100644
index 0000000..89f6822
--- /dev/null
+++ b/doc/files/src/clockwise-p1_rb.src/M000002.html
@@ -0,0 +1,41 @@
+
+
+
+
+
+ more_clockwise (src/clockwise-p1.rb)
+
+
+
+
+
# File src/clockwise-p1.rb, line 19
+defmore_clockwise(this, other)
+ here = this.destination.place
+ there = other.destination.place
+
+ # if both are on a spoke, choose the one with the lowest number (nearer the rim)
+ ifhere=~/.c./andthere=~/.c./
+ # break ties by preferring the most clockwise arc
+ ifhere[-1] ==there[-1]
+ returnhere[0] <=>there[0]
+ else
+ return-1* (here[-1] <=>there[-1])
+ end
+ # If one is one a spoke and the other is on the rim, choose the one on the rim
+ elsifhere=~/.c./orthere=~/.c./
+ return-1* (here.length<=>there.length)
+ # If one is in the 'f' rim section and the other in the 'a' rim section, choose the 'a'
+ elsifhere[0,1] =='a'andthere[0,1] =='f'
+ return+1
+ elsifhere[0,1] =='f'andthere[0,1] =='a'
+ return-1
+ # Otherwise, choose the one with highest arc code
+ else
+ returnhere<=>there
+ end
+
+end
+
+
\ No newline at end of file
diff --git a/doc/files/src/play_rb.html b/doc/files/src/play_rb.html
new file mode 100644
index 0000000..27c3639
--- /dev/null
+++ b/doc/files/src/play_rb.html
@@ -0,0 +1,126 @@
+
+
+
+
+
+ File: play.rb
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/doc/index.html b/doc/index.html
new file mode 100644
index 0000000..e3c61b6
--- /dev/null
+++ b/doc/index.html
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+ RDoc Documentation
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/doc/rdoc-style.css b/doc/rdoc-style.css
new file mode 100644
index 0000000..44c7b3d
--- /dev/null
+++ b/doc/rdoc-style.css
@@ -0,0 +1,208 @@
+
+body {
+ font-family: Verdana,Arial,Helvetica,sans-serif;
+ font-size: 90%;
+ margin: 0;
+ margin-left: 40px;
+ padding: 0;
+ background: white;
+}
+
+h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; }
+h1 { font-size: 150%; }
+h2,h3,h4 { margin-top: 1em; }
+
+a { background: #eef; color: #039; text-decoration: none; }
+a:hover { background: #039; color: #eef; }
+
+/* Override the base stylesheet's Anchor inside a table cell */
+td > a {
+ background: transparent;
+ color: #039;
+ text-decoration: none;
+}
+
+/* and inside a section title */
+.section-title > a {
+ background: transparent;
+ color: #eee;
+ text-decoration: none;
+}
+
+/* === Structural elements =================================== */
+
+div#index {
+ margin: 0;
+ margin-left: -40px;
+ padding: 0;
+ font-size: 90%;
+}
+
+
+div#index a {
+ margin-left: 0.7em;
+}
+
+div#index .section-bar {
+ margin-left: 0px;
+ padding-left: 0.7em;
+ background: #ccc;
+ font-size: small;
+}
+
+
+div#classHeader, div#fileHeader {
+ width: auto;
+ color: white;
+ padding: 0.5em 1.5em 0.5em 1.5em;
+ margin: 0;
+ margin-left: -40px;
+ border-bottom: 3px solid #006;
+}
+
+div#classHeader a, div#fileHeader a {
+ background: inherit;
+ color: white;
+}
+
+div#classHeader td, div#fileHeader td {
+ background: inherit;
+ color: white;
+}
+
+
+div#fileHeader {
+ background: #057;
+}
+
+div#classHeader {
+ background: #048;
+}
+
+
+.class-name-in-header {
+ font-size: 180%;
+ font-weight: bold;
+}
+
+
+div#bodyContent {
+ padding: 0 1.5em 0 1.5em;
+}
+
+div#description {
+ padding: 0.5em 1.5em;
+ background: #efefef;
+ border: 1px dotted #999;
+}
+
+div#description h1,h2,h3,h4,h5,h6 {
+ color: #125;;
+ background: transparent;
+}
+
+div#validator-badges {
+ text-align: center;
+}
+div#validator-badges img { border: 0; }
+
+div#copyright {
+ color: #333;
+ background: #efefef;
+ font: 0.75em sans-serif;
+ margin-top: 5em;
+ margin-bottom: 0;
+ padding: 0.5em 2em;
+}
+
+
+/* === Classes =================================== */
+
+table.header-table {
+ color: white;
+ font-size: small;
+}
+
+.type-note {
+ font-size: small;
+ color: #DEDEDE;
+}
+
+.xxsection-bar {
+ background: #eee;
+ color: #333;
+ padding: 3px;
+}
+
+.section-bar {
+ color: #333;
+ border-bottom: 1px solid #999;
+ margin-left: -20px;
+}
+
+
+.section-title {
+ background: #79a;
+ color: #eee;
+ padding: 3px;
+ margin-top: 2em;
+ margin-left: -30px;
+ border: 1px solid #999;
+}
+
+.top-aligned-row { vertical-align: top }
+.bottom-aligned-row { vertical-align: bottom }
+
+/* --- Context section classes ----------------------- */
+
+.context-row { }
+.context-item-name { font-family: monospace; font-weight: bold; color: black; }
+.context-item-value { font-size: small; color: #448; }
+.context-item-desc { color: #333; padding-left: 2em; }
+
+/* --- Method classes -------------------------- */
+.method-detail {
+ background: #efefef;
+ padding: 0;
+ margin-top: 0.5em;
+ margin-bottom: 1em;
+ border: 1px dotted #ccc;
+}
+.method-heading {
+ color: black;
+ background: #ccc;
+ border-bottom: 1px solid #666;
+ padding: 0.2em 0.5em 0 0.5em;
+}
+.method-signature { color: black; background: inherit; }
+.method-name { font-weight: bold; }
+.method-args { font-style: italic; }
+.method-description { padding: 0 0.5em 0 0.5em; }
+
+/* --- Source code sections -------------------- */
+
+a.source-toggle { font-size: 90%; }
+div.method-source-code {
+ background: #262626;
+ color: #ffdead;
+ margin: 1em;
+ padding: 0.5em;
+ border: 1px dashed #999;
+ overflow: hidden;
+}
+
+div.method-source-code pre { color: #ffdead; overflow: hidden; }
+
+/* --- Ruby keyword styles --------------------- */
+
+.standalone-code { background: #221111; color: #ffdead; overflow: hidden; }
+
+.ruby-constant { color: #7fffd4; background: transparent; }
+.ruby-keyword { color: #00ffff; background: transparent; }
+.ruby-ivar { color: #eedd82; background: transparent; }
+.ruby-operator { color: #00ffee; background: transparent; }
+.ruby-identifier { color: #ffdead; background: transparent; }
+.ruby-node { color: #ffa07a; background: transparent; }
+.ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
+.ruby-regexp { color: #ffa07a; background: transparent; }
+.ruby-value { color: #7fffd4; background: transparent; }
\ No newline at end of file
diff --git a/ga-logs/gen-153.txt b/ga-logs/gen-153.txt
new file mode 100644
index 0000000..b42fc92
--- /dev/null
+++ b/ga-logs/gen-153.txt
@@ -0,0 +1,402 @@
+Generation 153
+00000000000010000011
+00000000000010100011
+00000000000010000001
+00000000000010100011
+00000000000010000001
+00000000000011100001
+00000000000010000001
+00000000000010100011
+00000000000010010011
+00000000000010000011
+00000000000010110011
+00000000000010000001
+00000000000010000001
+00000000000010000001
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010000001
+00000000000010110011
+00000000000010110011
+00000000000010000001
+00000000000010100001
+00000000000010110011
+00000000000010110011
+00000000000010010010
+00000000000010000011
+00000000000010100001
+00000000000010110001
+00000000000010010011
+00000000000010110001
+00000000000010010010
+00000000000010000011
+00000000000010110011
+00000000000010110001
+00000000000010000011
+00000000000010100011
+00000000000010100011
+00000000000010010010
+00000000000010000011
+00000000000010010010
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00000000000010100001
+00000000000010100011
+00000000000010100001
+00000000000010000011
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00000000000010100001
+00000000000010000011
+00000000000010110011
+00000000000010000001
+00000000000010000011
+00000000000010100001
+00000000000010000011
+00000000000010100011
+00000000000010100011
+00000000000010100001
+00000000000010100001
+00000000000010110011
+00000000000010000001
+00000000000010000001
+00000000000010100001
+00000000000010110000
+00000000000010110011
+00000000000010000010
+00000000000010110011
+00000000000010000011
+00000000000010100011
+00000000000010000011
+00000000000010010011
+00000000000010100011
+00000000000010100011
+00000000000010110011
+00000000000010100001
+00000000000010100011
+00000000000010110011
+00000000000010110001
+00000000000010110001
+00000000000010110011
+00000000000010010010
+00000000000010010010
+00000000000010100001
+00000000000010100011
+00000000000010110010
+00000000000010100001
+00000000000010100011
+00000000000010000011
+00000000000010010011
+00000000000010000011
+00000000000010100001
+00000000000010100001
+00000000000010100011
+00000000000010100011
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010010011
+00000000000010110011
+00000000000010100011
+00000000000010100001
+00000000000010100011
+00000000000010000011
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010110010
+00000000000010100001
+00000000000010100001
+00000000000010110001
+00000000000010100011
+00000000000010000011
+00000000000010110001
+00000000000010100011
+00000000000010000001
+00000000000010100011
+00000000000010100001
+00000000000010000011
+00000000000010110011
+00000000000010000011
+00000000000010100011
+00000000000010110001
+00000000000010100011
+00000000000010000001
+00000000000010100001
+00000000000010110011
+00000000000010100001
+00000000000010000011
+00000000000010000011
+00000000000010110000
+00000000000010100001
+00000000000011100001
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010110001
+00000000000010100011
+00000000000010000001
+00000000000010000001
+00000000000010100011
+00000000000010000001
+00000000000010110011
+00000000000010100001
+00000000000010000001
+00000000000010000001
+00000000000010000001
+00000000000010010001
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010000001
+00000000000010100001
+00000000000010110011
+00000000000010100011
+00000000000010000001
+00000000000010000011
+00000000000010100011
+00000000000010110011
+00000000000010000001
+00000000000010110001
+00000000000010010001
+00000000000010010010
+00000000000010110011
+00000000000010000011
+00000000000010100011
+00000000000010100001
+00000000000010110011
+00000000000010100011
+00000000000010100001
+00000000000010100011
+00000000000010100011
+00000000000010110001
+00000000000010110011
+00000000000010000001
+00000000000010000011
+00000000000010100011
+00000000000010000001
+00000000000010000001
+00000000000010100001
+00000000000011110011
+00000000000010100001
+00000000000010000011
+00000000000010110011
+00000000000010100011
+00000000000010000001
+00000000000010100011
+00000000000010010011
+00000000000010110001
+00000000000010110011
+00000000000010110001
+00000000000010100001
+00000000000010010001
+00000000000010100011
+00000000000010010011
+00000000000010110011
+00000000000010110011
+00000000000010110001
+00000000000010110011
+00000000000010000001
+00000000000010000001
+00000000000010100011
+00000000000010110011
+00000000000010110001
+00000000000010110011
+00000000000010110011
+00000000000010100001
+00000000000010110011
+00000000000010100011
+00000000000010110001
+00000000000010000001
+00000000000010000001
+00000000000010000001
+00000000000010100011
+00000000000010110001
+00000000000010110011
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010000001
+00000000000010100011
+00000000000010000011
+00000000000010110010
+00000000000010110011
+00000000000010000001
+00000000000010100001
+00000000000010010010
+00000000000010000001
+00000000000010100011
+00000000000010100011
+00000000000010100001
+00000000000010100011
+00000000000010110001
+00000000000010110011
+00000000000010100011
+00000000000010100001
+00000000000010100011
+00000000000010100011
+00000000000010110011
+00000000000010010010
+00000000000010100001
+00000000000010000001
+00000000000010110001
+00000000000010110001
+00000000000010110011
+00000000000010100001
+00000000000010100011
+00000000000010010011
+00000000000010100011
+00000000000010100001
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00000000000010010011
+00000000000010100011
+00000000000010000011
+00000000000010100001
+00000000000010100011
+00000000000010110001
+00000000000010110011
+00000000000010000011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010110010
+00000000000010010011
+00000000000010000001
+00000000000010000001
+00000000000010000011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010100001
+00000000000010010011
+00000000000010100011
+00000000000010100011
+00000000000010110011
+00000000000011100001
+00000000000010100001
+00000000000010000011
+00000000000010000001
+00000000000010100001
+00000000000010110001
+00000000000010100011
+00000000000010000011
+00000000000010000001
+00000000000010110001
+00000000000010100011
+00000000000010000011
+00000000000010110011
+00000000000010100011
+00000000000010000011
+00000000000010100001
+00000000000010000001
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010010010
+00000000000010100011
+00000000000010000001
+00000000000010000001
+00000000000010100001
+00000000000010000011
+00000000000010100011
+00000000000010110000
+00000000000010100011
+00000000000010100011
+00000000000010110001
+00000000000010110001
+00000000000010000001
+00000000000010110011
+00000000000010100011
+00000000000010100001
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010010011
+00000000000010110001
+00000000000010110011
+00000000000010000001
+00000000000010010001
+00000000000010110011
+00000000000010110001
+00000000000010110011
+00000000000010010010
+00000000000010000001
+00000000000010100011
+00000000000010110011
+00000000000010010001
+00000000000010100011
+00000000000010100011
+00000000000010010010
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00000000000010000001
+00000000000010110000
+00000000000010110001
+00000000000010000011
+00000000000010110011
+00000000000010110001
+00000000000010110011
+00000000000010010011
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010000001
+00000000000010000011
+00000000000010110011
+00000000000010110011
+00000000000010100001
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000010000011
+00000000000010110010
+00000000000010000011
+00000000000010000001
+00000000000010110000
+00000000000010010010
+00000000000010010001
+00000000000010100001
+00000000000010000011
+00000000000010110011
+00000000000010100011
+00000000000010010010
+00000000000010010011
+00000000000010100011
+00000000000011100001
+00000000000010000001
+00000000000010110011
+00000000000010100011
+00000000000010110001
+00000000000010100001
+00000000000010010010
+00000000000010000011
+00000000000010110011
+00000000000010000011
+00000000000010010011
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010010011
+00000000000010000001
+00000000000010100001
+00000000000010110011
+00000000000010010001
+Completed generation 153 in 413.86847 seconds
diff --git a/ga-logs/gen-177.post.txt b/ga-logs/gen-177.post.txt
new file mode 100644
index 0000000..5ec4c47
--- /dev/null
+++ b/ga-logs/gen-177.post.txt
@@ -0,0 +1,1615 @@
+00000000000010110011
+00000000000010110001
+00000000000010100011
+00000000000010110001
+00000000000010010010
+00000000000010100001
+00000000000010010010
+00000000000010100011
+00000000000010100011
+00000000000010010010
+00000000000010100001
+00000000000010110010
+00000000000010100011
+00000000000010110001
+00000000000011100001
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000010100011
+00000000000010010001
+00000000000010110011
+00000000000010110011
+00000000000010010001
+00000000000010100001
+00000000000011100011
+00000000000010110011
+00000000000010110001
+00000000000010110011
+00000000000010110001
+00000000000010010011
+00000000000010110011
+00000000000011100011
+00000000000010110011
+00000000000010110001
+00000000000010100001
+00000000000010110011
+00000000000010110011
+00000000000010100001
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010110001
+00000000000010010010
+00000000000010110011
+00000000000010110001
+00000000000010110001
+00000000000010010001
+00000000000010100011
+00000000000010110001
+00000000000010110011
+00000000000010110011
+00000000000010110001
+00000000000010100010
+00000000000010100011
+00000000000010110010
+00000000000010110011
+00000000000010100011
+00000000000010110001
+00000000000010110011
+00000000000011100001
+00000000000010100011
+00000000000010100011
+00000000000010110011
+00000000000010110001
+00000000000010110011
+00000000000010110011
+00000000000010110010
+00000000000010110011
+00000000000010110010
+00000000000010100011
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000011100001
+00000000000010100001
+00000000000010100011
+00000000000010110011
+00000000000010110001
+00000000000010110001
+00000000000010110010
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010110001
+00000000000010010001
+00000000000010110001
+00000000000010110011
+00000000000010110011
+00000000000010000001
+00000000000010000001
+00000000000010110011
+00000000000010110001
+00000000000010110010
+00000000000011100001
+00000000000010110001
+00000000000010110001
+00000000000010100001
+00000000000010110001
+00000000000010110001
+00000000000010110010
+00000000000010110001
+00000000000010110011
+00000000000010110001
+00000000000010100001
+00000000000010000011
+00000000000010110011
+00000000000010110011
+00000000000011100010
+00000000000010110011
+00000000000011100011
+00000000000010110001
+00000000000010010001
+00000000000010110001
+00000000000010110001
+00000000000010110011
+00000000000010100001
+00000000000010000001
+00000000000011110001
+00000000000010110011
+00000000000010110001
+00000000000010100011
+00000000000010100011
+00000000000010100010
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010110010
+00000000000011100011
+00000000000010100011
+00000000000010100011
+00000000000010100011
+00000000000010110011
+00000000000010010011
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010110001
+00000000000010010001
+00000000000010110001
+00000000000010110001
+00000000000010110001
+00000000000010110001
+00000000000010110011
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010110001
+00000000000010110011
+00000000000010100011
+00000000000010010001
+00000000000011110011
+00000000000010100001
+00000000000010110001
+00000000000010110001
+00000000000010100011
+00000000000010100011
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000011110001
+00000000000010100001
+00000000000010110011
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010000001
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010100001
+00000000000010110011
+00000000000010100011
+00000000000010100001
+00000000000010110001
+00000000000011110001
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010100010
+00000000000011100001
+00000000000010010001
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00000000000010110001
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00000000000010010001
+00000000000010110011
+00000000000010100010
+00000000000010110011
+00000000000011100011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010000001
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010010001
+00000000000010100011
+00000000000010110011
+00000000000010110010
+00000000000010100011
+00000000000010110011
+00000000000010110010
+00000000000010110011
+00000000000010100001
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010000001
+00000000000010010011
+00000000000010100011
+00000000000010110011
+00000000000010110001
+00000000000010110001
+00000000000010110011
+00000000000010110011
+00000000000011110001
+00000000000010010001
+00000000000010010001
+00000000000010110001
+00000000000010100001
+00000000000010100011
+00000000000010110011
+00000000000010110001
+00000000000010100011
+00000000000010100011
+00000000000011110011
+00000000000010100011
+00000000000010100010
+00000000000010100011
+00000000000010110010
+00000000000010110001
+00000000000010110011
+00000000000011100001
+00000000000010110011
+00000000000010110001
+00000000000010110001
+00000000000010010010
+00000000000010110001
+00000000000010110011
+00000000000010110001
+00000000000010110011
+00000000000010100011
+00000000000010100011
+00000000000010100011
+00000000000010110001
+00000000000010100011
+00000000000010100011
+00000000000010110001
+00000000000010110001
+00000000000010100001
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010110001
+00000000000010110001
+00000000000010010010
+00000000000010110011
+00000000000010110011
+00000000000011100001
+00000000000011100011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010000001
+00000000000010110011
+00000000000010000001
+00000000000010110011
+00000000000010110011
+00000000000011100011
+00000000000010110011
+00000000000010010011
+00000000000010110011
+00000000000010110001
+00000000000011100011
+00000000000010110001
+00000000000010000001
+00000000000010110011
+00000000000011110011
+00000000000010010001
+00000000000010100011
+00000000000010010011
+00000000000011100011
+00000000000010010011
+00000000000010100011
+00000000000010100011
+00000000000011100000
+00000000000010110011
+00000000000011100011
+00000000000010100001
+00000000000010110001
+00000000000010110001
+00000000000010010010
+00000000000010100011
+00000000000010000001
+00000000000010110011
+00000000000010100001
+00000000000010110010
+00000000000010110010
+00000000000010010011
+00000000000011100001
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010100001
+00000000000010100011
+00000000000010110010
+00000000000010110011
+00000000000010110011
+00000000000011100001
+00000000000010110011
+00000000000010100011
+00000000000010000001
+00000000000010110011
+00000000000010100010
+00000000000011100011
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000010010001
+00000000000010110011
+00000000000010110011
+00000000000010000001
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00000000000010110001
+00000000000011100001
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000011100001
+00000000000010110011
+00000000000010110001
+00000000000010110011
+00000000000010100011
+00000000000010110001
+00000000000010010010
+00000000000010110010
+00000000000010110011
+00000000000010100011
+00000000000010100011
+00000000000010100011
+00000000000010110001
+00000000000010110001
+00000000000010100011
+00000000000010110001
+00000000000010110011
+00000000000010110011
+00000000000010100001
+00000000000010110011
+00000000000010110001
+00000000000010000001
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010010011
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010010011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010100010
+00000000000010110001
+00000000000010110010
+00000000000010110011
+00000000000010100011
+00000000000011100010
+After selection:
+
+
+00000000000010110011
+00000000000010110001
+00000000000010100011
+00000000000010110001
+00000000000010010010
+00000000000010100001
+00000000000010010010
+00000000000010100011
+00000000000010100011
+00000000000010010010
+00000000000010100001
+00000000000010110010
+00000000000010100011
+00000000000010110001
+00000000000011100001
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000010100011
+00000000000010010001
+00000000000010110011
+00000000000010110011
+00000000000010010001
+00000000000010100001
+00000000000011100011
+00000000000010110011
+00000000000010110001
+00000000000010110011
+00000000000010110001
+00000000000010010011
+00000000000010110011
+00000000000011100011
+00000000000010110011
+00000000000010110001
+00000000000010100001
+00000000000010110011
+00000000000010110011
+00000000000010100001
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010110001
+00000000000010010010
+00000000000010110011
+00000000000010110001
+00000000000010110001
+00000000000010010001
+00000000000010100011
+00000000000010110001
+00000000000010110011
+00000000000010110011
+00000000000010110001
+00000000000010100010
+00000000000010100011
+00000000000010110010
+00000000000010110011
+00000000000010100011
+00000000000010110001
+00000000000010110011
+00000000000011100001
+00000000000010100011
+00000000000010100011
+00000000000010110011
+00000000000010110001
+00000000000010110011
+00000000000010110011
+00000000000010110010
+00000000000010110011
+00000000000010110010
+00000000000010100011
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000011100001
+00000000000010100001
+00000000000010100011
+00000000000010110011
+00000000000010110001
+00000000000010110001
+00000000000010110010
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010110001
+00000000000010010001
+00000000000010110001
+00000000000010110011
+00000000000010110011
+00000000000010000001
+00000000000010000001
+00000000000010110011
+00000000000010110001
+00000000000010110010
+00000000000011100001
+00000000000010110001
+00000000000010110001
+00000000000010100001
+00000000000010110001
+00000000000010110001
+00000000000010110010
+00000000000010110001
+00000000000010110011
+00000000000010110001
+00000000000010100001
+00000000000010000011
+00000000000010110011
+00000000000010110011
+00000000000011100010
+00000000000010110011
+00000000000011100011
+00000000000010110001
+00000000000010010001
+00000000000010110001
+00000000000010110001
+00000000000010110011
+00000000000010100001
+00000000000010000001
+00000000000011110001
+00000000000010110011
+00000000000010110001
+00000000000010100011
+00000000000010100011
+00000000000010100010
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010110010
+00000000000011100011
+00000000000010100011
+00000000000010100011
+00000000000010100011
+00000000000010110011
+00000000000010010011
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010110001
+00000000000010010001
+00000000000010110001
+00000000000010110001
+00000000000010110001
+00000000000010110001
+00000000000010110011
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010110001
+00000000000010110011
+00000000000010100011
+00000000000010010001
+00000000000011110011
+00000000000010100001
+00000000000010110001
+00000000000010110001
+00000000000010100011
+00000000000010100011
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000011110001
+00000000000010100001
+00000000000010110011
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010000001
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010100001
+00000000000010110011
+00000000000010100011
+00000000000010100001
+00000000000010110001
+00000000000011110001
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010100010
+00000000000011100001
+00000000000010010001
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00000000000010110001
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00000000000010010001
+00000000000010110011
+00000000000010100010
+00000000000010110011
+00000000000011100011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010000001
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010010001
+00000000000010100011
+00000000000010110011
+00000000000010110010
+00000000000010100011
+00000000000010110011
+00000000000010110010
+00000000000010110011
+00000000000010100001
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010000001
+00000000000010010011
+00000000000010100011
+00000000000010110011
+00000000000010110001
+00000000000010110001
+00000000000010110011
+00000000000010110011
+00000000000011110001
+00000000000010010001
+00000000000010010001
+00000000000010110001
+00000000000010100001
+00000000000010100011
+00000000000010110011
+00000000000010110001
+00000000000010100011
+00000000000010100011
+00000000000011110011
+00000000000010100011
+00000000000010100010
+00000000000010100011
+00000000000010110010
+00000000000010110001
+00000000000010110011
+00000000000011100001
+00000000000010110011
+00000000000010110001
+00000000000010110001
+00000000000010010010
+00000000000010110001
+00000000000010110011
+00000000000010110001
+00000000000010110011
+00000000000010100011
+00000000000010100011
+00000000000010100011
+00000000000010110001
+00000000000010100011
+00000000000010100011
+00000000000010110001
+00000000000010110001
+00000000000010100001
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010110001
+00000000000010110001
+00000000000010010010
+00000000000010110011
+00000000000010110011
+00000000000011100001
+00000000000011100011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010000001
+00000000000010110011
+00000000000010000001
+00000000000010110011
+00000000000010110011
+00000000000011100011
+00000000000010110011
+00000000000010010011
+00000000000010110011
+00000000000010110001
+00000000000011100011
+00000000000010110001
+00000000000010000001
+00000000000010110011
+00000000000011110011
+00000000000010010001
+00000000000010100011
+00000000000010010011
+00000000000011100011
+00000000000010010011
+00000000000010100011
+00000000000010100011
+00000000000011100000
+00000000000010110011
+00000000000011100011
+00000000000010100001
+00000000000010110001
+00000000000010110001
+00000000000010010010
+00000000000010100011
+00000000000010000001
+00000000000010110011
+00000000000010100001
+00000000000010110010
+00000000000010110010
+00000000000010010011
+00000000000011100001
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010100001
+00000000000010100011
+00000000000010110010
+00000000000010110011
+00000000000010110011
+00000000000011100001
+00000000000010110011
+00000000000010100011
+00000000000010000001
+00000000000010110011
+00000000000010100010
+00000000000011100011
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000010010001
+00000000000010110011
+00000000000010110011
+00000000000010000001
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00000000000010110001
+00000000000011100001
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000011100001
+00000000000010110011
+00000000000010110001
+00000000000010110011
+00000000000010100011
+00000000000010110001
+00000000000010010010
+00000000000010110010
+00000000000010110011
+00000000000010100011
+00000000000010100011
+00000000000010100011
+00000000000010110001
+00000000000010110001
+00000000000010100011
+00000000000010110001
+00000000000010110011
+00000000000010110011
+00000000000010100001
+00000000000010110011
+00000000000010110001
+00000000000010000001
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010010011
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010010011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010100010
+00000000000010110001
+00000000000010110010
+00000000000010110011
+00000000000010100011
+00000000000011100010
+
+
+
+After crossover:
+
+
+00000000000010100011
+00000000000010100011
+00000000000010100011
+00000000000010110001
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00000000000011100001
+00000000000010010001
+00000000000011100011
+00000000000011100011
+00000000000011110001
+00000000000010100011
+00000000000010110001
+00000000000010000001
+00000000000010110001
+00000000000010110011
+00000000000010110001
+00000000000010110001
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00000000000010000001
+00000000000010110001
+00000000000010110001
+00000000000010110001
+00000000000010110011
+00000000000010110001
+00000000000010010001
+00000000000010110011
+00000000000010100011
+00000000000010110001
+00000000000010110011
+00000000000010100010
+00000000000010110001
+00000000000010110010
+00000000000010100011
+00000000000010110011
+00000000000010110001
+00000000000010100011
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000011100011
+00000000000010110001
+00000000000010100011
+00000000000011100011
+00000000000010100001
+00000000000010110001
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010010011
+00000000000010110001
+00000000000010110011
+00000000000010110011
+00000000000010110001
+00000000000011100001
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00000000000010110010
+00000000000011100001
+00000000000010110011
+00000000000011100011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010010011
+00000000000010000001
+00000000000010110001
+00000000000010100011
+00000000000010010010
+00000000000010110011
+00000000000010110001
+00000000000010110011
+00000000000010110011
+00000000000010010001
+00000000000010100011
+00000000000010100010
+00000000000010110011
+00000000000010100011
+00000000000010100011
+00000000000011110001
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00000000000010010001
+00000000000010110011
+00000000000010010011
+00000000000010100001
+00000000000010110001
+00000000000010010010
+00000000000011110001
+00000000000010110011
+00000000000010110001
+00000000000010110011
+00000000000010100011
+00000000000011100001
+00000000000010110001
+00000000000011100001
+00000000000010110011
+00000000000010010001
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010100010
+00000000000011100011
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000011100001
+00000000000010000001
+00000000000010000001
+00000000000010100010
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00000000000010110001
+00000000000010110011
+00000000000010110011
+00000000000010100001
+00000000000010100011
+00000000000010010001
+00000000000010100001
+00000000000010100001
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00000000000011110001
+00000000000010110011
+00000000000010100001
+00000000000010110011
+00000000000010100001
+00000000000010110010
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010110001
+00000000000010110011
+00000000000010000001
+00000000000010110011
+00000000000010100001
+00000000000010100011
+00000000000010110011
+00000000000010000001
+00000000000010110011
+00000000000010110011
+00000000000010100001
+00000000000010110010
+00000000000010110011
+00000000000010110011
+00000000000010110001
+00000000000010110001
+00000000000010110011
+00000000000010000001
+00000000000010110001
+00000000000010110001
+00000000000010010001
+00000000000010100011
+00000000000010100001
+00000000000010110011
+00000000000010110011
+00000000000010110010
+00000000000010000001
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010110001
+00000000000010100011
+00000000000010100001
+00000000000010100011
+00000000000010100011
+00000000000011100011
+00000000000010110011
+00000000000010110011
+00000000000010100001
+00000000000010100011
+00000000000010110011
+00000000000010010011
+00000000000010110010
+00000000000010110011
+00000000000010100011
+00000000000010110001
+00000000000010100011
+00000000000010110010
+00000000000010110011
+00000000000010100010
+00000000000010110011
+00000000000010110011
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000010110001
+00000000000010110001
+00000000000011110011
+00000000000010100011
+00000000000010110011
+00000000000010100001
+00000000000010110011
+00000000000010100010
+00000000000010100011
+00000000000010100011
+00000000000010100011
+00000000000010110011
+00000000000010110001
+00000000000010100001
+00000000000010110001
+00000000000010010001
+00000000000010110011
+00000000000010100011
+00000000000010110010
+00000000000010010001
+00000000000010110001
+00000000000010110001
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00000000000010100001
+00000000000010110011
+00000000000010100010
+00000000000010010001
+00000000000010010001
+00000000000010100001
+00000000000011110011
+00000000000010100011
+00000000000010000001
+00000000000011100011
+00000000000010110011
+00000000000010100011
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010110010
+00000000000010100011
+00000000000010110001
+00000000000010110011
+00000000000010110001
+00000000000010110011
+00000000000010100011
+00000000000010100011
+00000000000010110010
+00000000000010010001
+00000000000010110011
+00000000000010110010
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010010011
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010110001
+00000000000010110011
+00000000000010100011
+00000000000010100011
+00000000000010110011
+00000000000010110010
+00000000000010110001
+00000000000010110001
+00000000000010110011
+00000000000010100011
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00000000000010010001
+00000000000010110001
+00000000000010110001
+00000000000010000001
+00000000000010100001
+00000000000010000001
+00000000000010100011
+00000000000010100011
+00000000000010110011
+00000000000011100011
+00000000000010110001
+00000000000010110011
+00000000000011100010
+00000000000010010010
+00000000000010100001
+00000000000010110001
+00000000000010110011
+00000000000010110010
+00000000000010110011
+00000000000010110001
+00000000000010100011
+00000000000011100010
+00000000000010010010
+00000000000010110001
+00000000000010110011
+00000000000010110001
+00000000000010010011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010110001
+00000000000010110001
+00000000000010010010
+00000000000011100001
+00000000000011100011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000011100000
+00000000000010110001
+00000000000010100011
+00000000000010010011
+00000000000010110011
+00000000000010110011
+00000000000010110001
+00000000000010110001
+00000000000010100011
+00000000000010010011
+00000000000010110001
+00000000000010110011
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000011100011
+00000000000010000001
+00000000000010100011
+00000000000011100001
+00000000000010110010
+00000000000010110001
+00000000000010110001
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010010011
+00000000000010100011
+00000000000011110011
+00000000000010100001
+00000000000010110001
+00000000000010110011
+00000000000010100001
+00000000000010010010
+00000000000010100011
+00000000000010100011
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00000000000010000001
+00000000000010110001
+00000000000010110010
+00000000000010110010
+00000000000010110011
+00000000000010100011
+00000000000010110001
+00000000000010110001
+00000000000010100011
+00000000000010010010
+00000000000011100011
+00000000000010100011
+00000000000010010001
+00000000000010110001
+00000000000010110011
+00000000000010110001
+00000000000010110001
+00000000000010100001
+00000000000010010011
+00000000000010110001
+00000000000010110001
+00000000000010100011
+00000000000010110001
+00000000000010110011
+00000000000011100001
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000011110011
+00000000000010110010
+00000000000010110011
+
+
+
+After mutation:
+
+
+00000000000010111011
+01000100000010110110
+00000000000011110011
+00000000000010110010
+00000000010010110011
+01000100000010100011
+00000000000111100001
+00000000010010110011
+00100000001010110001
+00000000000010100011
+00000000000010110000
+00000000000010110001
+01000000000111010011
+00000000000010110001
+00000000000010110001
+00000000000010110001
+00000001000010110011
+00000000000010110001
+00000000000010110001
+00000000000011100011
+00000000001011100011
+01000010000010010010
+00000000000010100011
+00000000001010110001
+00000000000010110000
+00000000000000100011
+00000000000010110011
+00001000000010110010
+00000000000010010010
+00000000000000110001
+00000001000010000001
+10000000000010100011
+00001000000010100011
+00000000000010110011
+00000010000010110001
+01000000000010100011
+00000000000010100011
+00100100000010100011
+00000000000010010000
+00000000000000100001
+00000000000010110010
+00000000000010110000
+00000000000010110001
+00000000001011110011
+00000000000010100011
+00000000100010010011
+00000000000010110011
+00000000000010110011
+00000000000010100001
+00000000010010110010
+00000001000010110001
+00001000000010110001
+00100000000010110010
+00000000000011100001
+00000000000010100111
+00000000000010000011
+00000000000011100011
+00000000000010100011
+00000000000010110011
+00000000000011100011
+00000000000110110001
+00000000000110110011
+00000000000010110001
+00000000000010010011
+00000000000010100011
+00000000000010110001
+00000000000010110001
+00000000000010110011
+00000000000010111011
+00000000000010010011
+10000000000010110011
+00000000000010110001
+00000100000011100000
+00000010000000110000
+00000000000010110011
+00000000000010111011
+00000000000011110011
+00000000000010110011
+01000100100010110011
+00000000000010110011
+00000000000011100010
+00000000000011100001
+00000000100010010110
+00000100000010110001
+00000000000010110001
+00000000001010110011
+00000000000010111011
+00100000000010110011
+00000000000010010011
+00000000000010110001
+00000000000010110011
+10000000000010010001
+01000000000010010010
+00000000000011101010
+00000001000010100011
+00000100000010110001
+00000000000010110011
+00000000010010110010
+00000000000010110011
+00000000000010110001
+00000000000010100001
+01000000110010010010
+00110010000011100010
+00000000000010110011
+00000100000011110001
+00000000100011100111
+00000000001011111011
+00010000000010100011
+01000000000010100011
+00000000000010000001
+00000000100010100001
+01000000000010000001
+00000000000010110001
+00000000000010100001
+00001100000010010001
+00100000000010100111
+00010000000010100011
+00000000000010110001
+00000000000010110011
+00000000000000100011
+00000100000011100011
+00000000001010110011
+01000000000010110001
+00000000000010110001
+00000101000010111010
+00000000001010110011
+00010010010010101010
+00000000000010100011
+00000000001010110011
+00000000000010111101
+00000001000010110011
+00000000000010100011
+00010000000010010011
+00000000000010110011
+00000000000010010011
+00000000000010110011
+00000000000010100011
+00010000000010110001
+00000000000110110010
+10000000000010110011
+00000000000010000001
+00000000000010110010
+00000000000010100010
+00000000001010000011
+00000000000010110011
+00000000000010110001
+00000000000010110011
+01000000000010100001
+10000000000010100011
+01000000010010110010
+00000100000010110011
+10000000000010110011
+00000000100010100011
+00000100000010100011
+00001000000010110011
+00000000000011100011
+00000000000011000001
+00000000000010100011
+00010000000011110011
+00000000000010100001
+00000000000010010001
+01000000000010000001
+00000000000010100010
+00000000000010110001
+00000000000010100001
+00000000000010100011
+10000000000010110011
+00000000000010110011
+00010000000010000011
+10100000000010110001
+00000000001010110001
+00000000000010110001
+00000000000010010001
+00000000000010110010
+00000000000010100011
+00000100000010110011
+00000000000010010001
+00010000000110110001
+00000000000010100001
+00000000000010100001
+00000000000010110111
+00000001000010100011
+00000000000010000011
+00000000000010100010
+00000000000011100010
+00000000100010110011
+10000000001010100001
+00000000000010110011
+00000000000010101111
+00000000000001110010
+00000000000010110001
+00000000000010110011
+00000000000010101011
+10000000000010010011
+00100000001010100011
+00000001000010110001
+00000000000010110011
+00000000010010110111
+00000000000010100010
+00000000000010110011
+00000000000000110010
+00000000000010001011
+00000000000010110001
+00000000000010100011
+10000000000010110011
+10000000000010110010
+00000000001010110011
+00000000010010110011
+00000000000010100011
+00001000100010100011
+00000000000010110011
+00000000000010110011
+00000000000011100011
+00000000000010000011
+00000000000010100010
+01000101000110100001
+00000000000010100011
+00000000000010010001
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00001000000010000000
+00000000000010110010
+00000000000110110011
+00000000000000100011
+00001000000010100001
+00000000000010000011
+00100000000010000001
+00000100001010010001
+00000000000010110001
+00000000000010000000
+00000000001010110011
+00000001000010110001
+00100000000010110000
+00000000000010110011
+00000000000010110011
+00000000000010110010
+00000000001010100000
+00000000000010110010
+00000000000010110011
+00000000000010000001
+00000000000010110011
+00000000000010110011
+00000000001010100001
+00010000000011110011
+00000000000010000001
+00100000000010110101
+00001001000010110001
+00000000000010110011
+00000000000010100011
+00001010000000110001
+00000000000011010010
+00000001000010100001
+00000000000010110011
+00000000000010100001
+00000000010010010011
+00000000000011110001
+00000000000010100011
+00000000000010111011
+00000001000010110011
+10010000000010110001
+00010000000010100001
+00000000011010000001
+00000000000010010000
+10100000000010000011
+00000000001010100000
+00000000100010110011
+00000000000010010001
+00000010000010110001
+00000000000010100011
+00001000111010110011
+00000000000010110011
+00100000000010110011
+00000000000100110011
+01101000000010100011
+00000000000010100010
+00000010000010010001
+01000000100010100001
+00000000000011100001
+00000000000010110011
+00010000000010010011
+00000000000010111001
+00000000010000100011
+00000000000011100111
+00000000000010100010
+00000100000010100011
+00000000001001110011
+00000000110010110011
+00010000000010010001
+00000000000010110011
+00000000000011100001
+00010000001010110001
+00010000000011110001
+00010000000010100011
+00000000001010110011
+00000000000010110001
+00100010000010110011
+00000000000011110101
+00000000010010010010
+00000000000010100001
+00000000000010100001
+00000000000010010010
+10000000000110110011
+00000000000011000001
+00000000000000100011
+00000000000010110011
+00000000000110110011
+00000000000110110011
+00100000000010110011
+00000000000011110001
+00000000000010100011
+00000000000010100011
+00000010001010110011
+00010000000010100010
+00100000000010100011
+00000100000110010001
+00000010001010010011
+00000000000010110011
+00100000000010110001
+00000000000010110011
+10000000010010010010
+00000001000010100010
+01000011000010110001
+00001100001010000001
+00000000000010010011
+00000000100110110011
+00000000000010100011
+00000000000010110001
+00000000000010100011
+01000000000000110011
+00000000000010110011
+00010000000010110011
+00000000000011100011
+00000000000010110011
+10001000000011100001
+00001000000010110010
+00000000000010100011
+00000000010010110011
+00000000000010110011
+01000000000010110001
+00001000000011100001
+10000000000010110001
+00000000000010110011
+00000000000010110001
+00000000000010110001
+01000000000010010011
+00000000000010110011
+00000000000010110011
+00000000000000110011
+00000000000010110011
+00000000010010100001
+00000100000011110011
+00000000000010100011
+11000000000010110001
+00000000000011100011
+10000000000010100011
+00000000000010110010
+00000000000010100011
+00000000000000110001
+00000000000010100011
+01001000000010110001
+00100010010010100011
+00000000000000100011
+00010000000010110010
+00000000000010110001
+00000000000011100010
+00000001000110110011
+00000000100010110001
+00000000100010100011
+00000000000010110011
+00000000000010011001
+00000000000010110001
+00000000000010110011
+00000000000010110001
+00000001000010100001
+00010000000010110001
+00000000100010000001
+00000000000010100011
+00000000000010111011
+00000000000010110011
+00000000000010110011
+00000000000110110001
+00000000000010110001
+00000000000010110011
+00000000000010110001
+00000000100010000001
+00000000000010110001
+10000100010010100011
+00000000000011110001
+00000000000011100011
+00000000001011101011
+00000010000010010001
+00100001000011100001
+00000000000010000011
+00000000000010110011
+00000000000010110011
+00000001000011110001
+00001000000010100011
+00000000000010100011
+00000000100010100011
diff --git a/ga-logs/gen-177.txt b/ga-logs/gen-177.txt
new file mode 100644
index 0000000..bb86ccb
--- /dev/null
+++ b/ga-logs/gen-177.txt
@@ -0,0 +1,400 @@
+00000000000010110011
+00000000000010110001
+00000000000010100011
+00000000000010110001
+00000000000010010010
+00000000000010100001
+00000000000010010010
+00000000000010100011
+00000000000010100011
+00000000000010010010
+00000000000010100001
+00000000000010110010
+00000000000010100011
+00000000000010110001
+00000000000011100001
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000010100011
+00000000000010010001
+00000000000010110011
+00000000000010110011
+00000000000010010001
+00000000000010100001
+00000000000011100011
+00000000000010110011
+00000000000010110001
+00000000000010110011
+00000000000010110001
+00000000000010010011
+00000000000010110011
+00000000000011100011
+00000000000010110011
+00000000000010110001
+00000000000010100001
+00000000000010110011
+00000000000010110011
+00000000000010100001
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010110001
+00000000000010010010
+00000000000010110011
+00000000000010110001
+00000000000010110001
+00000000000010010001
+00000000000010100011
+00000000000010110001
+00000000000010110011
+00000000000010110011
+00000000000010110001
+00000000000010100010
+00000000000010100011
+00000000000010110010
+00000000000010110011
+00000000000010100011
+00000000000010110001
+00000000000010110011
+00000000000011100001
+00000000000010100011
+00000000000010100011
+00000000000010110011
+00000000000010110001
+00000000000010110011
+00000000000010110011
+00000000000010110010
+00000000000010110011
+00000000000010110010
+00000000000010100011
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000011100001
+00000000000010100001
+00000000000010100011
+00000000000010110011
+00000000000010110001
+00000000000010110001
+00000000000010110010
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010110001
+00000000000010010001
+00000000000010110001
+00000000000010110011
+00000000000010110011
+00000000000010000001
+00000000000010000001
+00000000000010110011
+00000000000010110001
+00000000000010110010
+00000000000011100001
+00000000000010110001
+00000000000010110001
+00000000000010100001
+00000000000010110001
+00000000000010110001
+00000000000010110010
+00000000000010110001
+00000000000010110011
+00000000000010110001
+00000000000010100001
+00000000000010000011
+00000000000010110011
+00000000000010110011
+00000000000011100010
+00000000000010110011
+00000000000011100011
+00000000000010110001
+00000000000010010001
+00000000000010110001
+00000000000010110001
+00000000000010110011
+00000000000010100001
+00000000000010000001
+00000000000011110001
+00000000000010110011
+00000000000010110001
+00000000000010100011
+00000000000010100011
+00000000000010100010
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010110010
+00000000000011100011
+00000000000010100011
+00000000000010100011
+00000000000010100011
+00000000000010110011
+00000000000010010011
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010110001
+00000000000010010001
+00000000000010110001
+00000000000010110001
+00000000000010110001
+00000000000010110001
+00000000000010110011
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010110001
+00000000000010110011
+00000000000010100011
+00000000000010010001
+00000000000011110011
+00000000000010100001
+00000000000010110001
+00000000000010110001
+00000000000010100011
+00000000000010100011
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000011110001
+00000000000010100001
+00000000000010110011
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010000001
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010100001
+00000000000010110011
+00000000000010100011
+00000000000010100001
+00000000000010110001
+00000000000011110001
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010100010
+00000000000011100001
+00000000000010010001
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00000000000010110001
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00000000000010010001
+00000000000010110011
+00000000000010100010
+00000000000010110011
+00000000000011100011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010000001
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010010001
+00000000000010100011
+00000000000010110011
+00000000000010110010
+00000000000010100011
+00000000000010110011
+00000000000010110010
+00000000000010110011
+00000000000010100001
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010000001
+00000000000010010011
+00000000000010100011
+00000000000010110011
+00000000000010110001
+00000000000010110001
+00000000000010110011
+00000000000010110011
+00000000000011110001
+00000000000010010001
+00000000000010010001
+00000000000010110001
+00000000000010100001
+00000000000010100011
+00000000000010110011
+00000000000010110001
+00000000000010100011
+00000000000010100011
+00000000000011110011
+00000000000010100011
+00000000000010100010
+00000000000010100011
+00000000000010110010
+00000000000010110001
+00000000000010110011
+00000000000011100001
+00000000000010110011
+00000000000010110001
+00000000000010110001
+00000000000010010010
+00000000000010110001
+00000000000010110011
+00000000000010110001
+00000000000010110011
+00000000000010100011
+00000000000010100011
+00000000000010100011
+00000000000010110001
+00000000000010100011
+00000000000010100011
+00000000000010110001
+00000000000010110001
+00000000000010100001
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010110001
+00000000000010110001
+00000000000010010010
+00000000000010110011
+00000000000010110011
+00000000000011100001
+00000000000011100011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010000001
+00000000000010110011
+00000000000010000001
+00000000000010110011
+00000000000010110011
+00000000000011100011
+00000000000010110011
+00000000000010010011
+00000000000010110011
+00000000000010110001
+00000000000011100011
+00000000000010110001
+00000000000010000001
+00000000000010110011
+00000000000011110011
+00000000000010010001
+00000000000010100011
+00000000000010010011
+00000000000011100011
+00000000000010010011
+00000000000010100011
+00000000000010100011
+00000000000011100000
+00000000000010110011
+00000000000011100011
+00000000000010100001
+00000000000010110001
+00000000000010110001
+00000000000010010010
+00000000000010100011
+00000000000010000001
+00000000000010110011
+00000000000010100001
+00000000000010110010
+00000000000010110010
+00000000000010010011
+00000000000011100001
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010100001
+00000000000010100011
+00000000000010110010
+00000000000010110011
+00000000000010110011
+00000000000011100001
+00000000000010110011
+00000000000010100011
+00000000000010000001
+00000000000010110011
+00000000000010100010
+00000000000011100011
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000010010001
+00000000000010110011
+00000000000010110011
+00000000000010000001
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00000000000010110001
+00000000000011100001
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000011100001
+00000000000010110011
+00000000000010110001
+00000000000010110011
+00000000000010100011
+00000000000010110001
+00000000000010010010
+00000000000010110010
+00000000000010110011
+00000000000010100011
+00000000000010100011
+00000000000010100011
+00000000000010110001
+00000000000010110001
+00000000000010100011
+00000000000010110001
+00000000000010110011
+00000000000010110011
+00000000000010100001
+00000000000010110011
+00000000000010110001
+00000000000010000001
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010010011
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010100011
+00000000000010110011
+00000000000010110001
+00000000000010100011
+00000000000010110011
+00000000000010010011
+00000000000010110011
+00000000000010110011
+00000000000010110011
+00000000000010100010
+00000000000010110001
+00000000000010110010
+00000000000010110011
+00000000000010100011
+00000000000011100010
diff --git a/ga-logs/generation-1006.txt b/ga-logs/generation-1006.txt
new file mode 100644
index 0000000..a43a8c5
--- /dev/null
+++ b/ga-logs/generation-1006.txt
@@ -0,0 +1,400 @@
+01000100110001110110
+00001001001010100011
+00000001010101011001
+00000000010101010010
+00000001000000010001
+00001000000011110010
+00000000000111010011
+00000000000010010111
+01000010000000111001
+00011100000000111110
+00000001010101100011
+00100010011100101000
+00010011000110000101
+01100000000111010010
+10010111101110001110
+01100000100011100011
+00000000010010010011
+00011001001000000000
+10000000000111000010
+10011011011111011011
+00000001000011110000
+00000000000011111111
+00010010000010011111
+01000000000111101101
+00100000100011110111
+00000000000011101101
+01000010100001010110
+01000100100101001010
+00000000001001100000
+00000000000011000110
+00000000000001000011
+00000111001010001110
+00000000101000110001
+01000010001100010101
+00000000101000101100
+00101100001101110001
+00001000000111110100
+00000000100010000001
+00011001101010011011
+00000001000011110011
+01000100110101101011
+00001100010101000101
+00000000000001000000
+00001000000011110010
+00100000010111010001
+00000010000001110011
+00010001000001000010
+00000000011110010111
+00100001000011111101
+00000001001010010100
+00000000000010100001
+11000010110010000010
+00000011000111010000
+00001111111000001110
+00000000000010110100
+01000100010101010101
+01000000010101111001
+00000000100010011111
+00100100001010001100
+10000100000101011110
+00000100001011011011
+00000000010110101000
+01001000010101110101
+00000000001111010111
+00010100010100001001
+00000000000001000111
+00000001100101111101
+01000000010001100110
+00000100000000010010
+00000010000101001001
+00000000100011000001
+00010111001010001100
+00000000001010000110
+00000000000111100010
+00000000010001010011
+00001000001010001010
+00000100010010100101
+00000001010111110001
+00000100000011010000
+00100000010000110010
+00000000000000110110
+10000010011011000100
+00000001001011111111
+10000011000010100100
+00000000000110010100
+00001010000001111010
+00010011000110000100
+01010110000110001110
+00000011001110101010
+00000000000111100110
+00100010100111100010
+00000100100111110111
+10010010100010001100
+00011011001011111110
+00000000000111110011
+00000000101001110001
+01010110001100001110
+00000001000011000011
+00010001100010110110
+00000100000100110010
+00000000000000111011
+00000000000111010010
+00001000000011001110
+00000100110011010011
+00000000000000010011
+00000100000011111110
+01000010101111011100
+10000000110001110110
+00010011000111110101
+10000001000110000100
+00000011100010000100
+00000000000011010001
+10000010101010100001
+00000000010110101010
+00000001000010000010
+00000001101101110001
+01000001010110011111
+00000000011100010101
+00100110100001111101
+01010000001001010111
+00000100110111110001
+00000000000000010111
+00000000000011001110
+00000001000010000110
+01000000001011110010
+00000000011110101000
+01110011000001111110
+00000010100011000001
+00000011110010100001
+01110100101010010001
+00000001000010010001
+10011101011110011001
+00010000000110000011
+11000000001110110000
+01000010000001010010
+00000000111110001101
+00000000001111110000
+00100000000011111100
+11000011000010011011
+00110011110000110110
+00100000000010010110
+00100011000011111100
+10011011111001001011
+00010000000011110010
+00001011000101111001
+00000010101001110000
+10000001001000000101
+00001000000001010000
+00000011000110010110
+00000111100100110110
+00100001111100001100
+00001111110001110101
+01010000000111110011
+10100001010011010000
+00000000001010010010
+00000000100001110111
+00000000000100100001
+00100010000000111010
+01001000001110101000
+00000010000001111110
+01000001000110111000
+00000000000100010111
+11010110100100010101
+00000001000011111111
+00000010100010000100
+00010000000011010010
+00000111001001111100
+00100001100010111101
+00010110100010010000
+00000110001001011011
+00000100100010000011
+01010000000011010110
+00000001110011110001
+00000110010101010010
+00100000010010110110
+00000100000001000010
+10000000000011111100
+00010011011000110010
+00000011001010001100
+00111000011011000100
+00000000011110010111
+00000110110101010101
+00000000000101111001
+00000100011111010100
+01000000001111010000
+00100100010101001111
+00001000000111111101
+01101000000111110010
+00100100001010100011
+00001100001010001000
+01000010011100110101
+00000001000010110100
+10000100001010000011
+00011000000111101100
+00000000010010000010
+01000100000010001010
+01000001100001101011
+00011010001010111001
+00001111111111000011
+00000000000000001000
+01011100011011100111
+00000001011011000000
+10000000000111111010
+00000100010010100100
+01000000010011001110
+11100010000101010110
+10100011010011000000
+00100100010100001000
+00010100000111010111
+00000000010011111100
+00100010101000111110
+11000110100011000001
+00011000000001000100
+00000011101000110000
+00000010000001100101
+00010011000010010011
+01010010010110001110
+00100010110010100111
+00000001111111000111
+00100000001011000111
+00000000000011001100
+00000001010110001011
+01000000011011000011
+00000000000111110010
+01010110001110101011
+00000000000111110110
+00100010100111100111
+01010110000110001010
+00001000000010000010
+00000000000001001100
+10001001011001110001
+00000000000000010111
+10000000100001110011
+01000000000111100011
+00011000000110100011
+00000100101110000010
+00001000100011111010
+00000000000011000000
+00000000100000010010
+00000000000010011101
+10000000000011000000
+00010110000000010111
+00001010100000111111
+01101010110011010011
+00000010010010111000
+00000010010010111000
+00000010000000000111
+00100100100011110111
+01110011001111010011
+00010110101010001010
+00100000110010001000
+01011100011011110011
+00000010000101110001
+00000001100010010011
+00000001000001000011
+00010001000011010110
+00000000000011000101
+00100000001101100001
+00000000000111010011
+00111010100011011010
+01000000000001010101
+00100000000011100101
+00000000100011101000
+00000010000011100011
+00001001011110000111
+00000000001110100010
+00001011001111110000
+00000100010010010011
+10000100100001010110
+00000000000011100011
+01000000000111110000
+00100010101001110011
+00000000001010100100
+00000000001001110001
+00000000100011100011
+00010000111001110111
+00110000000000010110
+00000100100101111111
+00000000000111010100
+00011000000110010010
+00000010100010101000
+00001001000011110000
+00100000110010100010
+10011001011110110001
+10000100010100001011
+01001100101010001000
+00000110001110101011
+10001110000010010110
+00010100010011010110
+10000010001000111100
+00010110001110010111
+01000001000101110001
+00000000010000110000
+00000000011111110110
+00000010001010001011
+00100000010011011001
+00001100011101111001
+01011100001010001010
+00000000010010100001
+00110011000110001100
+00000000000001110011
+00000001000001000010
+00001011010010010011
+00100010000110001010
+00000000100110000010
+00000100101010110110
+00000100000110101100
+00100000000001100100
+00000000010011110101
+01000001011001100000
+00000010000111010011
+00000000000010000010
+01010000010011110000
+00100000010110001110
+00000000011000101011
+00000100000010100100
+01000001000111010010
+01110001000010001111
+00000001000001010000
+10011000000110110110
+00001011001111011010
+00011011000000101000
+00000001000011011010
+00010010010100111100
+00000100000010110000
+00001110111000011010
+00000000001010110010
+00100100000100101101
+00000001000010010110
+01000100000010001010
+00000000000011111001
+00000010000000110110
+00000000110011100011
+00100011010010010011
+10000000000000010111
+00000000011110010110
+00000000000011100010
+00000010000010000110
+00001010000011011010
+00000000000001110011
+00100000111100001010
+01000111000010001010
+00000011001110101110
+00000011001100101111
+01011100011010001000
+01000100000001111110
+10000000000110001110
+00000001000111010011
+00011010000010111001
+00010010000011111010
+00000000000000111011
+00010000000110000011
+00000011000010010110
+00000000000111001010
+00000000101000110010
+11100010010110010111
+00001100011110101010
+00000111111100000100
+00001100011011110000
+01000100101010000011
+00000000000011110010
+00000000001010010011
+00010000000000001100
+00100001000011001001
+00001110100011110100
+00010011010010010011
+00000001010100001011
+00000001111100010011
+00000100001100110011
+00100000000111000100
+01000001100101110001
+00001001001011010010
+11100010000101001110
+00100000001110010011
+00000100000101010011
+00000001110010000010
+10000000000011011011
+00010000000101000010
+00000100001000010110
+00110010100010011111
+00000001011010010011
+10000000001001010011
+01000001000010000000
+00010100111110001101
+10000100001100010111
+01000011000010011011
+10001000000001010011
+00000000000100010110
+01000001010001011001
+00000100100011001000
+00011100100011001011
+00000000010011111100
+00000000111010111010
+00001110100011111110
+10011011011101011011
+00000000010000110010
+00100000000100110101
+00000001100001011101
+00010001000010000000
+00000011001100001101
diff --git a/ga-logs/generation-115.txt b/ga-logs/generation-115.txt
new file mode 100644
index 0000000..e6a5292
--- /dev/null
+++ b/ga-logs/generation-115.txt
@@ -0,0 +1,400 @@
+10101101111110011111
+10101100011000100000
+00001010111110111001
+00001011100110000011
+00101011111010101000
+00011001110111100101
+00010011101011010001
+01001010110110111001
+00000001111011100111
+00110100010010011111
+00011111010100111111
+00011001111000101101
+00101110110101011101
+00011010011110001010
+00100001101010001100
+00111010111101001111
+00001010111110000111
+10000111010001011110
+00100101101000000111
+00111111010111001000
+00100101010110001111
+00011111010010111110
+00101110110101011011
+00101011100110000101
+00100110101111010000
+10111110010111010100
+00011111110011100101
+00011010101000110100
+00001010011011001111
+00000101010110101111
+00010010010000011101
+01101110111010011101
+00011101111001101111
+01011101011100110111
+00010111100110111111
+10110111010000011110
+01001000110010111110
+00011011010101000010
+00011011100010111011
+00010110010101010110
+10100110000011011110
+10010100100110011101
+00001011001100001000
+00100111000011101111
+01010110001011010011
+00110011111001101011
+00111010001010000010
+00100110100110101101
+00000100010110001110
+00000111010000000110
+00011100001010100010
+00011000111100010100
+10110100110000001011
+11110110010011101000
+00001111110100101001
+00011001010001111100
+01101001011101101010
+00000111101011001111
+01110110110100001010
+00011011110011000001
+01010100110101110110
+10011111100110010110
+00010110101110011010
+00111110001110011110
+01111010110111001100
+00101110000101011000
+01101110011110101101
+00101010010010001001
+00101000010011101011
+01001011010110010111
+01101100001010001111
+11001001100001100101
+00001011100011101111
+10111100010100011001
+01011011100010011010
+00111001111111101111
+00010010010001011101
+00110001010010111100
+00101110000110001100
+00011011101011110001
+01111010000111011011
+10001000100111011101
+00111011110010111010
+00111001011110111000
+10001110110101011101
+10010101000011000001
+00010001111010010100
+00000101010110111001
+10101111001110000101
+10000101001010011001
+00101000010100000001
+00001101101000000101
+01011110110100110111
+01011001000111010111
+10011110100000010110
+01101110010010111100
+01011000100011010001
+00011011010011110110
+00001100011000101111
+10001100111010100011
+00011010001100101011
+11101101100010101110
+01011011110010000000
+00101001000011101101
+00111001100111110110
+10001111000101000111
+00001111010011111101
+00010001110000101101
+00011011000011010010
+00001001011011111110
+01000111000010111111
+00000000011011101110
+00111010011110101000
+00001110001001101000
+00100011100011110110
+00101010010001011100
+10010100101111011110
+01000101111111000001
+00001001110111010010
+00111100111010100011
+10001010110101011100
+10011001100100111111
+00110001010001001010
+10111010001010010100
+00001011111010111111
+00011011110010110101
+00111001010010011111
+00100011100100011110
+00011011101001101000
+10001110010010100101
+00101100101111001111
+00101010110000010111
+01111101101010101110
+10011110101000010111
+00001111000011101111
+11100111101011011110
+00001000111000001011
+00011010011011011011
+00101001100000011010
+00110101010011010100
+00111001010101101010
+00111010101001101000
+10000101000001111001
+00001101111110011001
+00011101111001101001
+00101110111011111111
+10111101011011110000
+00100001101100111000
+10011101000011100001
+00001100000000011010
+00011100110001101101
+00111101000110110101
+00011100111011010100
+00010011000111001100
+00010101010101001110
+00110010010001011100
+00101110111100011101
+00011010110011001011
+11000010000010110000
+00011011011001011001
+00001111010011101101
+00001100011010001001
+01111010000111110111
+00111110100101101011
+01110011110010001001
+01101011111100001001
+00001100100001101110
+01001011110110010111
+01011011101110010110
+00100011100100011001
+00111010110111110111
+00010101101011111101
+00101011011101011111
+10000011100011101111
+00110110001001011110
+00110101111001011111
+01101001011010011001
+00001110111110111111
+00001011010100101111
+10011111101001101010
+00101111010001100101
+00011011100101101010
+01001110011011101010
+01001111100001011110
+00011111111100001111
+01011111000100111111
+00100011110100011110
+01011101001010100011
+00011001000000101010
+00001011110001110010
+00011101111001101111
+00011101110110110111
+00110101110000111110
+01110111001110001010
+00001010100110010000
+00000011011111101111
+00111110000111011110
+00100110000111011011
+00001111110010110101
+01101000000100110111
+01001110111011100001
+00011011010001000111
+10000101111101110000
+00011011101011010001
+10110010011000110011
+00011111110110110110
+01000001110110111001
+00100011110010111100
+00001100011010001000
+10100000111000110000
+00011010101001010111
+00111110100000100100
+10100111110110100011
+00110111110011101111
+00000010010001011100
+00010010100011100111
+00111001110000000110
+00101111010111100101
+00011100000100110011
+01011111111100000110
+01000011010010101001
+00011110110111110101
+00011111101001000110
+00011001110100101011
+11101101110010001111
+00100101010110111011
+01111001010011100110
+01010101010101110101
+11010010101101111010
+01011010000111011111
+00011100111010111010
+01010011101001000000
+00011010110110111101
+00000001110010011011
+00010010011111110110
+00101110111110011101
+00001001111000001001
+00111111001111011101
+10110000100010011111
+00101001011001101100
+00111101010010111011
+11101001011110111100
+00001111111111010001
+10001111110011100101
+11000011100001100011
+10000010100000101011
+00101110110100111011
+00111001100111011101
+00000010100011101111
+00111001111101101111
+00101110010010011110
+01111110100110101010
+10001011110001011110
+01011010000110101010
+01011001100011100001
+10011001100101010001
+00001111000101000110
+01011011101110010001
+10101011110010000111
+00101010011101100001
+01011000111000110000
+10100000110001110111
+00001110001010001000
+10001001010110111111
+00100000111000110000
+11110101010110001111
+00111010001001101000
+00011011101001101101
+00001010011010101011
+00000100100011001101
+01100010011100101000
+01111011110010111101
+01001111010110111101
+00100110100011101111
+00011000111100000110
+00100011100011101111
+00010101001111110110
+00010010010111100110
+00000111011101011101
+00010101101100101000
+00010101011001100001
+00101001100111100111
+00001010000001101111
+00001011100011011100
+00110100011000111001
+10001101110000011110
+00110110000111001101
+00011010111011011110
+00001011010000011101
+00010111000000101010
+00011001000001110000
+01101100001010001101
+10001101111111001000
+00011010011111001101
+10011010011011011111
+00101011111100001001
+01100000001101111101
+01111110011100100001
+00000100000011111011
+00000100010110010100
+00010101011001000111
+00011101011000101111
+00010000010000011001
+00111000010111110110
+00010011011011101011
+11000011100000111001
+00111001000101110110
+00100011000010010011
+10100011100000100011
+10000011011100100000
+00001010111001111010
+00011000101000110101
+01110101110110110101
+00001110101111011111
+00011100110001000111
+00001111110110011110
+10011001110111101111
+00000011001011100100
+01101000111110011001
+00101011011111001100
+11001001000011010100
+00101001010101101010
+01001001010010000111
+00000101011001111011
+00111111001111111001
+00011110010110110010
+00011111000010110111
+00111001000101101010
+00011010111010101101
+10000001011101001101
+01111100111110011110
+00011011100101010001
+10100010100111101000
+01101001100010001101
+00101110110101011101
+00000101010110001111
+01101001111100101111
+00111110000111011001
+00111010100100111000
+10111001110100101101
+00111010001111010000
+00001000000110011010
+00110101110101000110
+00011110000100001101
+00011011010001011100
+00001010101001110000
+00111011111101101111
+00101000101110001001
+01101010100101011010
+00111100110111001110
+00010101000111010111
+00000111011101111011
+00010010010001011100
+00010110000110101011
+01001011100101010001
+00111101100010101111
+00111110010110110110
+00000100010110001111
+00011101010101101010
+00110010011010111110
+00101110110101011101
+00101101101000000110
+01010101110000110001
+10111100110000001001
+01011010111000111011
+00011010101100111001
+00011110111110101000
+00010001001011111001
+00000011001000110000
+01100101111011111000
+10100000111000110000
+01111011110010111101
+00001101111111111001
+00001100110011110101
+00011000000101010110
+01000101110101110001
+00010010010001111001
+00011011110000011101
+11011010100010111110
+00001110110110111111
+00000001100011111011
+00001001100110010101
+00101110111110011100
+00011001000110100011
+00111101110000110010
+00001011110001001110
+00001100101000010110
+00000100010000011010
+00001000111000001110
+00010000001110111101
+00100010001111001100
+00000001110010011101
+00101000011011111011
+00000001100011101011
+00101011111101001011
+00111001110000001001
+00101000100101111011
+11010110000100001101
+10011110101000000110
+01011010000111011111
diff --git a/ga-logs/generation-272.txt b/ga-logs/generation-272.txt
new file mode 100644
index 0000000..9866299
--- /dev/null
+++ b/ga-logs/generation-272.txt
@@ -0,0 +1,400 @@
+00000001001010000001
+01011010101010000011
+01100110011110100111
+00011000000110000011
+00000100111100010010
+00000001101110111111
+10000110110000101101
+00000001010010001100
+01101100000110000000
+00001001100010100010
+00000100000111101101
+00001011110100011001
+01000011001110000000
+00000101011011010111
+00011000000110110001
+00000000010110011111
+00100010100100110011
+00000111000111100000
+00000000001000011100
+00100000010011100100
+00101000110010000110
+00110010001110100001
+11000100010010110110
+00000011011010100000
+01111000000010101111
+00000010101010000011
+00010100100111100001
+11100000011110010001
+00000000100000011101
+00000000001110010011
+01001100111110010000
+01111000001110101010
+00000001001010010100
+10100000001110011101
+00000001011100010110
+00110000000100011111
+10100000010011100010
+00010000011001100010
+00000011011110010110
+10000101011011010101
+00000000000110010111
+00100000111011000010
+00100000000110000100
+00111000100010000110
+00100001000110010011
+00100011000111111001
+00000101010011010101
+00010000000001111111
+00101000000010100010
+00100000010111111101
+00000110010100011111
+00101001001100010111
+10000000010100011000
+10001110101010101101
+00010100001110100011
+00011000100010011011
+00010000000100011111
+00010110011010011110
+00000000110000000110
+00001000001110010011
+01001010000001101010
+01110000101010001100
+00010000000111010011
+00001100110110110010
+00100000010111010101
+00000001000110000001
+00000001011000000100
+00000000100101010011
+01010000110110111110
+00000000101110110011
+01001001010011101111
+10010000001010100000
+00000000000110010010
+00000000101010010001
+00000000000101011101
+00000110000010100111
+00000010000000000011
+01101000000100001001
+10000000000110000111
+00000000100101011001
+01100001000000110100
+01100010000110101011
+00100000101010100100
+00000100011010110011
+10000010110010100100
+01000000100010000001
+00000000010000101000
+00001000000010110100
+01010011001010110011
+11001000000110100010
+10000000001110001111
+00001000010000011001
+01100001101010000001
+01001000000100000011
+01000000010001000001
+00000000000111000100
+00000010011110000100
+00000010000001101101
+00011000101111010011
+00010100101110011001
+00011001100101110011
+00000100001010111111
+11000001000101010000
+00010100000001000001
+00000101110101110011
+10000000000110101001
+00000101000110010110
+10000000001010100100
+11000001001010000001
+00100000110011010000
+00001000001010011111
+00000001000010010111
+10000000001000001111
+10000001101010000100
+00000000100110110001
+00000000000110100111
+01000101111100011000
+00101010001011000110
+00000000100010111011
+00001110111100001011
+00011000100010000101
+00000000000111100011
+00010100000100100111
+00000000000001010110
+00000000001110101010
+01001000001110110101
+00000001010111110100
+00110110000101011101
+00100000010010011010
+00100101000011100110
+00000000010000010100
+00100000010000101101
+00000101010010010010
+01010000101110110011
+00011000000000000001
+01100000100110001111
+10000000000000011001
+00000001000110100001
+10000000000010100101
+01001001001101110101
+00000001000100011101
+01000000010110001110
+00000100000010110000
+00100010001010000101
+10000000000110000011
+00110000001100100011
+00000001001110110110
+00100101101110000011
+01110000010010011101
+00001001000010001111
+10100101010000010010
+00000001010000101101
+00000010101101111011
+00000001010110001000
+00000000000110110000
+01010100100111100001
+00000010000010000011
+00010000000010100100
+00011000010000111110
+00000001000110100001
+00000000001110010000
+00100001100111011001
+00100100100101100011
+11110101111000011000
+00100011011010100100
+01100000001100010110
+00001100011000101100
+00100001010011110010
+01000101111000011000
+00000110010000111000
+00000111010000110010
+00000100000111011010
+00000100001110110011
+00000110000011011010
+01100110000010011100
+01010110101111010101
+00010000000110010111
+00000101010011111000
+01100011010110010111
+00000010010000000001
+01101100010110000100
+00000000010110100111
+01000010010010101110
+00000001011000010010
+00000110010010110100
+11001000100110111110
+00000001001111010011
+00000010001100011011
+00101000101100011011
+00001000001011000110
+00000000000000101100
+00000000000111000011
+00000000011110010011
+00000000001110001000
+00000001100111001111
+00010001001011011001
+00000000000010101111
+00011000100111010110
+00000000100000000010
+01001111101010100100
+00000010010000010100
+00000110000000101100
+00011000011000100001
+11100001100011111000
+00000000000010111010
+00001100101110010001
+01101000000101010110
+11000011010100000111
+00000011010010010010
+00000001001100110000
+00010000100001101110
+00000100110001110010
+00000000001110101010
+01000000011110000000
+00000101001110110000
+00001001100010001101
+00000101011110111001
+10000011010000011101
+00000001010110010111
+00011000000111010000
+00000010110010001111
+00101000000010110011
+00001001011010011111
+00000000000000010010
+00000001010110111101
+01100000000101101010
+01011010000011101000
+00001000001010101011
+01100010001111101011
+10001001100000100010
+00001010110110110011
+00001000011010000010
+00010001000010100101
+11101000100001011011
+00000110100001101110
+00000100000110111011
+00000000100101011000
+11000000000110000001
+01111000000111010001
+00000011101010000010
+00000010010010100110
+00001011011110100100
+00001001001110000001
+00000000100100100111
+00000001001010000100
+00000000110010111111
+00000000000110010010
+00000110100010001111
+00000001000111100001
+00000101001110110000
+00000001001110010000
+00000000111111111101
+00000101001110010011
+11000110100110111000
+10000010001010110001
+00000010010110010001
+00000000010011000100
+00000000110000010110
+00001101001110010110
+00000001010000111101
+10000001001011011001
+00000001110111110011
+01101000001011000100
+10000000000010100110
+00011000011001100010
+00000010011110100110
+00000110011010100000
+00000001000110010000
+00100001010111110110
+00000000000001101101
+00000001001000011110
+01000000000010000011
+00110000000100010011
+10000000010010001111
+00000000001010111011
+00000000000010110110
+00000000010010101111
+00000000100010011111
+00000000001111010100
+00100000010001001010
+11000000010100000000
+00000000010010010111
+00000110010111110110
+00001000010000111100
+00101000110011100011
+01110111100110010001
+00000100000110001101
+00000100001010010111
+00000000000111111110
+01001000000110010001
+00001100001110100110
+00000000000010100010
+10000110101010100110
+00000100000110010110
+00001001000010100111
+00000000010111011111
+00000000000011111000
+00000010100010100101
+01100000010111001000
+11000101001000100111
+00001000001010110010
+00001000110110110010
+00100001010010100111
+00000110000110101001
+01101001001011000110
+00011000001101000011
+10000011000001100011
+00001011010110011010
+00100000000101110010
+00000000000101101111
+10000010000001101010
+01111100000010110110
+00001001001101000111
+00110000000111010000
+01000001010110010011
+00000100001010110000
+01000001101110100000
+00000101010010000111
+00000000000110010110
+01110010111000011101
+00101000001110000000
+00000010110010010110
+00101000000011100010
+00010000110001001110
+00000000001110011101
+01000010101010010010
+00000000010000010100
+00001110111100011011
+01000101000001001100
+01101000110010000110
+01010100100111100000
+00100000000111010101
+00000000000010011011
+00000000000110010011
+00000001011000011011
+00000110010010110100
+10001000000010101011
+00000110101010001100
+00011000000110000000
+00000000001110010111
+00100110001110010011
+01001001011011010111
+00000001000110010111
+00000000001110010101
+00000000000010011111
+10000001000110000011
+00011000001001011100
+10000000000101110010
+00000110111010100110
+00000000000000101010
+00000000000010000001
+00000010000110110110
+00000000001111100111
+01100001010110111101
+00000010000110000010
+00000000001010000011
+00000001001110000001
+01000000100000011101
+00000010110010000111
+01000001100110101111
+00000000000011111101
+10000000000010100110
+00000100000001001001
+00000000000110010000
+00001010111101011011
+00001111010110011111
+00001001001010111111
+01000001010110100010
+00100000000011111011
+00000000000110000100
+00100010000010011011
+00000000010010000001
+01110010100010000000
+10000001000111100011
+00001000000011011011
+00000001010010011101
+00001000100010011011
+00000000001101011110
+01100010010111101101
+01000000000000011001
+00000000010010010000
+00000010100100000001
+00000000100010001001
+01000000001010010010
+00010111010010100101
+10000110101010010000
+00000001001110111000
+10000001111000010111
+10000000110110101111
+00000000100110111100
+00000110111101011100
+00000101001111000101
+00000100011001101001
+01000000001110111101
+00100001010011100011
+00000001110111100100
+00000010100000101000
+00000001010010100000
+00001000000110110011
+10001000110000100110
diff --git a/ga-logs/generation-479.txt b/ga-logs/generation-479.txt
new file mode 100644
index 0000000..3745c5d
--- /dev/null
+++ b/ga-logs/generation-479.txt
@@ -0,0 +1,400 @@
+00010011110011100010
+00000000001011110100
+00101001100000000010
+00000010001000110111
+10100100111001011011
+00010001001011110110
+01000000000010101111
+00111000101000010110
+00010100100010111111
+00011010000000001111
+00000000001101011101
+01000000101010100111
+01011001011010001101
+01000010111011100110
+01100101010110110111
+00000000001010011111
+10000000000010100111
+00000000000010001000
+00000000000010000001
+00101101001010001011
+00100001101010110110
+00111000100010010100
+11001101101110010010
+01100000000010000011
+00000010000110110101
+01110000000000001110
+10011000010000110101
+00000011000010101011
+10011110001010000011
+00110100111011000011
+00010000001011000001
+11000001001010110100
+00000001010011110101
+11101100100000001011
+00000000000011011111
+10100101111110101110
+00000000100010010111
+00010000001000100001
+01100000000010100111
+00101101101110110110
+00001000101100010010
+01011001100010000100
+00000000001110000101
+00001000001011100111
+00100100010100100111
+10101000001010110110
+01100100000100000100
+00000000010000011110
+10010000000011001110
+00101100011010000011
+00111001000010000001
+10000000000010010000
+00100000001110000111
+01100000000010001111
+10000000000110010110
+00000000000110110100
+00001000000110000101
+10000110000000101111
+10100000101010000100
+00111011100101100111
+00011110100011110101
+00000000100011101101
+00000001000010000111
+00000100001010000111
+10010001000110000011
+00001000000111110011
+00111010000110000010
+11010000001011001000
+00000000101100000011
+01000000000010001110
+10110001011111011111
+10101100010111010101
+00000011100001011111
+01101010011111101010
+10000000000011010110
+00000000001110001110
+00000110010100011100
+00000000001110011100
+00000001000110000011
+00000000101010110010
+00000001000010100011
+00000100001001100101
+00111011000010000110
+00000000001001010011
+01010001010010110111
+00000100001010111001
+00000000000010001101
+01111100100011010110
+00100000101010011110
+00100001100010000100
+00010110000010011100
+00101000001111110100
+00100100000110011100
+00000000000010101100
+00101101000001010001
+00000001010111001011
+00000001000011010100
+01000000000010000001
+00110000110010110010
+01101110100010010100
+01011001000010010111
+01000000011110001111
+10100000011010001111
+00000000001010001110
+00111010001001010011
+00001100000001000011
+00000000010011110011
+00100100011110101100
+01000000000001110111
+00100001000110010100
+00011000010111000110
+01100100110011110001
+00000000010000110000
+00000100011111001111
+10110000110110110110
+00000110000010000110
+00000011000010110101
+00001100100011000111
+00100110001000001000
+10010101000010111111
+00110100100110111011
+00000000000111001100
+00000001010110010100
+00011000110001111001
+00111000001010010101
+00000000000110100101
+00000000001010110101
+00010000000000000101
+00100110101001001101
+00000010010001011110
+10100101011010001111
+10000010100110010011
+00000000000010001011
+10011001100110101111
+01100100110011111001
+00000000000001110110
+00000001010000001001
+00011101010111101111
+00101001000001001111
+00100110000010010010
+00000000000010111111
+00000000100010000011
+00111100100100001100
+00000001010101010101
+00011001000011110111
+01000001010111100010
+00000000000010000011
+11000010010001011110
+01011000001111110110
+00000011101101100111
+11101101100011100101
+00010000011011000101
+01000000101010010101
+00100001100100011101
+00000100001110010101
+00001000100000000101
+00000100001000010001
+10101000100000101001
+01101110101010011100
+00000000101011100000
+00100100000110010001
+11101110011100001100
+01000110000000000101
+00000100000010101111
+00000001000010000011
+00000100000010110100
+00000101100010111111
+00011001100001111011
+00100101000011001100
+00110100110111101011
+01000100000000001111
+10100100011100101100
+00000000000011101001
+00100000000010001001
+00010110001000011100
+00000100100101101101
+00010100100011111111
+00100011000010101011
+01000000010011011111
+00101101100100101110
+00000000000011101011
+01101000000110011111
+01000001001111111110
+11000011001110110100
+01000000000001100111
+00000110000100010110
+00000000000011110110
+00100000000011000111
+00000000000011110101
+00011001000000000011
+01000001001011101111
+01100100110111110001
+00100101000110111111
+11000000110001000111
+00100100000111100001
+10000101001000011001
+00000100110011010001
+01100100100000011111
+00100001001010010111
+01100011100001100111
+10100100100010111110
+00000000000010110111
+00000001001010100101
+00001000000010010110
+00000000000010001010
+00000000000010100011
+00100011001010000001
+10000000100011110101
+00000000001110110100
+00011000000000100100
+00010000000000000011
+00000001000000000011
+01000000001110100011
+00000000000110000100
+00010001010011101101
+00100000000000000001
+00000000001010111011
+00000000000110000010
+00000000000011101101
+11000000001100101101
+00000000000000110100
+00100000000101000011
+01000100011010010101
+00100001000001100110
+10000100100010010110
+01101110011100000001
+11000011010010000100
+00010000101101110011
+00000000000011011111
+00101010011000111101
+00000100000110000100
+00100010010110000111
+00000001001010010111
+10000000111000011101
+00100100101101011111
+10100101100101001011
+10010110110011100100
+01001000101000000000
+10000001000010000111
+00000000100010000011
+00100000011000001111
+00000000001010010111
+00000000000010110100
+00000000100010111110
+00010000000010110111
+01100100110011110000
+00000000010110100110
+10110000000010110111
+00000110010010010011
+10110100100110101110
+00000001001000011101
+00010010010010000100
+00100100010110000101
+00000000100010110111
+00100110011010010110
+00000010000110111110
+11001100001010100111
+00000000101101111100
+00000000001000011001
+01111110110010110110
+00100110000110010111
+00000110001010010101
+00001010101011000011
+01001001101000001111
+10101000001000100000
+00000010000000011111
+01000010000110010100
+00000000000000000001
+01101100001011001110
+00000101011101011010
+01000000010011010100
+10101000001010100111
+00000001000011110101
+01000000111010011101
+00000000000000000011
+10000000000011100100
+10000000000011111101
+00110100010001111111
+10000000000000000001
+00000000000010110111
+00000001001010010010
+01101101100011111010
+11000001001010000111
+00100000010011110101
+00100000010010001000
+01000001101011100110
+00000100001111000011
+00000000000010001011
+00001000011100000011
+01100000011010001111
+00000000000010010110
+00001000000110011110
+00100100010010011110
+00010000000000011110
+00000000000010100110
+00000010000010101100
+00001000010110011010
+01100000000110000011
+00000000000011100011
+10010000010000011100
+00000000010010011100
+00010000001000010110
+00000010000010110110
+00011001010111000111
+01100000000111011110
+00000010000010000110
+11010001100010000011
+00000000110111101000
+00000111000100000111
+00100000001010100110
+10000100000000000010
+10100000100000000100
+00000000011011001000
+00010000000000000011
+00001000110011101101
+00101010011001011111
+00001000110011101101
+00000000011010010001
+10000000001000001100
+00001111000000010010
+00000001000110100111
+01000001101101100110
+00000100000110000111
+00000100000000000100
+00000000101011100000
+00111101101100010010
+00001000000110010110
+00011001001011110101
+00001000001110000111
+00100000010010000001
+00000000011010011101
+01010000000010000110
+00100100010100000111
+00010000001010110111
+00000000001011001111
+00111100010010100110
+01110000000000001010
+00000000000001110101
+01000000000111100011
+00000000001010000110
+00000000000010100100
+00001001010111111100
+00100110001000011111
+00100100010110010111
+10110100100010001110
+00001010100011110101
+00101101100100101110
+00111010001001010011
+01000100010110010110
+00000101000110010111
+00000000110100000011
+00000100000110010110
+00000100000010110110
+00100000011000000111
+00100000000110110100
+00001000010010100110
+10000010000000101111
+00100000001010011110
+00101101110011111001
+01100101100101001011
+00000000001010111010
+00011111001011001111
+00000000000010001111
+00000010001110001100
+01111000000011001111
+00100010001011001000
+00100100001010010101
+00000000000010011111
+00000000001110110110
+00000000001000110100
+10111010001010000110
+00000110010010110011
+00000000011101001100
+00000101000010110110
+00101000011010110110
+00100001101001001111
+00000100010110110110
+00010000000001110000
+01101110011100110101
+00000010010011000011
+00000100100010011110
+00000010001010011110
+00100000000010000011
+00000000001010111111
+01001101100101001011
+00100000111010011101
+01101110100000010011
+00001001001110011000
+01001011000011001010
+00011101101111110111
+01001100010001011011
+00010001110011001100
+00011001001010011100
+00001001000111100110
+00000000100011100110
+00010000100111101011
+00000000001011111111
+10000101110110001011
+00000000011000000011
+00000001101010010001
diff --git a/ga-logs/generation-640.txt b/ga-logs/generation-640.txt
new file mode 100644
index 0000000..72d566e
--- /dev/null
+++ b/ga-logs/generation-640.txt
@@ -0,0 +1,400 @@
+00000000001011111010
+00110001011111110110
+00000010011000010111
+00000101101101011000
+10010000000111110001
+00000000001010000110
+00010100010010101100
+00000000011011010111
+00000000000011011100
+00000001110111111100
+00000000000010010110
+00011110100110011111
+00000000100010011110
+01010000001110111110
+11110010100011010011
+01001110000110110101
+00001001101010000001
+00010000010001000100
+00000000100111010011
+00100111000111110000
+00010100001010100111
+00000110101001101010
+00000000001111101111
+00000001010001010110
+00010001110111111100
+01111110010001111111
+10100010111111011100
+00001101100111000100
+00000000010011011111
+00011101000011111110
+00101000011010011010
+01110000100011100011
+10001001011011111110
+00101011111001000100
+00001001110011000011
+00000000110111101100
+01101111011001110101
+10010110001110100011
+00000000011110000011
+00100011001110100101
+00000000011011000101
+00000000111011011010
+00011111011010011000
+00001100110011010101
+00011100011010011010
+01001000010010011111
+00000000000001000100
+00000111101011000110
+00000010110111001000
+10001011101010011110
+00010001110011111100
+00001100100110011011
+01011001000100110011
+00000110001111001011
+00000000001010110111
+00010101100010010100
+00101110011010011010
+00000010000001000100
+00000001000010100011
+00000001011110110010
+00000100001110000100
+00000000101111000010
+01110001111010110011
+00010100000110000100
+10100010000010101101
+00000000001100011101
+10000011001110111010
+10001001001111110110
+00010010001011101100
+01011000111110110111
+00011110000111100010
+00000010001110000001
+00000000101111110001
+00000001110100111110
+10101101110011010010
+00000000101111010001
+10010010000010101101
+00010000011111001110
+00010100100110011000
+10011100001101111111
+01010001111111111010
+10000010101010010011
+00100001011001111011
+00000011000010010011
+00011101111011000011
+01001001110011010011
+00000000010001000100
+00010010100010000011
+00001101100001010001
+00100000011010000111
+00000000100011111110
+00000100000010000011
+01110000101010110011
+00000000100111010111
+00000010001111101111
+00000000000010010101
+00001000101010000001
+00000000010001000010
+10011000010010000001
+10101011101111001010
+01000100001010011110
+00000010110111011000
+01000011101001011000
+00000000100011000101
+00000110010001111001
+00000011101110100011
+00001001010110100011
+01001000011010011010
+01001000011001000001
+01000101001010110100
+11010100001011111000
+00000000010011010001
+00000010000011110001
+01011000110110110010
+00000110001010111101
+00000101000001011010
+00001001000101101001
+00001101100110011011
+00000000000010111101
+00001010101110100001
+00100001011010111100
+10101011000010000011
+10011010010100000111
+00000110011111001001
+00101101111010001010
+00001000100111010010
+11001000100101010010
+00001000001010000000
+00110000101010110111
+01010001000011110100
+00001000001110000010
+00000000100111101011
+00010001110100111110
+01000100011010111000
+01010000000100100011
+00000010010011010101
+00000010011010011010
+00000000100110011111
+00011010100010000011
+00100100000001110100
+00101100101110000001
+10011001100011100000
+00010010010010110100
+10101101100111100101
+01000001001011000110
+00000000001111111010
+00010101000010100101
+00100001000110100110
+00010011000010101000
+00001011100011001110
+00000010010101010111
+01000100010010010111
+00000000110111101101
+00010010001011110101
+10001011101110011010
+00000000001010000011
+00000000000111010001
+00100100111011000111
+00001110000110101110
+00001110001011110110
+00000000111110101111
+00011000010010001001
+00000011000011110100
+10010110001110111110
+00001001110001101100
+00101100000011110000
+00010000000010000011
+00001101011011110110
+00010001110100111110
+10000000010011010111
+00000000001111101010
+00000001111001101010
+00000000010110000001
+00000000000100100111
+00010110001110000001
+00000010000011111100
+00100100001110000100
+00000101011010001001
+00000011001110010110
+00111111011100111111
+10000000001011101101
+00010000110111111110
+00000000000100000110
+00000001111010000111
+00000001100010010110
+01010111000011010101
+00000010011011100101
+00000101001111010110
+00100101101010001001
+00101111100111100100
+00010100001100110101
+10100010001101010111
+10111100011000100110
+10101011000011111010
+00010101011111001110
+00010000110011100000
+00000100110111100111
+00100000100010011101
+10000000000010001110
+01111011111100010110
+00001101100111110100
+10001100011011110110
+01000000000011111100
+00001000010001010100
+00000010101110100010
+10100101010011101001
+00000100100110011100
+10001011011111110001
+00000000000011111110
+00101000000010010101
+00000110011111111010
+00000000000011011101
+01000110010101010111
+00000000000011111110
+00101010100110110110
+00000111011000110011
+10100101011011101001
+00101100010011101010
+00000000000011110110
+00000010101110101001
+01110000110010011010
+00001011010010000010
+00110001010010010101
+00000000001010111000
+00100111000111110110
+00001000010001010000
+11001000000010110101
+00010010011111101101
+00000001101010010110
+01101100000001111100
+00100110001010111101
+00000100000001011111
+00000000010100001101
+00001000101111011010
+01011100010001111111
+00111101100111010101
+00111100010101111110
+00011000111111010111
+11010100001110101011
+10001000011011011100
+00111101111011010010
+10100111100010111000
+01010111010011010100
+00010100010010100111
+00111100010001111111
+00010100110111010011
+01100001101000110100
+01010100111111110101
+00001001001011010010
+00000000011011101000
+00010100011011010100
+00011100000110001100
+00000110011100111010
+00000000000010010110
+00101011001111001100
+00100100111111010101
+10010000101101110010
+10000100001111001101
+01000001010101010110
+00001110000010011110
+01001100011010110101
+00101010110110110011
+01110000101010110100
+00000001001011110111
+00000110001010111000
+00010000010001000101
+00000001000010100010
+00001100101010000111
+00001100111111010110
+10001001001111111101
+00000000000000110111
+10011010011100000001
+00000110001010111101
+00000000110111011111
+10010000111111000100
+00010001110100111110
+01000000111111010011
+00000100111111010101
+10100111000110111011
+00010101010111101010
+01111100010001111111
+00011111010010011011
+00100111001111110000
+10001000011001100010
+01000000011111011010
+00010100000011110100
+00000010100111111110
+00001100001110111100
+00110011111110011100
+00101100000011110110
+00000001000110001001
+10111011011001100110
+00000010001011100000
+00100000001111101010
+01010000101111010011
+00001101001011110110
+10000011001110111000
+00000001011010100001
+01100010010111000111
+01010100011010100111
+00000000000011101111
+00001000001110010101
+00001110001011010011
+00110011111110011110
+00000001110110010010
+10110111001110111100
+00000010010110111001
+00000010000010111100
+00111001101001010110
+00000011001111010110
+10010000011100110000
+00101001111111010110
+00010001011110100101
+01000110001010111101
+00010010000010000011
+00000000001011100111
+00000000100100100110
+00101110000111000100
+00000001100011110101
+00000010001111010110
+00001100010011010001
+00010000000011110010
+00000010000011110110
+00001100001111100000
+00000001001010000111
+00111110010011110101
+10000010100110111001
+00000010000011010100
+00011111010010011011
+01000000000010011101
+00010000000010010010
+00000001110101010110
+01011000000001110110
+00001010000010011001
+00000000000110011011
+00001000011010010000
+00000011010110000001
+00000000001010001110
+00010000000010010101
+01000111101110101100
+00111110010001111111
+10000000000010000111
+00000100110101110101
+00000011000010101000
+00000011000111011001
+00000100001111101000
+01111001000111110100
+00000100111110101000
+11101010110010000000
+00100101110000001101
+00000000111111011111
+00101111100110000111
+00101000100110110011
+00001001010001010110
+01010101110111011100
+00001000111110111011
+00000010000010111001
+01000011101000110101
+00000010000111100000
+00011010001011000111
+00000111010110000110
+00111011111001101000
+00000000111111011111
+00100001011000110111
+00010100110011100011
+01000100000010000000
+00100000000001111111
+01111110010010010101
+00000000000110010101
+00000000001010000110
+00001101011011101100
+00011000111110100110
+00100100001010010001
+00000001101011110111
+00001001110111011100
+00000010100010011110
+00011011100011000100
+00000000000010000111
+00010001110011100100
+00011111011001010110
+00010000000001010110
+00001001010010111101
+10000011000110000111
+00000000000111001011
+00000000011010000101
+00000100001111000111
+00101111000110100000
+00010001011000011000
+11110010010110011010
+00001010011011101100
+10101001001111111111
+00001011011110011010
+00000000110010010101
+00000000000011000111
+10000000000110100010
+10001010111111101100
+00000000010010010101
+00000000100110000010
+00001001100010000011
+00001000010111000101
diff --git a/ga-logs/generation-884.txt b/ga-logs/generation-884.txt
new file mode 100644
index 0000000..414db7b
--- /dev/null
+++ b/ga-logs/generation-884.txt
@@ -0,0 +1,400 @@
+00100010100010001001
+00001101000011111001
+00010111000010100001
+01011000001011110001
+00101101000111100000
+10000000010010110000
+00000111110011100101
+00000000100010011010
+01000010100000100100
+01010000100001110110
+00000100011010111001
+00000111001100011100
+00001000010011100111
+10000000000011100111
+10010000010100100110
+00000000111111110010
+00001000100010001101
+00000010010010110110
+00000001100010100001
+00100011011001001001
+00000000000001100101
+00000000000010110110
+01011000000000101101
+00011000010011100000
+00000001101010110011
+00001001011010010110
+00000000011110011100
+00000000010100001001
+00000100100010010011
+00000011000110100110
+00000001100010100001
+00000000000000110011
+11001011010011001001
+00000100010101101101
+01000000000110110110
+00000001011000111001
+00000011010111011000
+00000000000010001101
+00000100011110011110
+00111000100100001001
+00000000000010101100
+00010000000010010110
+00000100000011100000
+00000010010010000010
+10000010011110100011
+01000000100010100001
+10000000000110110101
+00000001000100110000
+00001000000010100010
+00000111000010000001
+00000000100011100011
+01000011000011100010
+00001000010110011100
+00000010011111100001
+00000111010010010110
+01000000110101000110
+00010000000110000011
+00000100110011001011
+10001010010110010111
+01100000001011010011
+00010101111111101011
+00001001000010010011
+00010001010101100010
+00100010000010001101
+00000000010011110110
+00010000100111010100
+00001011001011110100
+00000000000011100111
+00000000000010001101
+00100011000111000000
+10010001000010111011
+11100010000101100101
+00000000001010111000
+00000001001001001011
+00010010011010111001
+00011100000000001001
+00000011000111100101
+00000000000011001000
+00000000100011011000
+00010010110011110011
+00100100011111001110
+01000000010110010000
+00010101100010010001
+00000011001110101010
+00000010011101111010
+00010000000101011111
+00000000000010000001
+00100100000001101110
+00110000100010000100
+00100000100010111001
+01001010110001111111
+01010010000000010110
+00000111110011101101
+10011100100011010011
+00110000100010000110
+00000010000001011101
+01000010000110101011
+00000001000011011010
+11000100010000100110
+01000000000010100110
+00000000000001100011
+00010011000011101100
+00000101100011110010
+00000101111011110010
+00000000010101000011
+00101100010011000100
+00100000100010001101
+00100000011111001100
+00010000000100100110
+00110101010011100011
+00010001010111100110
+00100000011010110011
+00000000000010110110
+00000100100011000110
+00000001000100001001
+00000000010001001011
+00011010001010111000
+01000000100111000100
+00010100010100100010
+00001010000110010111
+00000000000001111110
+00000101000001110000
+00010010011010000101
+10101000001011111001
+00100000011110010100
+00100000000010111010
+10000000001110000110
+00000101010110110001
+00000110000110110101
+00000000000010111000
+00000000010011110000
+00001000011010011011
+10011100010111001011
+00000000000011000110
+01001001000010000001
+10000000000010001111
+00000000000110011100
+00001001011000110001
+00010010011101111010
+01000010001011010011
+00000000100011110000
+01000000000010011001
+00000000000011111101
+00010000101101100001
+10000001001001111000
+00000110000011001100
+01000000000111101010
+00010011100001100011
+00000011011011110110
+00000000000010001010
+00000110000101001011
+00100000110101101100
+00000000011010111000
+10100000101010101001
+10000011110010110011
+00010000001011010010
+00000001011000110001
+00100000100010010110
+00001000011000110010
+00000100010111111010
+00000000100011111110
+00001100111100000100
+00000100000000111101
+00000011011011110110
+00000000100101100101
+11100011110011000011
+00000000010100100110
+00000101000110100011
+00110100110001000111
+00000011000100110110
+01110111000001000010
+00000101111110101000
+00000000100110000011
+00101101000100000110
+00100100110101101011
+01000101011000101110
+01111001110000110010
+00100001000101001000
+00001000010110011100
+00000000000011010111
+00100010000000110010
+00000000000110011110
+00000000001110101110
+01000110000110000110
+00110001001010000001
+00000000010000010001
+01000001000011010000
+00000000000010110010
+00001000000111110101
+00000000101010110100
+00001000000110011100
+11100000001101100101
+00000000000011101001
+00000010010010001101
+00000111010011000010
+00111101010111001101
+00100100000010000001
+00110100000101001011
+00000001000100110100
+00000000010110000001
+00000110110110010111
+00100011101110001101
+00010001010101001110
+00000100000101100011
+00001000011100100000
+00000101110111011100
+00000100000110111010
+01100000101011110101
+00000011010100010110
+00000000100001000001
+01000011110010100101
+00000000100001000001
+00000000010011110011
+00100100010011010111
+00000000100001010001
+00010011000110000000
+00000001000111110100
+01000000000011100111
+00100011011000001111
+01000101001011101001
+00000001100010111001
+01100010110110010111
+00001100011110001111
+00000101000101111100
+00000001000100001101
+00011001100010100000
+00000111100011000100
+00000000000110000011
+00110001110010110010
+00000001010010110111
+01000001000011100100
+00000010001011010011
+01100011000010101010
+00000000011011101001
+00000001000010110100
+10111110000011101011
+00001010101011111110
+01001010110100011010
+10010011011110001101
+00100010000110101010
+00000000111100000101
+10010100000011010000
+00010011101011010110
+00000001001011010010
+10000000000010010010
+10000001000011011101
+11011011100111011000
+10000000110110100010
+00000011000111000010
+10000001000111000111
+00001000100010101101
+00000001100000100001
+00101000001110110010
+10000000000010110010
+00010001000010010101
+00001110100010000011
+11010010110010010110
+01100010001010010011
+00011100000000101010
+00100101000101111001
+00000101011011110110
+00011010111111101011
+10000000010111110011
+00000000111101110010
+01010010011100010110
+00100000011011011010
+10000101010011110101
+10000100011010101010
+00000101100110000010
+00000001010011010011
+00000000100110100101
+01000011100010110110
+00000000000110110010
+00101010011010101011
+01001000000001010010
+01111011011110011100
+00100000000101000110
+00000010101000100010
+11010000101111110011
+00000000100011010000
+10000000000011110110
+00100001000010101001
+00101000100010000000
+00000000000001101001
+00010111110010101101
+00100100000010110111
+00000000010010000001
+00000001000101101101
+01000000000011111101
+00011110000000100111
+00100000011110001101
+01000001000011111100
+00100000000100110101
+01000000001010111000
+00010001000010101011
+11000010001011101100
+00000000000010110011
+01000000001010110111
+00000100010011110011
+00100000001011010000
+00000000000011101111
+00110000000110110011
+10000101011011110101
+11100000000101100101
+00000111001011011011
+11010010110001101100
+00100100000011100110
+00000000100111010111
+00010010011010000110
+00000000000011101001
+00000011000011111000
+00000000000011001100
+00000000000010100011
+10000101110010000011
+00000110100010110000
+10101100010010001110
+00000011000110010101
+00100010001001001100
+10111101011100011101
+01001000010101011000
+00100001100101010101
+00111110000110011100
+00000010000110101100
+00100100110110101110
+00000000000110011100
+00000011000110000111
+00000101100110011001
+00100100011100000000
+00100100000101001001
+10000001100010111011
+00010000010110100110
+00001000000011011101
+10000000000000000110
+00010001000001100101
+00000010010110011111
+00000011011010110010
+00010011010010110000
+00010011000111101111
+00010010011101111011
+00000010001111010111
+01010000100011001101
+00100001000110111011
+01000000011001101010
+00001100011110110000
+00001000111111000111
+11101000001011011011
+01100000011010010001
+11000000101111110110
+00010011000111010010
+00001000000010100001
+00000000001010101011
+01100001000011010001
+10000000100010000010
+00000010110010111100
+00000000000111010000
+01100000000010000010
+00100000000010011101
+00000000000011100110
+00000000100010001110
+00001011101001110101
+00000010011100101010
+00000011010011010011
+00100100000101001011
+01000101011010101111
+00000100000011111110
+00000000000010110110
+01000110100110101110
+10010100110011110101
+00000010011011011110
+00000010000000001110
+00011011001000000001
+01000011110011110111
+00000000001010110010
+00000011010010010101
+01000001111010111000
+00000000000111101011
+01001111110111001001
+00100000000010100110
+00000001001101001010
+00000010010010111010
+01011001011010001001
+10101110000010101101
+00000100010010111101
+00000000100111001111
+00100101010111001001
+00100011011011010010
+10010010000010110110
+01000001010111010110
+00000000001101101101
+00101101000011100011
+00000000111111110110
+00001100001010111010
+00101010010010101011
+10000001010111000110
+00000000001100110111
+00000100010111110010
+10000001100010110110
+00001010011111100001
+00001001100010001000
+10100000001011100101
diff --git a/ga-logs/generation-943.txt b/ga-logs/generation-943.txt
new file mode 100644
index 0000000..54651d6
--- /dev/null
+++ b/ga-logs/generation-943.txt
@@ -0,0 +1,400 @@
+00000001001011100100
+10010001110011111110
+00000000000010100011
+00100001000011000001
+00001000000010100101
+00000000000010110101
+00100000000110100010
+00010000000010000010
+00111000000000100000
+10001010000011010001
+00000001010001110110
+00001000000011011000
+00010000001010110111
+00100001000000000110
+00000000000010110110
+01000000000011111000
+00001110010101101001
+00001000001110001001
+00000000010010010000
+00000110010010010101
+00000100000110100011
+00001000001110111010
+00010001000000010011
+00100001000010110111
+00001010000101110111
+00000000000000110110
+00000000010100100001
+00000010000100100111
+00000000000010011011
+00000000000010100101
+00100000001000011001
+11100011100101100011
+00000001000000100011
+00000000000001101010
+00000000000010010010
+00001101001010110011
+00100100000110100001
+00000000000011100001
+11000000010110010111
+00011111100101010011
+00100100000100010101
+00000001000011010010
+01000000000000011111
+00000001011010110101
+10010010000010010110
+00000000000010000111
+00000000100010100101
+01000000000111010000
+00010101100001101001
+10100000000010100110
+00000010100010100111
+00000001000001100011
+00010000000011000101
+00000000001011101100
+00000001001011110100
+00000000000010011101
+00000010010010100001
+11101101100110001110
+00001001000011000010
+11101101110100001110
+01000101111010111111
+00000011010101100010
+00001000000010110011
+00001000000010000011
+00000010001110011111
+00000001000000010000
+00000000000010101001
+00000000001010100111
+00000000000010001100
+00011110000010101010
+00000000010100111100
+00011000000010011011
+01000000001100011011
+01000000000010100101
+00000000110000110101
+00001001101110100010
+00000001000001000111
+01000000000011010000
+00000000000001000111
+01000010000010111111
+00000000000000100000
+00000000000010111010
+00000001001010011101
+01000000000001100011
+00101000000010110001
+00000100000010000111
+00001000010110110110
+00000000000110100001
+00001101000010100001
+00010000000000001011
+00010000001110100011
+00000000010001110101
+00010000000011000100
+00000100000010000010
+00000000100011110111
+10010001100000111011
+00000000010010000010
+00111010000110110001
+00110101100011110111
+00000000000010111000
+00000000000011000101
+00000000001000110110
+00000010101111011011
+00000000000010010011
+00000001100110000011
+00000001001010110110
+00000000100010011110
+00000000000011100010
+00000000010100111100
+00011100000010000100
+01000000010001110000
+00000000100011000100
+00000000001000110010
+00000000001011101100
+01100000001110100010
+00100001010110101001
+00100000101011001101
+10000000000000101010
+00001101100011000011
+00010000001110010111
+01100010001111000010
+00000000000100010011
+00000000000010011011
+00000000000010010010
+00000000000110001001
+00000010000010100100
+10011000000011100101
+00100000001010110111
+00000000010111010000
+00000000000010100001
+00100000000000000110
+00010000100010100011
+00000001000010000011
+00010000001110010111
+10001110001100101000
+00010000010001100001
+00000001000001010101
+00000000000010110010
+00000000000011110101
+00010111001110010001
+00000010000010000010
+00000000000010100101
+10010010000001110011
+10000010100010010110
+00000000000010100101
+00000000000010000101
+10000000001110000010
+00010000001110000010
+10000000000010011000
+00000101010010100001
+00100001001010011100
+01000000001110100011
+01000000001000110011
+00010000001110000010
+00111000101010110110
+00000100000111110111
+00000000000011101011
+00010010000110010001
+00101000001010010010
+00010110001011011111
+00000000000011011001
+00000000000000010100
+00000110000000110101
+00010100100010011111
+00000000000100101001
+01000001011010011110
+00000001010110001011
+00011000110000110001
+01000000110100000001
+00011001000010001101
+00010110100010011101
+00000011000111010110
+00000000000010001110
+00000100010111010000
+00000000000010101000
+00001000010010000010
+00000000000010000100
+00001000000011010101
+00000000001110100010
+00000010000100100101
+01101010000010011001
+01000000010010110110
+00100000001010011010
+00000000000110111000
+00000010010100100011
+00000000001111010101
+01000110000011110010
+00000000000001010111
+00110000001101010001
+01001100100011110010
+01000000000101100101
+00101010110110001001
+00000000100010101001
+00000000000010100001
+00100001000110000101
+00000000000010100010
+11000000010001000111
+00000001001111011111
+00110011111000110011
+00000100000011110100
+00000010110000110111
+00000000000110011001
+00000000000010100011
+00000000000010110010
+00000000000010110010
+01001000010010110011
+00000000000010110001
+10000110000010110101
+00100010000100100011
+00000101000111100110
+00000000000000010100
+00000000010110011010
+00010000001011110100
+00010000011000000111
+00000000000010001110
+00000001010011000010
+00000000000011011111
+00000000010010100001
+00000011000010100010
+00000000000101100011
+00000101001011111100
+10000010000010100111
+10000000000001111110
+00000000000011000010
+01000010010011100001
+00001000000001110110
+00000000001000001100
+10000001001111110111
+10000100000000111001
+00000001000110010001
+00110101100010111000
+00000000000010000100
+00000001000011000110
+00000000101010111101
+00001001001010100001
+01010000100000100010
+00000000000010000110
+00000001001010001001
+00000000001110000010
+00000101000100010011
+00000011011010111101
+00000001000000110111
+00000011000111110110
+00110101000111101101
+01001101001011101001
+01010000010001000010
+00010100000010110011
+10000000001101110000
+00000001000010000111
+00000000000110010100
+00000000010010100001
+00010100001001110110
+00000101111010110110
+10100000010100100000
+10000001110011100101
+00100000000000000101
+01000000011000101000
+10000000001010110011
+00000000000010100101
+00100101111010110111
+00010010010101101001
+01001100100110101001
+00000010100100100101
+00000000000011110101
+00101000000001001001
+00000000000010100101
+00000000001111110001
+00001000000010011011
+11000000000110100011
+00100000000010011000
+00010000000001100011
+00000010100010101100
+00000000001110000010
+01000001000000101100
+01100000001110010101
+00001100100011010001
+00000000000000100011
+00010001010110100011
+00000001000001100100
+00010110000011111111
+00000000000010101011
+00000000000110000011
+00000100000010110001
+01000000110000110101
+00100101111010110111
+00000001000010110110
+00010000000010011101
+00101000001110100110
+00010000000010111010
+01000000001101001101
+00000010000111000011
+00000001110010110111
+00111010100110110010
+00001010001010001100
+00000000000001000101
+00000000101011110001
+00000100000110100001
+00000000000010100001
+00000000000010000101
+00000000000000100011
+01000000000010000101
+00001000000110010111
+00000101000110110001
+00000000000011011000
+00010000101111110001
+01001011101011110110
+00000111001010100001
+01001000001010001010
+00000010010010100101
+00000010000101000011
+00000000101011010000
+00000000000010110011
+00000000000010000011
+00001000000010100111
+00000000000010111010
+00011100000100110111
+01001100100011011001
+00000100010101010011
+00000000000011110101
+00000000000000100011
+01000001000010110001
+00011000010011101101
+00000000001010001010
+00000111001110011100
+00000001101110010101
+00100001000111010010
+00000000000010100001
+00010000000100000010
+00000000001010010101
+00000000000010010011
+00000000110010101101
+10010000100110010110
+10000000100110110110
+00000000000000010001
+00000000000010000100
+00000000000010111101
+00000001000111010011
+00000000000010100111
+00000000110001011101
+00000101000011100011
+00000001001001011101
+00010000110011110100
+00000000000010011001
+01101010001010000010
+00000000000010100101
+00000000000010100001
+00010000000011110011
+00010001011011010010
+00010000000011000111
+10000000000001010110
+00000001000001110110
+00000000010110101001
+00000000000010000101
+00000000011000010100
+00000001001111100010
+00001001110011010011
+00000000000011110111
+00000000000010101000
+00000111000000110110
+01000101101110010001
+10000000000110110110
+10010100000010011110
+00000000001100001101
+00000000010111010000
+00000001001110101110
+01000001010011001101
+00000111001110101011
+00000100000010100110
+01000001101100001011
+00000000000001100011
+11010001000000000100
+00000000001011110111
+00000111001010100000
+00010000001010111100
+00000000000010000100
+00010010010010111100
+00100000001111111101
+01000000001101000010
+00110001110010110111
+00001000010001101001
+00010001001110011011
+00101000000101000101
+00000000000010100111
+00000000110001101000
+00000001101010001001
+10000001100011101001
+10011011101011111111
+00000000000010110101
+00000000000010011011
+00000000000111110010
+10100010100111001001
+01000100100001101001
+00000000110011110111
+01000001000011110101
+00001000000110010010
+00000100000110010010
+00011010000100100001
+10110101100010111101
+00000001000011010010
+00010000000000100111
diff --git a/ga-logs/run-ga-log.tgz b/ga-logs/run-ga-log.tgz
new file mode 100644
index 0000000..fb62068
Binary files /dev/null and b/ga-logs/run-ga-log.tgz differ
diff --git a/ga-trace.log b/ga-trace.log
new file mode 100644
index 0000000..f5fd061
--- /dev/null
+++ b/ga-trace.log
@@ -0,0 +1,3298 @@
+Generation number 1
+00000001011100001100
+00000010011110101110
+00000101101001100110
+00001000100001100001
+00001000110111011111
+00001010011010001111
+00001011011101101101
+00001100000011111101
+00001100101101000001
+00001101001111111000
+00001110000011000001
+00001111000011101111
+00010000100111111110
+00010001000100000000
+00010001100010011010
+00010011100101011110
+00010101011000110110
+00010101110001000010
+00010110001011101101
+00010110111001110000
+00010111100001010011
+00010111110010001010
+00011001111111011010
+00011100100110000111
+00011110110011100101
+00100000101100001100
+00100000111110101100
+00100010011111000101
+00100100000100110000
+00100110101110010011
+00100111101000010010
+00101000101001111110
+00101010110101011000
+00101100101001000011
+00101100110011011000
+00101110000010100100
+00101110001010111000
+00101111001000011110
+00101111010000111100
+00101111101000001111
+00110010111100011000
+00110011100001110001
+00110011101001100100
+00110011111011100110
+00110100001010100010
+00110101110001010000
+00111000010100111011
+00111001110100010100
+00111010001011011011
+00111100101010110110
+00111100101111011001
+00111101110011000101
+00111111110100110100
+01000001000001010100
+01000001001111111101
+01000001110101011010
+01000010010111101001
+01000010111000001110
+01000101001001100101
+01000101100111111011
+01000110101001001110
+01000110110011011011
+01000111001100101111
+01000111010001001110
+01001101001011100101
+01001101001110000111
+01001110101001010111
+01001111111110000101
+01010000001011011111
+01010010100001101111
+01010100101110011110
+01010101000010110001
+01010101010110010010
+01010101101111010101
+01010110001101010000
+01010111001111100000
+01010111011101100011
+01011001110110110100
+01011100001010110001
+01011100110100000101
+01011101010010010010
+01011110111001010010
+01011111011000000001
+01100000001110100011
+01100000110001111110
+01100001101000100111
+01100010010011101111
+01100010010111000111
+01100010110110101011
+01100100110000100010
+01100101000000101100
+01100101110000000001
+01101010010001001100
+01101010101110101001
+01101011011011001100
+01101100010110000011
+01101101010001111111
+01101101011111110011
+01101111110010110001
+01110001110010101111
+01110001111110111110
+01110010111110000010
+01110100111011110000
+01110101010000010000
+01110111010001011010
+01111000110010000111
+01111001000001000100
+01111001000100010001
+01111001010011010010
+01111011101111110101
+01111111001111110110
+10000010111110000100
+10000101100010100100
+10000110111110100010
+10000111010010110011
+10001010101111001110
+10001100101011000010
+10001101001010001110
+10001111010010001011
+10010001011101011011
+10010010100000100110
+10010010110000010101
+10010100110100101111
+10010110101111110111
+10010110110001001011
+10010111111100011110
+10011000000100011111
+10011010011100010111
+10011100011111000100
+10011110101010100011
+10011110111011100001
+10011111010001000100
+10100000000100001111
+10100000001100101000
+10100010110111001010
+10100011001111111111
+10100100010100110101
+10100110100011010000
+10101001110111000100
+10101010010010100110
+10101100000001111101
+10101101111101101000
+10101110110001011000
+10110000111100111000
+10110010100110110010
+10110011011111011101
+10110011011111100000
+10110101001100010111
+10110101110001111100
+10110111011001010100
+10111000100001111100
+10111100010010111011
+10111100111000100010
+10111101000001100111
+10111101110000101010
+10111101111000111011
+10111111000110001011
+11000001001000101111
+11000010011100111101
+11000010110010110101
+11000011001111011011
+11000100111111011110
+11000101011011110010
+11001000011010000110
+11001000100110011110
+11001001011110011101
+11001010100011011100
+11001011011111110101
+11001011101010110010
+11001111110110010011
+11010000001110101110
+11010000010111110000
+11010000111010101010
+11010001000000101110
+11010001100000010110
+11010001110111100001
+11010010101000000100
+11010011010000100101
+11010011100100111111
+11010101010001100110
+11010110011000001110
+11011001011100110101
+11011010000010010010
+11011101111110110010
+11100011101001110001
+11100100000110011001
+11100101011001010000
+11100111000101011010
+11101011010000101101
+11101101111010111100
+11110000000011001100
+11110100001010011010
+11110101111000001001
+11110110001010000101
+11110110011100111011
+11110110110100101111
+11110111001001111111
+11111010001101011101
+11111011101011111011
+11111111011111000000
+Started at Fri Apr 25 22:39:39 +0100 2008
+Took 1598.862926 seconds
+Generation number 2
+00000100101001100110
+00000101100010101100
+00000101101001101100
+00000101111001010100
+00001000101001110110
+00001010001010001111
+00001010011001000011
+00001010011110001111
+00001011011101101101
+00001100000011110110
+00001100010110000010
+00001100101000001111
+00001100101101111000
+00001111001111111111
+00010000110010000101
+00010001000000000000
+00010001001100010000
+00010001010100000100
+00010001100101011110
+00010001110110011010
+00010010100000100111
+00010010110111111001
+00010011100001110001
+00010100100010001010
+00010100111001001100
+00010101010110101111
+00010110111000001010
+00100000111110101100
+00100001110100010100
+00100010111110000000
+00100010111110000100
+00100100000100110000
+00100100000100110000
+00100100000100110101
+00100100110100100010
+00100110111110100010
+00101010110101111000
+00101100110001110100
+00101100110011011000
+00101100110011011001
+00101101110011010101
+00101110000101010000
+00101110001000111010
+00101110001010011001
+00101110001010110110
+00101110010001001100
+00101110101010010010
+00101111001000011110
+00101111001010111110
+00110011101111010101
+00110100001010011011
+00110100100011101100
+00110110001101011101
+00110111101110110010
+00110111110011110001
+00110111110100110100
+00111000010100111011
+00111000010110000011
+00111000100001111100
+00111000101100001100
+00111001110100000010
+00111010001011011011
+00111100001011100111
+00111100101011000011
+00111101100100011110
+00111101101010100001
+00111110110011010011
+00111110111111100001
+00111111110100110100
+01000001011000110110
+01000010101011011101
+01000010111000010101
+01000010111000011110
+01000101110110010010
+01000110001001001010
+01000111010001100001
+01000111100001000011
+01001000100001101010
+01001000110100000100
+01001100001110000111
+01001100101111011000
+01010000000001101111
+01010001000010011010
+01010010110101011100
+01010100001111011111
+01010101110001100101
+01010101111000001001
+01010111011010110001
+01010111011101100011
+01010111011111000000
+01010111100101011111
+01010111110001000100
+01010111111100000001
+01011011011000000110
+01011100100011110010
+01011100110100010101
+01011110111001010010
+01011111001111100100
+01011111011001000011
+01100000010001111110
+01100000110000100010
+01100000110110101011
+01100001000000110110
+01100001101100101111
+01100010001110100011
+01100010011011000010
+01100100000101100000
+01101000000100101011
+01101010101110101001
+01101011101111110101
+01101101010011111111
+01110000100111111010
+01110001110010101111
+01110001111111011110
+01110100111110000110
+01110111010001011010
+01111000100111111110
+01111010011011000111
+01111100101010111110
+01111111001111111101
+01111111010110001010
+10000010110111001010
+10000101100010100110
+10000110101011001100
+10001010101111000010
+10001010111010100001
+10001011101010110010
+10001100001000110001
+10001101010010001011
+10001110000011000001
+10001111010100100101
+10001111010100111100
+10010001001000010110
+10010001100010100100
+10010010110001110101
+10010010110100010001
+10010110110001001011
+10010110111110010011
+10011101110011000001
+10011110111010100011
+10011110111011001110
+10011110111011100000
+10011110111011100000
+10011110111011100001
+10011111010001110100
+10100000001100101000
+10100000001100101010
+10100100010100110111
+10100110011000000110
+10100110100011010000
+10101001110101000000
+10101001110111000101
+10101110001010111000
+10101111010000111100
+10110000111100111000
+10110001011111111000
+10110010111100011000
+10110011011111110001
+10110011111011000110
+10110110101110010011
+10111000011000001110
+10111001110110011100
+10111011010111010011
+10111111110100101010
+11000001011111110000
+11000001101000101111
+11000010010111111001
+11000100111111011111
+11000101011010110010
+11000101111011111011
+11000111010010110011
+11001001011110010111
+11001001011110011101
+11001111110110010010
+11001111110110010011
+11010001100000010110
+11010001100000010110
+11010010110001011100
+11010011100100111011
+11010111110011110101
+11011010000001000011
+11011101111110110010
+11100011001001100001
+11100100000110011001
+11100111000101011000
+11100111000101011010
+11100111101000110010
+11101010010010100110
+11101011010001101101
+11110000000011000000
+11110000000111001100
+11110001110001010000
+11110101111010101001
+11110110001000000001
+11110110001101010001
+11110110011100111011
+11110111001001111111
+11111000001110011111
+11111000010100111011
+11111000101001011110
+Started at Fri Apr 25 23:06:18 +0100 2008
+Took 1684.749211 seconds
+Generation number 3
+00000001101000101111
+00000010011100001010
+00000011010001100001
+00000100101000001111
+00000100110100000000
+00000100111111011111
+00000101001001100001
+00000101111001000110
+00000101111001110001
+00001000101010100010
+00001010011001000011
+00001011111011111011
+00001100000110100111
+00001100001000110011
+00001100001010010110
+00001100100000010110
+00001100101000111011
+00001110001010011001
+00010000001011100110
+00010001010110011010
+00010010010111111001
+00010011011111110001
+00010011100001110001
+00010011100001110001
+00010011100001110001
+00010011110001010100
+00010100010100011100
+00010100011101010001
+00010100100010001010
+00010100100110010111
+00010101010110000110
+00010101010110101100
+00010101010110101111
+00010111011001000011
+00011001110001010000
+00011100101000101111
+00011101011100101011
+00011110110001000011
+00100000001101010000
+00100000111110101000
+00100010111000010101
+00100010111110110010
+00100100110100100011
+00100100110100100111
+00100100110100101000
+00100100110101110110
+00101000010001110110
+00101010001010011001
+00101010011110001100
+00101010110101110010
+00101100110011010001
+00101101110011010101
+00101101110011010101
+00101110000110010111
+00101110000111010000
+00101110001000101010
+00101110001010111100
+00101110001101011000
+00110011101111010101
+00110011110001011100
+00110011110100110101
+00110100001010011010
+00110100001011011010
+00110100111110000110
+00110110000100000100
+00110110001101011101
+00110111101110110010
+00111000010100111011
+00111000100001011100
+00111000100001111100
+00111000100100010001
+00111000111111011111
+00111001100110100000
+00111001110100000010
+00111001110100100010
+00111010010111010001
+00111100101011011111
+00111101001010101001
+00111110001010110110
+00111110010000111100
+00111110101011011101
+00111110111101100001
+00111111010100101100
+00111111110100110100
+00111111110100110100
+01000000000001101111
+01000001101010101001
+01000010110011110110
+01000010111000000101
+01000100001111010001
+01000100010100110000
+01000101100010101100
+01000110011001001010
+01001000100000101011
+01001000101001011010
+01001000101110011111
+01001000110100000100
+01001010001010011110
+01001010111000011111
+01001100111101011101
+01010000000001101111
+01010010110100010010
+01010011011101101011
+01010101111000001001
+01011000110100000100
+01011011011000000110
+01011100111001001100
+01011101010000001011
+01011110001111100100
+01011111011011100000
+01011111011101100111
+01011111110001100111
+01100000100011101010
+01100001101100101111
+01100010111110000000
+01100011000000110110
+01100100001111100110
+01100101011010111111
+01101011111000011000
+01101100000101110001
+01110000100111111010
+01110000110001010000
+01110000110111101000
+01110110010001011010
+01110110111110110101
+01111010101011011101
+01111111001111011100
+01111111001111111101
+01111111010110001010
+10000010011001011000
+10000010110111001010
+10001001011110011101
+10001100001000100001
+10001101010100111100
+10001101100000010010
+10001110111111101110
+10001111010110100100
+10001111101001101100
+10010000010110000011
+10010000111000111000
+10010000111100110100
+10010001110010101111
+10010010110001111100
+10010010110100010011
+10010101010110101111
+10011111010001101000
+10100000001100101010
+10100100010100110111
+10100110001010011001
+10100110100011010000
+10101001110101000000
+10101111010101110001
+10110000010100111011
+10110001001000010110
+10110010111100011000
+10110110001100001000
+10110110101110000011
+10110110101110110010
+10111001110110011100
+10111011110001011010
+10111011110111011111
+10111101110100101010
+10111110110011010010
+10111110111111100001
+10111111110100101111
+11000001011111110000
+11000001100101011110
+11000100010100111011
+11000100011110001111
+11000100100011100011
+11000101111011001111
+11000111010010110010
+11001001011010001010
+11001011011000000110
+11001101011111010000
+11001110111001010010
+11001111010110000010
+11010011010100100100
+11010101110011110101
+11010111110011110101
+11011001110101111000
+11011101111110000100
+11011110110011010011
+11100100010100110111
+11100101010000110110
+11100101110100011100
+11100111000000111010
+11100111000110100001
+11101111001010111110
+11110000010001101010
+11110011011111110001
+11110100101111011000
+11110110000111101111
+11110110001000001100
+11110110010110101111
+11110111001001110111
+11110111001101111111
+11111000100111111110
+11111111010001100001
+11111111110100110101
+Started at Fri Apr 25 23:34:23 +0100 2008
+Took 1771.991079 seconds
+Generation number 4
+00000000110100000000
+00000001101000101100
+00000001111001000111
+00000010011100101111
+00000011010001100001
+00000100011111010010
+00000100100001001111
+00000101010110101111
+00000101100010101100
+00000101111001110001
+00000101111010000110
+00000101111101000011
+00001000001000110010
+00001010011001000000
+00001010101000111011
+00001100000110100111
+00001100000110111110
+00001100001011011010
+00001100101010111101
+00001110010111111001
+00010000001011100110
+00010000010110000011
+00010010110001000011
+00010011100001110001
+00010100011100000001
+00010100011101010010
+00010101010000010010
+00010101010110101100
+00010101011001001000
+00010101111111011111
+00010110000110101001
+00010111010110000110
+00010111011001000011
+00011000110100000100
+00011001100010100000
+00011100100001010111
+00011100101010100110
+00011101011100101011
+00011101011100101011
+00011110110001000011
+00100010010100111011
+00100010111000000101
+00100010111011110010
+00100010111110110000
+00100011101101010101
+00100100001011111010
+00100100110100101000
+00100100110101110110
+00100100110111110110
+00100100111111011111
+00100101110101010101
+00100110110100100011
+00100111001000001101
+00101000110100000100
+00101001110000010110
+00101010011011001100
+00101010011110001000
+00101100110011011110
+00101100111110000110
+00101101110011010001
+00101101110011110110
+00110001010010101111
+00110001110100000010
+00110010001010011001
+00110010011000011101
+00110011101111010101
+00110100001010010110
+00110100111101100110
+00110110000100111011
+00110110001100001000
+00110110001101011101
+00110110001101011101
+00110110011101100011
+00110111101100010000
+00110111111000001001
+00111000100100100000
+00111000110100010101
+00111001100100000010
+00111001100100110100
+00111001100110010001
+00111001100111110001
+00111001110100000010
+00111001111100101000
+00111001111111101110
+00111010010111010001
+00111010010111010101
+00111100100001010100
+00111100100100010001
+00111100101011011111
+00111100101110011000
+00111101001000000100
+00111101101010101001
+00111101110011010101
+00111110001000101010
+00111110010010111101
+00111110011111110001
+01000001111010101101
+01000011010010110010
+01000100010100111011
+01000100100010101100
+01000100101111010001
+01000101100010101100
+01000110010110101110
+01000110011100001010
+01001000010001110110
+01001000101010011111
+01001010001010010101
+01001110101000010110
+01001111001111000010
+01010010110100011000
+01010011001100000100
+01010011011101010001
+01010101010110000110
+01010101111011001111
+01011100111000101100
+01100000000001101111
+01100011000000110100
+01100100000101110001
+01100100001111100110
+01100101001111100110
+01101011111010110010
+01101100000101101011
+01110000100111111010
+01110000100111111010
+01110000110001010000
+01110000110011010100
+01110000110110001000
+01110110000111101111
+01110111010011100001
+01111000100111111011
+01111001110100000010
+01111010101011000101
+01111100001010111100
+01111101001010101001
+01111111110100101111
+10000010011100011010
+10001101100100010000
+10001111011011001111
+10010000010110000011
+10010000111100100000
+10010111010010111111
+10010111100001011100
+10011001011110010001
+10011110110101000000
+10101001000011101000
+10101101101110101111
+10101110011111011000
+10101111010100100001
+10110000010100000100
+10110000010100111011
+10110001001000010110
+10110001001000010110
+10110010111100011000
+10110100111110000110
+10110110000111100000
+10110110010111001010
+10110110101110000011
+10110110101110110010
+10110110101110110010
+10111011110011011010
+10111100101011011111
+10111101001011101011
+11000000000001101010
+11000001100101011110
+11000010101100001100
+11000011010001000001
+11000100001000111000
+11000100010100111011
+11000100011111001111
+11000100111110101000
+11000101111001101100
+11001000101010011111
+11001001110101011000
+11001100011111000000
+11001100100100110110
+11001101011010001011
+11001101011111010100
+11001110111011010001
+11001111010110000010
+11001111010110000010
+11001111100001001111
+11010000110110110000
+11010010110100010000
+11010100101110001100
+11011001110101110010
+11011001111110000100
+11011011011000000110
+11011101101110001100
+11100100001111000110
+11101101110011110101
+11101111001010111110
+11110010001111110000
+11110011010000111100
+11110100101111011000
+11110110010100101110
+11110110101110110010
+11110111000101111111
+11110111101101111111
+11111000100110111110
+11111000100111010110
+Started at Sat Apr 26 00:03:55 +0100 2008
+Took 1879.650283 seconds
+Generation number 5
+00000000100111111111
+00000000110100000110
+00000000110100010010
+00000001111000110001
+00000001111110101110
+00000010011100100010
+00000100001011100110
+00000100100100100011
+00000101001010101100
+00000101010100101100
+00000101111010000110
+00001000101010010111
+00001100001011000011
+00001100011011001000
+00001100101010000100
+00001101110011110110
+00001110001010001101
+00010011100101110001
+00010100011011111010
+00010100011100000010
+00010100011101010111
+00010100011101011000
+00010101000110111110
+00010101011001000000
+00010101011001001011
+00010101100001111001
+00010101110111011111
+00010110000110101001
+00010111010110000100
+00010111010110000110
+00010111011001010011
+00011000100100100000
+00011000110100010101
+00011001110010100000
+00011101010100110110
+00011101011100100000
+00011101101010100111
+00011110110001000010
+00011110111111000000
+00100000111110110000
+00100010001010010101
+00100010110100110110
+00100010111011110111
+00100010111111011111
+00100011101111100101
+00100100001101011101
+00100100100100101110
+00100100110101011110
+00100100111110110000
+00100101011010000110
+00100110110100100011
+00100111001001011011
+00101000111010000110
+00101001110000000101
+00101010011110001001
+00101010011110100000
+00101011011101010001
+00101100011111110001
+00101100101010101101
+00101101110011010110
+00110000001100010001
+00110000011111010010
+00110001111100101000
+00110001111110101101
+00110010001010000011
+00110010001010011111
+00110010001100111001
+00110010011010010001
+00110011101111100000
+00110101100100010000
+00110110001110101011
+00110110111000000101
+00110111011010000110
+00110111100001011000
+00110111101100010000
+00110111101100010000
+00111000110000010000
+00111001011100101000
+00111001100100000101
+00111001100110110100
+00111001100111111100
+00111001110100000011
+00111010000011111111
+00111010010111000011
+00111010010111010110
+00111010011100101111
+00111011100101010010
+00111100001010111100
+00111101001000000110
+00111101001010101111
+00111101111110010000
+00111110010010101111
+00111110011111110110
+00111110100001001010
+00111111010011101001
+01000000010100111011
+01000000100001101010
+01000001101101011110
+01000001110101010000
+01000100010101111011
+01000100011101000011
+01000100101010010010
+01000100101111010001
+01000101001111100110
+01000101111101010110
+01000110010110111100
+01000110011100001010
+01000110011100001010
+01000111010110101111
+01001000010001110110
+01001000010001111000
+01001000101010011010
+01001010010001111110
+01001010111000010101
+01001110111110000101
+01001111001111001010
+01001111010000000111
+01001111110100101111
+01010011001100010100
+01010011001100100110
+01010011011101010001
+01010011011110111101
+01010100100011011111
+01010101010110101011
+01010101111011001111
+01010111010101111001
+01011010101000111011
+01011100000101101011
+01100000100111111110
+01100011110000000010
+01100100100010101100
+01100110000111101011
+01101000100111111011
+01101111110100111101
+01110000100101101000
+01110000100111111010
+01110111000111101110
+01111000110100000010
+01111100001010101100
+01111101001000101001
+01111101011010100001
+01111111110100101110
+10000001110011110101
+10000010011001000000
+10000101010100000100
+10000101111001000011
+10001010011100010010
+10001101100100011010
+10001101100101011101
+10001110000101001101
+10001111010110000110
+10010000010101111101
+10010001010010101111
+10010100111100111011
+10101100011111010010
+10101101101110100111
+10101101101110101111
+10101101111100001000
+10110001001100011111
+10110010111100011000
+10110100010100001100
+10110100111110000110
+10110110000111010101
+10110110010111010100
+10110110101110100010
+10110110101111011010
+10111001001000010110
+10111100101111011100
+11000000100101011110
+11000010101001100100
+11000011010001100001
+11000100001000110110
+11000100110010000000
+11000101010110100111
+11000101100010001100
+11001000101000011000
+11001000101010011001
+11001001110101011000
+11001100010001000001
+11001101011111010101
+11001101110101110010
+11001110101110101011
+11001111101001001111
+11010000010110110000
+11010110100100111011
+11011001101000010110
+11011001110101110010
+11011011011110000010
+11100100001111000100
+11100100001111000110
+11101101111001000111
+11101110101100110110
+11101110110010001100
+11101111001010100110
+11110000110001010001
+11110010001111100000
+11110100101111011000
+11110110010100100110
+11111000100111010001
+11111101001011101011
+Started at Sat Apr 26 00:35:15 +0100 2008
+Took 1834.799951 seconds
+Generation number 6
+00000000100111111100
+00000000110100000110
+00000000110101111011
+00000001110100100111
+00000010011100100010
+00000010011100100011
+00000100001011100001
+00000100010101111011
+00000101010100001100
+00000101111010000110
+00000101111010001110
+00000110011100001000
+00001000101010100000
+00001011011001010011
+00001100001011000011
+00001100001011001010
+00001100101001100101
+00001100101010000101
+00001110001110001100
+00010000011101010111
+00010011001100010100
+00010100001101111001
+00010100011011111011
+00010101000110000110
+00010101000110111001
+00010101010100100100
+00010110000011101011
+00010110001110101001
+00010110010001010011
+00010111010110111110
+00010111110111111111
+00011000001100010111
+00011000110100010110
+00011001100111111100
+00011001110110100100
+00011010100100011001
+00011100001111000100
+00011100101010111100
+00011101101010100100
+00011110111111000000
+00100010111000000010
+00100010111010111100
+00100011101111100101
+00100100000100110110
+00100100001101001101
+00100100110101011110
+00100101011010000110
+00100101101010000100
+00100110000100110110
+00101000110001110110
+00101000111110110000
+00101001010000000110
+00101010011110000101
+00101010011110001001
+00101011011101010001
+00101100011011000011
+00101100011111110110
+00101100101011011001
+00110001010110111100
+00110001111100101000
+00110001111100101000
+00110001111110100110
+00110010011010010101
+00110011001100001100
+00110100100101100000
+00110101000110101011
+00110101100100010010
+00110101101100010011
+00110110010101101011
+00110111001100010000
+00110111011010010110
+00110111011011000001
+00110111101110110000
+00110111111110010010
+00111001011100101000
+00111001100100000010
+00111001100111111100
+00111001101010010110
+00111010010111010110
+00111100001010111100
+00111100010101111011
+00111100011101011000
+00111101001011110111
+00111101011010000100
+00111110000001001000
+00111110000010101011
+00111110001110110111
+00111110010010101110
+00111110011111110100
+00111111100011001010
+00111111101100010001
+00111111101111111000
+01000000100001101010
+01000001101101011100
+01000001110101010000
+01000001110101011000
+01000001110101111010
+01000010000011111111
+01000100011100000011
+01000100011100001010
+01000100100101011110
+01000100100111111110
+01000100111101001000
+01000101001111100110
+01000101100100010000
+01000110010000011010
+01000110111100101000
+01000111010110101111
+01000111011110001111
+01001000001010011010
+01001000010001000000
+01001000010001111000
+01001010010001000011
+01001010111000010100
+01001100001001111110
+01001101011100100000
+01001101011111010101
+01001101011111110101
+01001110000101001101
+01001110111010000101
+01001110111110000101
+01001111110100110101
+01010000101010101101
+01010011001100010101
+01010011101111101011
+01010101010010101001
+01010101110011011111
+01010101111011001011
+01010101111011011110
+01010110001010011111
+01010111010101111001
+01011010101000111011
+01011111011011001001
+01100001110000100010
+01100010111101011101
+01100011001101101111
+01100101011100100000
+01101000010001111001
+01101111001010100111
+01110000100111111000
+01110010100101101000
+01110010101110111011
+01111000110111110111
+01111100000010101110
+01111100001010101110
+01111100101111011011
+01111101011010110001
+10000100010101111011
+10000100111100000100
+10000101000100101100
+10000101010110000111
+10001010011100010010
+10001010011100101000
+10001011001111001010
+10001111100010000100
+10010000010101111101
+10010001010010101101
+10010100010101111111
+10010110111100000110
+10010111011110000001
+10100110011110010010
+10101100011111010010
+10101101101110010010
+10101111011110111101
+10110000010001111111
+10110010111100011000
+10110100101110101101
+10110100111100111011
+10110110000101010101
+10110110101111011000
+11000000101010011110
+11000001110101011110
+11000010011001000000
+11000010101001100100
+11000100001000110001
+11000101001010001101
+11001000101010011001
+11001001111101011000
+11001100110100000010
+11001101011111010001
+11001101100101011101
+11001110110010111011
+11001111101001001101
+11001111101110101011
+11010000001000110110
+11010011001100000000
+11010101100010001100
+11100100001111000100
+11100100001111010110
+11101010110010000100
+11101111000010100110
+11110000011010000110
+11110100010011101001
+11110100111111011010
+11110111000111000001
+11111000100111010000
+11111000100111010001
+11111000100111010001
+11111001101000011100
+11111010000111000011
+Started at Sat Apr 26 01:05:49 +0100 2008
+Took 1806.325558 seconds
+Generation number 7
+00000000100111100000
+00000001110100100111
+00000010011101100011
+00000100000101111010
+00000100100011111110
+00000100110100111100
+00000100110101111001
+00000101010110000111
+00000110001100001000
+00000110010101101000
+00000110011101001000
+00000110110011011111
+00001000011110001000
+00001000100100110110
+00001010011110000101
+00001011011101010011
+00001100001011000011
+00001100011010011010
+00001100100010001100
+00001100100101111110
+00001100101001100101
+00001100101010001000
+00001101101001100101
+00001110001100100100
+00010000011101010110
+00010001100100001010
+00010010001101000000
+00010010101010101101
+00010100011011111011
+00010101010110001100
+00010101011100100100
+00010110010011101011
+00010111010101101000
+00011000010100010110
+00011001110110100100
+00011010100100011001
+00011010101010100111
+00011100101010110100
+00011101101010000100
+00011101101010011000
+00011110111111000000
+00100001011010000110
+00100100001101001101
+00100100101010000101
+00100100101010111011
+00100101111010011010
+00100110000100110111
+00100110001010110000
+00100110111011010110
+00101000111010110000
+00101010011110101101
+00101011011001010011
+00101100011010000010
+00101110111100011000
+00110000001000010110
+00110000010001111001
+00110001010110111010
+00110001101110101011
+00110001111110111001
+00110010011010010101
+00110011001100010101
+00110011001111110001
+00110101000111101011
+00110101010110000111
+00110101100000010010
+00110110010101101011
+00110111001001111011
+00110111011010000110
+00110111101110110000
+00111000001010111100
+00111000010100101100
+00111000010101111011
+00111001000010100110
+00111001010001111001
+00111001101010000100
+00111001101010010110
+00111001101010010110
+00111100010100001100
+00111100010101111011
+00111100011001100100
+00111100011101011000
+00111100011101111001
+00111101101111000100
+00111101101111111000
+00111110000010101011
+00111110011111111100
+00111111100011001010
+00111111101000011101
+00111111101111111001
+01000000100001101010
+01000001101101011100
+01000001110111011000
+01000100100101011101
+01000100100101011110
+01000100101010000101
+01000100110111111110
+01000100111101001000
+01000101111010000110
+01000101111010111100
+01000110011000010011
+01000110101111011011
+01000110111000010100
+01000111011110001111
+01001000001010101010
+01001000111101001010
+01001010111000010100
+01001100101010000101
+01001101010111110101
+01001101011111110111
+01001110000101001101
+01001110011110000100
+01001110111010000101
+01001110111100000001
+01001111001010100111
+01001111110100110101
+01010000010001111111
+01010000101000100101
+01010001010110101101
+01010001110101111010
+01010100000110000110
+01010100100101100000
+01010101010000101110
+01010101010010100010
+01010101010010111010
+01010101110101011000
+01010110011110001101
+01011010000100110110
+01100001110000100011
+01100010111000010000
+01100011101100010101
+01100100000111111110
+01100101001111100011
+01100111001000011111
+01101000010001110000
+01101101000110101011
+01101111000100011001
+01101111001010100111
+01101111001010100111
+01110001100111111100
+01110010101100001000
+01110010101110000001
+01110011001101111111
+01110011101111111011
+01110100110011011111
+01110110111010011101
+01111000000010111011
+01111000010001111001
+01111000010101101000
+01111000110111010010
+01111100001010001110
+01111100100111111110
+01111110001110101011
+01111110101111011011
+10000001010110111100
+10000101000101110011
+10000111100011010000
+10001010011100010001
+10001010011100100100
+10001110111110000101
+10001111010110001111
+10001111100010000100
+10010001010010101101
+10010101111011011110
+10010110010000010001
+10010110111100011101
+10010111011110000000
+10011001110100100111
+10101101101110110110
+10110001010110111100
+10110010001101010101
+10110010010100110000
+10110011001111111000
+10110100101110001001
+10110100101110101101
+10110110000000011100
+10110110111100101100
+10111000101001101101
+10111100001010001100
+11000100010101101011
+11000101001000110101
+11000101010000001100
+11000101010110000111
+11001000101110010110
+11001001111101111000
+11001011011100101000
+11001100100001011110
+11001111101010101110
+11010000001100010110
+11010111011000010110
+11011000010001111000
+11100100000000000010
+11100100001001010110
+11100101011100100000
+11101000100111010000
+11101001101110110000
+11101010110010010110
+11101100001011000010
+11101111100111111100
+11110110111111001010
+11111001101101010101
+Started at Sat Apr 26 01:35:56 +0100 2008
+Took 1893.750235 seconds
+Generation number 8
+00000010001101100011
+00000100000110000110
+00000100010110011101
+00000100100011111110
+00000100100101101110
+00000100110000111111
+00000101010110011110
+00000110000010101010
+00000110001100001110
+00000110011001001010
+00000110110011011111
+00001010011010101101
+00001011011101010011
+00001100011101101001
+00001100100001100101
+00001100100101011101
+00001100101000100101
+00001101010110000011
+00001101011111110111
+00001101101001100101
+00001110001000010101
+00001110111010000101
+00001110111010011101
+00001111001010110111
+00010000011101011000
+00010000110101111000
+00010010101010101101
+00010010101011100101
+00010100011101000010
+00010100100001101010
+00010100100110100110
+00010101011100101100
+00010101011100111000
+00010101111011010010
+00010101111011011110
+00010110011100001000
+00010111001000010111
+00010111010000010110
+00011010011100011011
+00011010101100001000
+00011100011111011011
+00011110111101111001
+00011110111111000000
+00011110111111000111
+00011111101111111001
+00100010011111111100
+00100100101001100101
+00100101011101100000
+00100101111010010000
+00100110000100110111
+00100111010101101000
+00101000010001111001
+00101010011110100000
+00101011011001010011
+00101100011010000010
+00101100011010110110
+00101101000110101011
+00101101101000000100
+00110000010010111001
+00110000110001111110
+00110001001111110001
+00110001110010001110
+00110010001001010101
+00110011001100000100
+00110101000111101011
+00110101010110000000
+00110101011010100111
+00110101100000010111
+00110101100001010010
+00110101101000010010
+00110110110011011110
+00110111001001110010
+00110111001001111011
+00110111011010011001
+00111000000010111101
+00111000000110100000
+00111000010100101100
+00111000010101101011
+00111000110111010010
+00111000111000111100
+00111001000010111011
+00111100011101011011
+00111100011111000000
+00111100100101100010
+00111101101111111000
+00111110000011101011
+00111110001101000000
+00111110010010011010
+00111110011010010101
+00111110011111111100
+00111111101010000111
+01000000011011101011
+01000000011101100011
+01000000100001101010
+01000001110000100010
+01000010011101100011
+01000100010101111011
+01000100101010000101
+01000100111010100111
+01000101110110111110
+01000101111010000110
+01000110010101101000
+01001000101011111011
+01001000101101101010
+01001000111101001100
+01001001011111110010
+01001010011000010100
+01001010011110000100
+01001011011100101000
+01001100100101011110
+01001100101010001000
+01001101010100111010
+01001101111010000110
+01001110000101001101
+01001110001010000101
+01001110011010000100
+01001110011110000000
+01001111001111111010
+01001111110100110100
+01010001001110101010
+01010100100101100000
+01010101110001110000
+01010110100101011101
+01010110100101100000
+01011000001100110110
+01011100100111111110
+01011101101000011100
+01011101110110100000
+01011110001010100111
+01100000110111111110
+01100001101111101100
+01100001110001100011
+01100011001100010101
+01100100000010111110
+01100100001010000100
+01100100001101111001
+01100110000100101011
+01100111001010001011
+01101000010001011000
+01101001001010010110
+01101101000100011111
+01101101100110101011
+01101111001010000101
+01101111001010101010
+01110000010100010110
+01110001100101111100
+01110001111111101010
+01110011001001111100
+01110100000111101011
+01110100001000001100
+01110100111010000111
+01110101101110101111
+01110101110011011111
+01110110111010011101
+01111000000001111001
+01111000010001100110
+01111000010001111001
+01111000110111010010
+01111000110111111111
+01111010000101101011
+01111011101010010110
+01111100100111111110
+01111100100111111111
+01111110101101011000
+10000001111110000101
+10000010000011001110
+10001100101010011011
+10001110010110110100
+10010010001100000010
+10010101111011011111
+10010110010000010001
+10010111010111011010
+10010111011110000101
+10011001110100100100
+10110001010110111100
+10110001010110111100
+10110001110110101101
+10110011001010100111
+10110011010110111110
+10110011101111100100
+10110101000111101011
+10110110010101101011
+10111100001010001110
+10111111111100010001
+11000100010100110110
+11000100100111011101
+11000101000010100110
+11001011011100101011
+11001111100011101101
+11010001001100010110
+11010100000101111010
+11010100111011111011
+11010111011000010110
+11101100001011000111
+11101101101110000010
+11110100011000011010
+11110110111110001000
+11111000010001110000
+11111001101101010101
+11111100010101101011
+Started at Sat Apr 26 02:07:30 +0100 2008
+Took 1722.345688 seconds
+Generation number 9
+00000100000110000110
+00000100010110000110
+00000100100011101101
+00000100101000100101
+00000101000010111101
+00000101010100000000
+00000101100011111100
+00000110110011011110
+00001000000100111011
+00001010011010111010
+00001011000100101011
+00001011011010011001
+00001011011100000100
+00001100001101101001
+00001100011010000010
+00001100101111011110
+00001101000100000011
+00001101011111111000
+00001101100001100101
+00001110001000010101
+00001110010011011111
+00001110011010111011
+00001110101010000101
+00001110111010000101
+00001111001010110111
+00001111001010111110
+00001111010101010111
+00001111011001111011
+00001111111101111000
+00010000100101100000
+00010001001111110001
+00010001110001100011
+00010010101011000101
+00010010101011100101
+00010010101110101111
+00010100100111001101
+00010100101010011011
+00010100111010000111
+00010101011100101100
+00010101011100111000
+00010101011110101110
+00010111010000010010
+00010111011000010000
+00011010011100011011
+00011100001111011011
+00011100010110100100
+00011110010010001001
+00011110011100000111
+00011110111011000111
+00011110111111000111
+00011110111111011011
+00100011010101101000
+00100100000100000110
+00100101000111101011
+00100101011100100000
+00100101111101100110
+00100111100101111000
+00101000010000111011
+00101000010101111001
+00101000101011111001
+00101001101000010010
+00101100111010011101
+00101101001000111001
+00101101001110101011
+00101111011101010011
+00110000001011110001
+00110000110001111010
+00110001001110110100
+00110001001111110001
+00110001110010001110
+00110011001100000100
+00110100010001110001
+00110100010110011101
+00110100010111000000
+00110100011000011010
+00110101010010111110
+00110101011101111011
+00110110001001010101
+00110110011010001101
+00110110111101010101
+00110111000000001011
+00111000010010111001
+00111000010100101100
+00111000010101101010
+00111000100001100010
+00111000100101011110
+00111000110000111101
+00111000110111010010
+00111001010111011011
+00111010000010101010
+00111011001101010011
+00111100000000010111
+00111100001101011011
+00111100010010111001
+00111100010101111011
+00111100011010010101
+00111100011101011011
+00111100011111000000
+00111100011111111100
+00111101101001100101
+00111110000011101010
+00111110010110110100
+00111110011111011101
+00111110011111111100
+00111110101010011011
+00111111100011101101
+01000000010011101000
+01000000011011101011
+01000001110000100110
+01000010000011001110
+01000010011101100011
+01000010011111111011
+01000011010111011010
+01000100010111011010
+01000100101010010110
+01000101111010000000
+01000110011011111100
+01001000011011101011
+01001010010001100110
+01001010011000010100
+01001010011110000100
+01001011011100101111
+01001100011001101001
+01001100101000001000
+01001100110101011110
+01001101000110101011
+01001110000100101101
+01001111001010000101
+01001111010011011011
+01010101000111101011
+01010110100101101100
+01010111001110000101
+01010111011100010110
+01011000110111010010
+01011110011010000101
+01100010101010101101
+01100011000001111100
+01100011010100101011
+01100100001110110111
+01100100100000010111
+01100111011010000000
+01100111101010001011
+01101001001011000001
+01101101000100011111
+01101101000110010110
+01101101010111010010
+01101101100110101001
+01101101111010000111
+01110000010100010110
+01110000010111011110
+01110011001001111100
+01110011011110000000
+01110100010100110100
+01110100111010001111
+01110101101110101101
+01110101110100111010
+01110111011010011001
+01111000000001111001
+01111000010001111001
+01111000101010101010
+01111000110111111000
+01111000111011101011
+01111000111111010010
+01111011100010010111
+01111011101001010110
+01111100000001111001
+01111100100111110100
+01111110100111111110
+01111111111111000011
+10000001010010100111
+10000101111110000100
+10001001011111110110
+10001100100001100101
+10001100110010011010
+10001101010110000011
+10001110010111110001
+10001111001010010111
+10010011101011100111
+10010100100001001000
+10010111011110000110
+10011001111111011011
+10101101000110111101
+10101110000100110111
+10110101000101101010
+10111000010001100110
+10111011101111100100
+11000100101010000101
+11001000000001111001
+11001000010001101001
+11001011011100101011
+11001110000011101011
+11001111110011101101
+11001111110100110100
+11010100000100010101
+11011100010101101010
+11011101001100101011
+11100110101100010101
+11110101010110000000
+11110101101000010010
+11111001100011001111
+Started at Sat Apr 26 02:36:12 +0100 2008
+Took 1926.564649 seconds
+Generation number 10
+00000001101010101100
+00000100000011101101
+00000100000110011101
+00000100100011101100
+00000101000010111101
+00000101010100000000
+00000101101100010111
+00001000000000111011
+00001000000111111100
+00001000011011101011
+00001011001100000100
+00001011011111100011
+00001011101010110111
+00001100010011011111
+00001100010110100100
+00001100011010000000
+00001100100101100000
+00001101000110000010
+00001101011111011000
+00001110001011111001
+00001110001111101001
+00001110010011011001
+00001110010011011111
+00001111000100101011
+00001111001010011010
+00001111001010111100
+00001111010100101011
+00001111011001111110
+00001111110100110100
+00001111111101110100
+00001111111101111000
+00010001001001111011
+00010100000000111100
+00010100100011100110
+00010101010000100100
+00010101010110100011
+00010101111010000100
+00010110010010001101
+00010111011000010010
+00011000010110111110
+00011000010111011110
+00011001101111001011
+00011010011100010011
+00011100001101101001
+00011100010110100100
+00011100011010010101
+00011110010001111010
+00011110111100010110
+00011110111111011011
+00100000001100000110
+00100000010101111010
+00100100000100010101
+00100100001110110111
+00100100011100001011
+00100101011100100000
+00101000010001100110
+00101000010100110111
+00101000011000010010
+00101000011011010101
+00101000110100111011
+00101000110101010010
+00101001101000011010
+00101011101111100100
+00101100001111011011
+00101100011010111011
+00101100111010011101
+00101101001000011001
+00101101001110001011
+00101101001111111000
+00110000010111011110
+00110000110001111011
+00110000110010001110
+00110000111000011010
+00110001001110100100
+00110001111100001111
+00110010000011101010
+00110010101011100101
+00110011001101111001
+00110100000100010101
+00110100010000111011
+00110100010011111010
+00110100011000010010
+00110100011000011010
+00110100011000011010
+00110101010010111011
+00110101110010101110
+00110110001001010101
+00110110001001010101
+00110111000000001011
+00110111000011101101
+00111000010101101001
+00111000010101101010
+00111000011101100010
+00111000100101011110
+00111000110000111101
+00111000111110000111
+00111010010010111001
+00111010010110110100
+00111011001100000101
+00111011110001111010
+00111100001001011011
+00111100001011000101
+00111100010100111001
+00111100011010010101
+00111100011010011101
+00111100011100111011
+00111101010111110010
+00111101101001100101
+00111101111101101010
+00111110000100110111
+00111110011101011101
+00111110011111010101
+00111110111100000111
+00111111001010111110
+01000000011011101011
+01000000011011101011
+01000100010111111000
+01000100010111111110
+01000100101110010110
+01000101100000111011
+01000110000011001101
+01001000100111111110
+01001010000000101101
+01001010010110010100
+01001010101010000101
+01001111010011011011
+01010000100101110000
+01010101000111101011
+01010101001110111111
+01010111000111101011
+01011001010111011011
+01011010110111010010
+01011100000011110011
+01100001000111011011
+01100011010111011010
+01100100000100000110
+01100100000111101011
+01100100011110110111
+01101000111010111011
+01101001001011101011
+01101011101001011011
+01101100010111000000
+01101101010100111010
+01101101010111000110
+01101101111010000011
+01101101111111010010
+01110000010111111101
+01110010011101100011
+01110101000100011111
+01110101101110101101
+01110101110100111010
+01110101110111010010
+01110110000011000111
+01111000010100101110
+01111000101001111011
+01111000111010011010
+01111000111011000001
+01111000111110101010
+01111010101011000101
+01111011100011101101
+01111100000000010111
+01111100001101000000
+01111101000100011111
+01111110011001111011
+01111110100111111111
+01111111011010001001
+10000101010000000001
+10000101010100000000
+10001001010010010010
+10001011110010010111
+10001100010110011010
+10001100100001100101
+10001100100001100110
+10001100100011101101
+10001100110011011010
+10001111011111001101
+10010000111111010010
+10010010110101101100
+10010011110111101000
+10011001111111011001
+10011010011100011011
+10011010110111010010
+10011100100111000001
+10011101010110001110
+10110101111101100110
+10110110011010001100
+11000101010010111110
+11000101011111110110
+11001000000000000100
+11001001010001001110
+11001001010001101001
+11001001111010000000
+11010100000100010101
+11010101011100100000
+11011100001011100111
+11100110101100010101
+11100111101110101011
+11101011100011001111
+11111000100101011110
+11111000101010101010
+Started at Sat Apr 26 03:08:19 +0100 2008
+Took 2014.162627 seconds
+Generation number 11
+00000010110101101000
+00000100000001101101
+00000100000011101101
+00000100011100110111
+00000100110110111010
+00000101011000010011
+00001000001101011011
+00001000010100101110
+00001000010111011100
+00001000011011101011
+00001000100001011111
+00001001011011101111
+00001001111010000010
+00001011001100000010
+00001011011111000011
+00001011101110100100
+00001100000100000110
+00001100010011011110
+00001100010011011111
+00001101010010011111
+00001101100101000000
+00001110010011011001
+00001110010011011010
+00001110010011011110
+00001111000011101101
+00001111010011011010
+00001111010100101011
+00010001000110101011
+00010100000000111100
+00010100100011100110
+00010100100100010011
+00010101010000100100
+00010101010110000110
+00010101111100010110
+00010110111110000111
+00010111111100000010
+00011000000011001010
+00011000101001100101
+00011000101010101010
+00011001010110111111
+00011010011011100110
+00011010011100010011
+00011010100111010010
+00011101110101101010
+00011110100000111011
+00011110111111011011
+00011111111111011011
+00011111111111011011
+00100000010101111000
+00100000011000011010
+00100010000001010101
+00100100011100001011
+00100101111111110010
+00100111001110111101
+00101000000011001101
+00101000010100110111
+00101000011000010010
+00101000011011000111
+00101000110100101011
+00101000110100110110
+00101000110101010110
+00101000111010111011
+00101000111110101010
+00101001101000011110
+00101010010011100011
+00101100011010111101
+00101100111010011101
+00101100111011011100
+00101101001110001011
+00101101001111000111
+00101101010110110101
+00101101010111011001
+00101101011010111011
+00101110001011111001
+00110000111000101111
+00110000111001011010
+00110001111110001111
+00110010000011101010
+00110010010010111110
+00110010111111010101
+00110100010011111010
+00110100010111111011
+00110100011000010010
+00110100011000010100
+00110100011011011010
+00110101101111001011
+00110101110010011011
+00110110010110010100
+00110111000000001011
+00110111000100101111
+00111000000010001101
+00111000110001001110
+00111000111110000111
+00111001010100111010
+00111001011100000001
+00111010011111011001
+00111011001100011001
+00111100000011001111
+00111100010101100110
+00111100010110111001
+00111100011001011011
+00111100011111101011
+00111100100111000001
+00111101101001000111
+00111110001100000101
+00111110111100010110
+00111111001110111110
+00111111010110010100
+00111111101001100101
+01000000011011010101
+01000000011011101011
+01000000011101101001
+01000100000111111100
+01000100010111111111
+01000100101110010110
+01000101100000111011
+01000110010111111110
+01000111111110101001
+01001000011011101011
+01001010010110010101
+01001010111011000000
+01001100100011101101
+01001111001010111101
+01010000011110101011
+01010101000111101011
+01010101010010110110
+01010111000111101011
+01010111000111101011
+01011001001110000100
+01011001010111011011
+01011001111010011011
+01011011010000001011
+01011110000011110011
+01011110101111111011
+01100100000010000100
+01100100000101100000
+01100100000110101011
+01100100000111101011
+01100100010111111000
+01100100100011101110
+01100111101110101011
+01101000010100110111
+01101000011000010010
+01101000111010101011
+01101011110011001111
+01101101001110001011
+01101101010010111010
+01101101010110000110
+01101101010111000110
+01101111010100101011
+01110000101011000001
+01110011010111011010
+01110011011101100001
+01110101110110111110
+01110101110111011110
+01110101111110100100
+01110110000011010101
+01111000010011101011
+01111000111110111001
+01111010011111000101
+01111010101011000101
+01111011100011101011
+01111100001101100010
+01111101000110111111
+01111101010100010101
+01111110011010011101
+01111110101000011010
+01111111011001111110
+10000101000000001111
+10001000001001000000
+10001001010000111101
+10001011110011010011
+10001100010100011010
+10001100010110011010
+10001100010110011010
+10001100110011011010
+10001111110100110100
+10010010110101101100
+10010100000110011101
+10010101011000010010
+10011001110110110100
+10011110010001111010
+10011110011010001100
+10100111101110101011
+10101011100011011111
+10110101000100010101
+10111001000111011001
+11000101011110111111
+11001001010000111001
+11001100100111111100
+11011011010111110010
+11011110111100010110
+11100100011100001011
+11100100011110110111
+11100101011110011011
+11101011101011101011
+11101011111011000101
+11101100010110000100
+11110101001111111011
+11110101111010000100
+Started at Sat Apr 26 03:41:53 +0100 2008
+Took 2051.893687 seconds
+Generation number 12
+00000001011000010011
+00000010010100111010
+00000100000110101011
+00000100010111111011
+00000100011100110101
+00000100011100110111
+00000100100110111010
+00000100110110111010
+00000101001110011011
+00001000011000010010
+00001000011011000111
+00001000011011110100
+00001000111111111011
+00001001010001101011
+00001001011011101101
+00001001111010001010
+00001010000001010101
+00001010001101011111
+00001011010100101011
+00001011011111000001
+00001011101110100101
+00001100010011011011
+00001110010010001011
+00001110010010101111
+00001110010011011001
+00001110010011111010
+00001110101000011010
+00010001000110101011
+00010001000110101011
+00010001010000100100
+00010010100111000010
+00010011010111110010
+00010100010100010101
+00010100100011100110
+00010100110100010011
+00011000101001100101
+00011001010110111111
+00011001110111001011
+00011010011100010011
+00011011101110110110
+00011011110001001111
+00011100011000011010
+00011110010011011001
+00011110010110111010
+00011110111111111011
+00011111010100100110
+00011111010110010100
+00011111111111001011
+00100000000101111000
+00100000011011101011
+00100000111000101101
+00100001011000011010
+00100010000001010100
+00100010110101101100
+00100100000100111100
+00100100010011101011
+00100100011100011010
+00100101011010110100
+00100111101000011110
+00101000001011011010
+00101000011011001011
+00101000011011101011
+00101000111010111011
+00101000111110110110
+00101100000011001101
+00101100011001010110
+00101100111011011110
+00101101001111000111
+00101101010011011011
+00101101011000011111
+00101111010100101011
+00110000111010011010
+00110000111111011111
+00110001101110001111
+00110001111110001111
+00110011011000010011
+00110100000111101011
+00110100010111111011
+00110100011000010111
+00110100011011010010
+00110100111110101010
+00110101101111001001
+00110110001000011100
+00110111000100101010
+00111000000000111111
+00111000010101100111
+00111000011111000111
+00111000100001001110
+00111000110011011110
+00111000111010100001
+00111001000000001100
+00111001001000100001
+00111001011100000001
+00111001110001101000
+00111010001111011010
+00111100010101100110
+00111100010101101011
+00111100010101111011
+00111100011011001011
+00111100011111101111
+00111101000010011111
+00111101010010110110
+00111101010010110111
+00111101010111011001
+00111101110010011011
+00111110001110111110
+00111110011010011101
+00111110011111011010
+00111111101001111011
+01000000010101100110
+01000000011011010101
+01000000011011101111
+01000100000101100001
+01000100011010110100
+01000101100010001101
+01000110010101111011
+01000110010111111110
+01001000011011101011
+01001111001010101111
+01010000011000000010
+01010001111100001111
+01010100100011100110
+01010100111001011011
+01010111000111100011
+01011001010110111101
+01011100010110011010
+01011110011100011010
+01011110101110101010
+01011110101111111110
+01100100000110101011
+01100100100011101110
+01100100101110010110
+01100101000110000110
+01100101101111001011
+01100101111110011011
+01101000011000001011
+01101000011000010010
+01101000011101100001
+01101000101000011010
+01101000111010101010
+01101001010100110111
+01101001111011000101
+01101010010011011010
+01101011100011001011
+01101101010000111000
+01101101010110000110
+01101101010110000110
+01101111101110101011
+01110000010011101011
+01110000101011010000
+01110010111110111001
+01110100011000010010
+01110100110111011110
+01110101110110011111
+01110101110110111110
+01110110000011010101
+01110110000011110100
+01110110000110011010
+01110110010110000100
+01110111001110011111
+01111000010001000101
+01111000110011101011
+01111001110110000111
+01111010011110000111
+01111010101011101111
+01111101010010011111
+01111101010011111010
+01111101010100010101
+01111110011010011101
+01111110101101111011
+01111110101111001110
+01111110111010101010
+10000100000011100111
+10000101000000000001
+10001100010011011100
+10001100010111010101
+10001100100111111100
+10001111110111010101
+10010001000110011001
+10010001110110101011
+10011010001010100110
+10011110001111111011
+10101000011000010011
+10101000011100001011
+10101011011100100011
+10110011000000000101
+10111000101111111100
+10111011010100001110
+11001001010000111001
+11001010011100001011
+11001100110011011010
+11010101011110001011
+11011010111111010111
+11100100100011101110
+11100101010010110000
+11100101010011110110
+11100101010111011110
+11101011101011101011
+11101100100111111100
+11111101000110111101
+Started at Sat Apr 26 04:16:05 +0100 2008
+Took 2131.171748 seconds
+Generation number 13
+00000000000110101011
+00000000010111010110
+00000000011011101001
+00000001011000010011
+00000010010110111110
+00000100010111111011
+00000100100011100110
+00000100100111101110
+00000100111000001011
+00000101011100110001
+00000101101110011011
+00000110010110111110
+00001000011000010011
+00001000111001001111
+00001001010001100011
+00001001010001101011
+00001001010110111111
+00001001011011101100
+00001001101010001011
+00001001110010001010
+00001001110110000101
+00001010000001010100
+00001010010111111110
+00001010011111000001
+00001011011110111110
+00001011101110100101
+00001011111101100101
+00001100000011011011
+00001100100011101110
+00001101010011011011
+00001110010010000011
+00001110010111111011
+00001111011010111111
+00010000000110101101
+00010001010000100101
+00010001110000100100
+00010011010000100101
+00010100110100010101
+00010100110110111010
+00010110101111001110
+00011000111111111011
+00011001011011100110
+00011011100101100110
+00011011101010110110
+00011011101110110110
+00011011101110111110
+00011011110001001101
+00011011110110001010
+00011110001110101011
+00011110010110111010
+00011110010110111011
+00011110110011101011
+00011111010110010100
+00011111011100011010
+00100000111000011010
+00100001011000010011
+00100011011000000111
+00100011101010011110
+00100100011000111011
+00100100011010010100
+00100100101111111110
+00100111101100011111
+00101000011011101011
+00101000111110110100
+00101001011001011010
+00101001011011001011
+00101010101011101111
+00101011010100001100
+00101011111100001011
+00101100000111111011
+00101101001111011010
+00101101011001010111
+00101101011111001011
+00101110001000011100
+00110000001011101101
+00110001000111101001
+00110001111111111011
+00110010111010011010
+00110011000100001010
+00110011001001011011
+00110110001000011100
+00110110001010011110
+00110110011100001011
+00110111000100100111
+00111000001011011010
+00111000010000111111
+00111000011010110110
+00111000011101000001
+00111000011111000111
+00111000110111010101
+00111000111010100011
+00111000111110001111
+00111001001001110111
+00111001010111011111
+00111001011100000001
+00111010011010100001
+00111100010101011011
+00111100010111000111
+00111100011000010111
+00111100011011001011
+00111100110010011010
+00111100111110101010
+00111101000010011110
+00111101010010100001
+00111101110010011011
+00111110011110101111
+00111110101011101011
+00111110110010110000
+00111111010011110110
+00111111101101111011
+01000010010000111000
+01000101010001101111
+01000101100010001101
+01001000111111111011
+01001001111011000101
+01001010001101011111
+01001011010100101011
+01010001000111101011
+01010110000011110100
+01011000111000100011
+01011010011110000101
+01011010101111111110
+01011100010110011011
+01011100101111000001
+01011110010011001011
+01100000011111100001
+01100100101110001110
+01100101010111110110
+01100101011110001011
+01100101111110010011
+01100110000011110110
+01101000011100110101
+01101001010111000100
+01101001011111001011
+01101001101000011010
+01101011101110100011
+01101011111011000101
+01101100000011111011
+01101101010000111110
+01101101010100110101
+01101101010110011101
+01101101010111010110
+01101111111011000101
+01110000010001101011
+01110000011011101011
+01110100010101100110
+01110100011011010001
+01110100110111011101
+01110101010011111110
+01110101110110011011
+01110110000110111010
+01110110110110000101
+01111000010011001101
+01111000011111101011
+01111000111111111011
+01111001101110111111
+01111010011110001010
+01111100010100010101
+01111100101111100010
+01111101000101001011
+01111101010010011101
+01111101010100010101
+01111110101101111011
+01111110101111001010
+01111110111010101010
+01111110111011000110
+10000001011000011010
+10000101011000010011
+10001001111011001011
+10001100000101000001
+10001100010011010101
+10001100010111010101
+10001100010111011100
+10001100011011110000
+10010001110110101010
+10011000101001000001
+10011001010001010110
+10011110111010100001
+10011111111110010101
+10101011001001100101
+10101100101110100101
+10101101011110000110
+10110011000000000111
+10111100010001100110
+10111101010010110110
+11000000010101100000
+11001000011011000010
+11001000011100001111
+11001001010000111000
+11001010011100001010
+11010100011000001011
+11010110000110111010
+11100100101010011101
+11100100110011011001
+11100101010010110000
+11100101011010110001
+11100111010011011110
+11101000011000001111
+11110101010111011110
+11111101000110111111
+Started at Sat Apr 26 04:51:36 +0100 2008
+Took 2193.372392 seconds
+Generation number 14
+00000000010111010110
+00000000011010101000
+00000001011011011001
+00000010000110111010
+00000010010110110110
+00000011010000100101
+00000100100110101110
+00000100111000001011
+00000101011100110001
+00000101101100011011
+00000101111100110011
+00000110010110111100
+00000110010110111110
+00000110011010101011
+00001000010001101011
+00001000111001001110
+00001001010001010110
+00001001010001100010
+00001001010001101011
+00001001010001111110
+00001001010010011011
+00001001010010110110
+00001001010101001010
+00001001010110111110
+00001001011011101100
+00001011010110111111
+00001011011101001101
+00001011011111000010
+00001011100101100110
+00001011101110100101
+00001011101110100101
+00001011101110110000
+00001011110110000101
+00001011111100000011
+00001011111100001011
+00001100000011011011
+00001100000110101011
+00001100000111111011
+00001100010111101001
+00001101010011011011
+00001110000011011011
+00001110010111111101
+00001110101010011100
+00001110101111001110
+00001110111011000110
+00001111011010111010
+00010000101010101010
+00010001000111101011
+00010001010000001011
+00010001010000100101
+00010100000011011011
+00010100011111100110
+00010100100011000110
+00010100110111000111
+00011000011100010011
+00011000111010100011
+00011001010011100110
+00011001110100010101
+00011001110110101111
+00011011100101101010
+00011011101101100110
+00011011101110000101
+00011011101110111111
+00011100010111111011
+00011100110011101011
+00011101011100110101
+00011110001100011010
+00011110001110101010
+00011110011100011010
+00011110111010110001
+00011111111110010101
+00100100011011011111
+00100110011101001011
+00101000110000001011
+00101000111111111011
+00101001010001111010
+00101001011001011010
+00101010011010100001
+00101101011001010111
+00101110001000011100
+00110000011000011011
+00110001011011001011
+00110010111010011010
+00110100101110001110
+00110100110110111010
+00110110011000010011
+00110111000100100111
+00111000010010001010
+00111000110110100001
+00111000110111010101
+00111000110111010101
+00111001010111010110
+00111001011100010111
+00111010011110000101
+00111011100011101111
+00111011100101100110
+00111100010110110010
+00111100010111010101
+00111100011000000101
+00111100011011001001
+00111100011011001011
+00111100110000011011
+00111100111011001011
+00111100111110101010
+00111100111110101011
+00111101010010011101
+00111101010011010101
+00111101100101001011
+00111110010111101111
+00111110011000001011
+00111110011110101111
+00111110101010101111
+00111110110000110011
+00111110110010110000
+00111110111111101011
+00111111010011110110
+00111111110010100101
+01000001100010001101
+01000101010010000011
+01001000011110111110
+01001000111110110100
+01001001011111000111
+01001010001101010100
+01001010010111010110
+01001011010100101011
+01001101110110000101
+01011010011110111110
+01011011110000110100
+01011100010011100101
+01011100101111000001
+01011110010011011110
+01100000010001101011
+01100101010111111110
+01100101011111110110
+01100110110110000101
+01101001111111001111
+01101100000011111011
+01101101000100110101
+01101101010000111110
+01101101010010011101
+01101110000110101011
+01101111010011101011
+01101111111011000101
+01110000011110110100
+01110100010101100111
+01110100011011010001
+01110101010111101011
+01110101111011101011
+01111000010011001101
+01111000011011101011
+01111000011111101011
+01111000011111101011
+01111001001110111110
+01111001101110111111
+01111011010100001100
+01111100101111100011
+01111100111101100010
+01111101000110111111
+01111101010011110110
+01111110100110010001
+01111110101111001110
+01111111111010101010
+01111111111010101101
+01111111111101100101
+10000001001010010011
+10000001101110111110
+10000101101110011000
+10001001011100000001
+10001010111100001010
+10001101001101111011
+10001101010010110001
+10011001010001010100
+10011001010001100001
+10011011000001101101
+10011111110110010100
+10101000010110011011
+10101011010100001100
+10101100111101000000
+10110001000111110111
+10110011000100001000
+10110110010110111100
+10111000111111001011
+10111101010010111110
+10111101010011110110
+11000100101010011101
+11000101010001101111
+11001000011100001111
+11001010011100001010
+11001010011110111110
+11001011010101100110
+11010100011000001011
+11011000010000111110
+11011110000110111010
+11100100101010011010
+11100100110000010011
+11100100110011011001
+11101100000011111011
+11101100011100110101
+11110100110111011101
+11111101000110111110
+Started at Sat Apr 26 05:28:09 +0100 2008
+Took 2335.23266 seconds
+Generation number 15
+00000000010011011011
+00000000011000101000
+00000001010000001011
+00000001011011000101
+00000001011011011001
+00000011010000100101
+00000011010000111001
+00000100101101100101
+00000101111101100111
+00000111110010100101
+00001000010011010101
+00001000010100100011
+00001000010101101011
+00001000010110110110
+00001000100110101001
+00001000111001001110
+00001001001001010110
+00001001010000001011
+00001001010000010110
+00001001010001010110
+00001001010001010111
+00001001010010110110
+00001001010010110110
+00001001011011101100
+00001001110111000110
+00001010111011101011
+00001011011110001011
+00001011100101100101
+00001011101010010101
+00001011101011110001
+00001011101110100110
+00001011110110000101
+00001011111010001011
+00001011111100001011
+00001011111110100101
+00001100000011011011
+00001100000011111011
+00001100000110101011
+00001100110010111010
+00001100111011101011
+00001101010010110001
+00001110000011011011
+00001110000011111011
+00001110001000011100
+00001110010010110000
+00001110010111100111
+00001110010111111001
+00001110110111010101
+00001111000011011011
+00001111001010111110
+00001111011110111010
+00010011101110100000
+00010100011110100110
+00010100101110111111
+00010100110111000111
+00010101000011111011
+00011000011100011111
+00011001101110110110
+00011001110100010101
+00011001110110100010
+00011001111100010011
+00011010011100011110
+00011011101001101110
+00011011101101100110
+00011011101110111111
+00011100000011011011
+00011100010111100101
+00011100101100100101
+00011100111110101011
+00011101010000010011
+00011101011011001000
+00011101110110101111
+00011110001100000101
+00011110001100011011
+00011110001100011011
+00011110001111001101
+00011110011100011010
+00011110111101100110
+00011111110110010100
+00011111110110010111
+00100000010001101011
+00100010010001101011
+00101000111001001110
+00101001010010011010
+00101001010101001000
+00101001010111000010
+00101001011010101000
+00101001110111010111
+00101100001011001011
+00101100010111100110
+00101101010000100010
+00101101010011010101
+00101111011110011010
+00110011010110111111
+00110100011001011010
+00110100011100000101
+00110100011111100110
+00110100100110100110
+00110100110110111010
+00110100110110111110
+00110100110111111010
+00110100110111111010
+00110110001100000010
+00110110010111101110
+00111000100110101110
+00111000110011010101
+00111000110110111110
+00111001010110111111
+00111001011100010001
+00111001011100100111
+00111001110011101111
+00111010011110000101
+00111010011110011010
+00111011010111010000
+00111100011000001010
+00111100110111011010
+00111100111110100010
+00111101010001100010
+00111101111000110101
+00111110010100000111
+00111110010111010110
+00111110011101101111
+00111110011110101111
+00111110110010111000
+00111110111100011010
+01000000010010011011
+01000001100010001101
+01000100101011000110
+01001000111110110100
+01001001011011101000
+01001010001101010100
+01001011010001111011
+01001011010100101011
+01001011010100110100
+01001011110110000101
+01001011111110110100
+01001100010111100001
+01001101110110000101
+01001101110110000101
+01010101111000001011
+01011010011110111010
+01011011010000110100
+01011110000110111011
+01100000010001101011
+01100000010101101011
+01100100110111011001
+01100101011111110110
+01100110110010001011
+01100110110100000110
+01101000010101000110
+01101001011111000111
+01101011111111001111
+01101100000011111011
+01101110101010011100
+01101110111101000000
+01101111111011000100
+01110000011110101001
+01110000011110110100
+01110010011001101011
+01110011010000001100
+01111000010010100010
+01111000110011010101
+01111001011011100010
+01111010101110101110
+01111100111101101101
+01111100111101110010
+01111101000110010011
+01111101010011110111
+01111101110011110010
+01111110101110001111
+01111111011101100101
+01111111110110101010
+10000100010110111100
+10000101101110011001
+10000101111110110011
+10001100000111101011
+10001101001101111010
+10011000010001101110
+10011100110011100101
+10011101001101110011
+10011110010011100010
+10011111110111111101
+10100000011000010011
+10101100110101010000
+10101111010000111110
+10110010110110111100
+10110101010001011011
+10111110101111001110
+11000100100101100110
+11001001010010011011
+11001010011001011011
+11001010011110111010
+11011000000000111101
+11011000010000010101
+11011110000110110101
+11100100101010011110
+11100100101010011110
+11100100110000010101
+11101100000011011011
+11111101000110111110
+Started at Sat Apr 26 06:07:05 +0100 2008
+Took 2289.021254 seconds
+Generation number 16
+00000000010011011011
+00000001010000010111
+00000010111011110111
+00000011000000111001
+00000011110110000010
+00000100100101100110
+00000100101011000110
+00000100110000010101
+00000101000110111110
+00000101111011001101
+00000111011011001000
+00000111100010100100
+00000111100010100101
+00000111110010001011
+00001000010010110000
+00001000010100100110
+00001000110001001110
+00001000110100010101
+00001000110110100101
+00001001000110100111
+00001001010000010110
+00001001010001011011
+00001001010101100111
+00001001010110111111
+00001001011011101100
+00001001111110010011
+00001010000001001011
+00001010111101100110
+00001011010010011110
+00001011101011110010
+00001011101011110100
+00001011101110100100
+00001011111100001001
+00001011111100011011
+00001011111110110100
+00001100010010111000
+00001100011001101011
+00001101010001001010
+00001101010010110001
+00001101110110101010
+00001101111011011001
+00001110000011011011
+00001110000111101011
+00001110010000001011
+00001110010010110000
+00001110010011100111
+00001110100110100110
+00001111001010111110
+00001111001010111110
+00001111001010111110
+00001111100101100101
+00001111110110000100
+00010000011000101000
+00010011101110101111
+00010100011001011011
+00010100011110100010
+00010101000011110101
+00011000011100011111
+00011000110110111110
+00011001010001010101
+00011001110100010101
+00011001110100101110
+00011010010000011011
+00011011010100110100
+00011011101011101011
+00011011101101101110
+00011011101111011101
+00011100000011111110
+00011100001100001011
+00011100010100001111
+00011100101100100101
+00011100101101000101
+00011101000000111111
+00011101110010101011
+00011101110110101010
+00011110001100000101
+00011110111101100110
+00011111000010010000
+00011111011100011110
+00011111110110010101
+00011111111100001010
+00100000010001100010
+00100010010001101111
+00100010010011000010
+00100011010001101011
+00100011010010100101
+00100101010010100001
+00101001010010011010
+00101001010110000101
+00101001110111010111
+00101010111011000011
+00101011111100100101
+00101100001011001011
+00101100001011010100
+00101100010001011001
+00101101010111001011
+00101101110111010000
+00101110111101000000
+00110000010110101010
+00110000110000001010
+00110011010010110110
+00110011011110110111
+00110011110110100000
+00110100010110111110
+00110100011011101100
+00110100011100000101
+00110100110110111010
+00110110001100010010
+00110110110111101010
+00111000100110101110
+00111000101110101010
+00111001000011011011
+00111001010010011010
+00111001011100110110
+00111010001110000101
+00111010010111100111
+00111010011110000101
+00111011010000110100
+00111011010011010000
+00111011010111100110
+00111100011110111010
+00111100110111011000
+00111100111110000010
+00111101110111111010
+00111110010100000110
+00111110011011111010
+00111110011101101111
+00111110011110000101
+01000100101010000110
+01000100101011000110
+01001001010001110111
+01001001110111111010
+01001010011100101011
+01001011011110111010
+01001011100110010101
+01001100101011000110
+01001110101110101011
+01001110110110101111
+01010001011001101011
+01011000001010111010
+01011000011100011111
+01011000110011010101
+01011000110011110101
+01011011100011110001
+01011011110101000000
+01011100001001011110
+01011111110110000101
+01100000010100100011
+01100100110001100110
+01100100110111111001
+01100110110010011011
+01101000010000001011
+01101101010000100011
+01110001011110101001
+01110011010110011110
+01111000010010100010
+01111000100011010101
+01111000100110101100
+01111000110011110101
+01111010111110101110
+01111100111101101101
+01111101100011111111
+01111111011011001100
+01111111110110101111
+10000000001000100101
+10000100010110111100
+10001000110100101011
+10001001011011101100
+10001001110111000110
+10001011011110001011
+10001110000111101011
+10001111010110111111
+10010101110110101111
+10011000010001010101
+10011010010011100010
+10011010011110011010
+10011101101100100101
+10011101110101010111
+10011110000010100101
+10101001011000101000
+10101111010011111011
+10110101010001010110
+10111001111001001110
+11000001011011000101
+11000100101011000110
+11001001010010011011
+11001010011001011010
+11001011010010100101
+11001101001101011010
+11001101010010110001
+11010000010000010101
+11011000000000111001
+11011000010000010100
+11011000010001001111
+11011000010010010101
+11011001010011011011
+11100000010001101011
+11100100101010011011
+11111000111101101101
+11111001100010001111
+Started at Sat Apr 26 06:45:14 +0100 2008
+Took 2222.522446 seconds
+Generation number 17
+00000000000000010010
+00000000001010101000
+00000000010000101011
+00000010000000111001
+00000010011011100011
+00000011000000000101
+00000011000000111001
+00000011101110110100
+00000011110110000010
+00000100100000010101
+00000100101101111010
+00000100110000010101
+00000101000110111110
+00000101110100010101
+00000101111011001101
+00000110001001011010
+00000111010001110111
+00000111011011001001
+00000111110010100100
+00001000010010110100
+00001000010100100111
+00001000110110100101
+00001000110110100101
+00001001010000010110
+00001001010001001010
+00001001010011011111
+00001001010110101001
+00001001011011101100
+00001001100010100101
+00001001110011011011
+00001001111100000001
+00001001111110010011
+00001010000001001011
+00001010111100011011
+00001010111101100011
+00001011001110100100
+00001011010110111111
+00001011101011110001
+00001011101011110011
+00001011110110101010
+00001011111100001001
+00001100010011110001
+00001100101111100110
+00001100110001101110
+00001101001101011010
+00001101010001101010
+00001101010111100110
+00001101010111101011
+00001
\ No newline at end of file
diff --git a/lib/.svn/all-wcprops b/lib/.svn/all-wcprops
new file mode 100644
index 0000000..8034615
--- /dev/null
+++ b/lib/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 41
+/svn/njae/!svn/ver/6/TrapTheCap/trunk/lib
+END
diff --git a/lib/.svn/entries b/lib/.svn/entries
new file mode 100644
index 0000000..691e062
--- /dev/null
+++ b/lib/.svn/entries
@@ -0,0 +1,100 @@
+8
+
+dir
+68
+http://scripts.njae.me.uk/svn/njae/TrapTheCap/trunk/lib
+http://scripts.njae.me.uk/svn/njae
+
+
+
+2008-04-25T21:36:06.714616Z
+6
+neil
+
+
+svn:special svn:externals svn:needs-lock
+
+
+
+
+
+
+
+
+
+
+
+0ada9808-85ab-4924-adda-5bf89eae3818
+
+libttc.rb
+file
+69
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+deleted
+
+libpplayer.rb
+file
+69
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+deleted
+
+libgenetics.rb
+file
+69
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+deleted
+
diff --git a/lib/.svn/format b/lib/.svn/format
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/lib/.svn/format
@@ -0,0 +1 @@
+8
diff --git a/lib/.svn/text-base/libpplayer.rb.netbeans-base b/lib/.svn/text-base/libpplayer.rb.netbeans-base
new file mode 100644
index 0000000..cf80ee5
--- /dev/null
+++ b/lib/.svn/text-base/libpplayer.rb.netbeans-base
@@ -0,0 +1,106 @@
+# == Synopsis
+#
+# Library to support a Trap the Cap player that uses potentials to select the
+# best move
+#
+# == Author
+# Neil Smith
+#
+# == Change history
+# Version 1.1:: 23 April 2008
+
+require 'lib/libttc'
+require 'lib/libgenetics'
+
+
+# Play Trap the Cap by using potential fields. For each possible move,
+# calculate the field strength and pick the move with the lowest potential
+class Potential_player
+
+ attr_reader :friend_pull, :enemy_pull, :base_pull,
+ :safe_bonus, :capture_bonus
+
+ def initialize(args, verbose = false)
+ @friend_pull = args[:friend_pull] || 1
+ @enemy_pull = args[:enemy_pull] || 0.5
+ @base_pull = args[:base_pull] || 2
+ @safe_bonus = args[:safe_bonus] || 8
+ @capture_bonus = args[:capture_bonus] || 10
+
+ @verbose = verbose
+ end
+
+ # Find the best move of the possible ones
+ def best_move(game, die_result)
+ me = game.current_player
+ possible_moves = game.possible_moves(die_result, me)
+ scored_moves = possible_moves.collect do |m|
+ begin
+ game.apply_move! m
+ score = score_position(game, me)
+# game.undo_move!
+ rescue GameWonNotice
+ score = 10000
+ ensure
+ game.undo_move!
+ end
+ puts "#{m} scores #{score}" if @verbose
+ [m, score]
+ end
+ best_move = (scored_moves.max {|a, b| a[1] <=> b[1]})[0]
+ end
+
+ # Calculate the potential score of a position for a given player
+ def score_position(game, player)
+ score = 0
+ game.pieces.each_value do |piece|
+ here = piece.position
+ if piece.colour == player
+ game.pieces.each_value do |other_piece|
+ if other_piece.colour == player
+ score += game.board.distance_between[here.place][other_piece.position.place] * @friend_pull
+ else
+ score += game.board.distance_between[here.place][other_piece.position.place] * @enemy_pull
+ end
+ end
+ score += piece.contains.length * @capture_bonus
+ score += game.board.distance_between[here.place][game.board.positions[player].place] *
+ piece.contains.length * @base_pull
+ elsif here == game.board.positions[player]
+ score += @safe_bonus
+ end
+ end
+ score
+ end
+
+
+ # Convert a player to a bitstring
+ def to_bitstring
+ (@friend_pull * 4).to_i.to_bitstring(4).gray_encode +
+ (@enemy_pull * 4).to_i.to_bitstring(4).gray_encode +
+ (@base_pull * 4).to_i.to_bitstring(4).gray_encode +
+ @safe_bonus.to_bitstring(4).gray_encode +
+ @capture_bonus.to_bitstring(4).gray_encode
+ end
+
+ # Convert a player to a genome
+ def to_genome
+ Genome.new(self.to_bitstring)
+ end
+end
+
+
+class Genome
+
+ # Create a potential player from a genome
+ def to_potential_player
+ friend_pull = @genome[0, 4].gray_decode.to_decimal.to_f / 4
+ enemy_pull = @genome[4, 4].gray_decode.to_decimal.to_f / 4
+ base_pull = @genome[8, 4].gray_decode.to_decimal.to_f / 4
+ safe_bonus = @genome[12, 4].gray_decode.to_decimal
+ capture_bonus = @genome[16, 4].gray_decode.to_decimal
+ Potential_player.new({:friend_pull => friend_pull,
+ :enemy_pull => enemy_pull, :base_pull => base_pull,
+ :safe_bonus => safe_bonus, :capture_bonus => capture_bonus})
+ end
+end
diff --git a/lib/.svn/text-base/libttc.rb.netbeans-base b/lib/.svn/text-base/libttc.rb.netbeans-base
new file mode 100644
index 0000000..97845c7
--- /dev/null
+++ b/lib/.svn/text-base/libttc.rb.netbeans-base
@@ -0,0 +1,615 @@
+# == Synopsis
+#
+# Library to support Trap the Cap play
+#
+# == Author
+# Neil Smith
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+# == Change history
+# Version 1.1:: 07 Sep 2007
+# * Changed format for showing moves via bases.
+# * Raise error when moving via base without captured pieces
+# * Raise error when moving onto a safe space with 3 or more
+# pieces already there
+# Version 1.2:: 10 Sep 2007
+# * Incorporated changes in move legality above into
+# Game#possible_moves
+# Version 1.3:: 25 Mar 2008
+# * Fixed bug to detect a winner, and also eliminate players
+# that have no uncaptured pieces.
+
+# Errors for a game
+
+# Pieces can only capture pieces that they're on.
+class InvalidCaptureError < StandardError
+end
+
+# Moves can only be [1..6] spaces
+class InvalidMoveError < StandardError
+end
+
+# Game is won when only one player has uncaptured pieces
+class GameWonNotice < StandardError
+end
+
+
+# Each possible position for a piece is an object
+# Each neighbour is another position object
+class Position
+ attr_reader :place # the name of this place
+ attr_accessor :contains # the pieces it contains
+ attr_accessor :neighbours # the positions that neighbour it
+
+ def initialize(place, safety, base)
+ @place = place
+ @safe = safety
+ @base = base
+ @neighbours = Array.new
+ end
+
+ # is this position a safety one (i.e. no captures allowed)?
+ def safe?
+ @safe
+ end
+
+ # Is this position a base?
+ def base?
+ @base
+ end
+
+ def to_s
+ @place
+ end
+
+ def to_str
+ to_s
+ end
+
+end
+
+
+# The game board
+class Board
+
+ attr_reader :positions
+ attr_reader :valid_moves
+ attr_reader :distance_between
+ attr_reader :centre
+
+
+ # A laborious procedure to create all the positions and tie them all together
+ def initialize(spokes, spoke_length, arc_length)
+ # A hash of all positions, indexed by position names
+ @positions = Hash.new
+ @centre = Position.new('ac' + spoke_length.to_s, false, false)
+ @positions['ac' + spoke_length.to_s] = centre
+ a1_corner = nil
+ end_of_previous_arc = nil
+
+ # Do each arc-spoke-base set
+ (?a...(?a + spokes)).each do |arc_code|
+ arc = arc_code.chr
+ base = Position.new(arc, false, true)
+ this_arc = Array.new
+
+ # build the arc
+ (1..arc_length).each do |arc_position|
+ position_name = arc + arc_position.to_s
+ arc_place = Position.new(position_name, arc_position == 4, false)
+ arc_place.neighbours = []
+ @positions[position_name] = arc_place
+ this_arc << arc_place
+ a1_corner = a1_corner || arc_place
+ end
+ (0...arc_length).each do |arc_position|
+ if arc_position > 0
+ this_arc[arc_position].neighbours << this_arc[arc_position - 1]
+ end
+ if arc_position < (arc_length - 1)
+ this_arc[arc_position].neighbours << this_arc[arc_position + 1]
+ end
+ end
+
+ # build the spoke
+ this_spoke = Array.new
+ (1..(spoke_length - 1)).each do |spoke_position|
+ position_name = arc + "c" + spoke_position.to_s
+ spoke_place = Position.new(position_name, spoke_position == 3, false)
+ spoke_place.neighbours = []
+ @positions[position_name] = spoke_place
+ this_spoke << spoke_place
+ end
+ (0...(spoke_length - 1)).each do |spoke_position|
+ if spoke_position > 0
+ this_spoke[spoke_position].neighbours << this_spoke[spoke_position - 1]
+ end
+ if spoke_position < spoke_length - 2
+ this_spoke[spoke_position].neighbours << this_spoke[spoke_position + 1]
+ end
+ end
+
+ # tie the spoke and arc together,
+ this_arc[0].neighbours << this_spoke[0]
+ this_spoke[0].neighbours << this_arc[0]
+
+ # tie the spoke to the centre, and
+ this_spoke[-1].neighbours << @centre
+ @centre.neighbours << this_spoke[-1]
+
+ # tie the base to the arc
+ base = Position.new(arc, false, true)
+ @positions[arc] = base
+ base.neighbours << this_arc[0]
+ this_arc[0].neighbours << base
+
+ # record the ends of the arc for tying to adjacent arcs
+ if end_of_previous_arc
+ end_of_previous_arc.neighbours << this_arc[0]
+ this_arc[0].neighbours << end_of_previous_arc
+ end
+ end_of_previous_arc = this_arc[-1]
+
+ end # arc
+
+ # tie both ends of the rim together
+ a1_corner.neighbours << end_of_previous_arc
+ end_of_previous_arc.neighbours << a1_corner
+
+ cache_valid_moves
+
+ end # def
+
+ def to_s
+ layout
+ end
+
+ def to_str
+ to_s
+ end
+
+
+ # For each position, show its name and what it touches
+ def layout
+ out_string = ""
+ @positions.keys.sort.each do |position|
+ out_string << sprintf("%s touches ", @positions[position])
+ @positions[position].neighbours.each do |neighbour|
+ out_string << sprintf("%s, ", neighbour)
+ end
+ out_string << sprintf("\n")
+ end
+ out_string
+ end
+
+
+ # Precompute the valid moves for this board, and the distances between each
+ # pair of positions
+ def cache_valid_moves
+ # A hash of arrays. The has key is the name of a positions. The array
+ # element [i] stores the positions that are i spaces from here
+ @valid_moves = Hash.new
+ # A hash of hashes. Given two names, return the shortest distance between
+ # the two locations
+ @distance_between = Hash.new
+ @positions.each do |place, position|
+ @valid_moves[place] = Array.new
+ @distance_between[place] = Hash.new
+ @valid_moves[place][0] = [@positions[place]]
+ @distance_between[place][place] = 0
+ # Find the shortest routes by Dijkstra's algorithm
+ agenda = [position]
+ closed_list = [position]
+ i = 1
+ while not agenda.empty?
+ @valid_moves[place][i] = []
+ new_agenda = []
+ agenda.each do |pos|
+ valid_extensions = pos.neighbours.reject {|new_position| closed_list.include?(new_position) }
+ @valid_moves[place][i] += valid_extensions
+ valid_extensions.each {|ext| @distance_between[place][ext.place] ||= i }
+ closed_list += valid_extensions
+ new_agenda += valid_extensions
+ end
+ agenda = new_agenda
+ i += 1
+ end
+ end
+ end
+
+end
+
+
+# Each piece on the board is an object
+class Piece
+ attr_reader :colour
+ attr_accessor :position, :contains, :captured
+
+ def initialize(number, position, colour)
+ @number = number
+ @position = position
+ @colour = colour
+ @captured = false
+ @contains = []
+ end
+
+ def name
+ @colour + @number.to_s
+ end
+
+ def to_s
+ self.name
+ end
+
+ def to_str
+ to_s
+ end
+
+ def move_to(new_position)
+ @position = new_position
+ @contains.each {|c| c.move_to(new_position)}
+ end
+
+ # Caputre another piece
+ def capture(other_piece)
+ if @position = other_piece.position
+ @contains << other_piece
+ @contains += other_piece.contains
+ other_piece.contains = []
+ other_piece.captured = true
+ else
+ raise(InvalidCaptureError,
+ "Piece #{self.name} cannot capture #{other_piece.name}: different locations")
+ end
+ end
+
+end
+
+
+# A move in a game
+class Move
+ attr_reader :piece, :destination
+
+ def initialize(piece, destination, via_base = false)
+ @piece = piece
+ @destination = destination
+ @via_base = via_base
+ end
+
+ def via_base?
+ @via_base
+ end
+
+ # Write a move to a string
+ # Note the inverse, String#to_move, is defined below
+ def to_s
+ if @via_base
+ if @destination.base?
+ @piece.to_s + " " + @destination.to_s
+ else
+ @piece.to_s + " " + piece.colour + " " + @destination.to_s
+ end
+ else
+ @piece.to_s + " " + @destination.to_s
+ end
+ end
+
+ def to_str
+ to_s
+ end
+
+end
+
+
+
+# A class to record each of the states previously found in a game.
+# Note that this is a deep copy of the pieces and what they've captured, so
+# you'll need to convert back
+class GameState
+ attr_accessor :move, :player, :pieces_after_move
+
+ def initialize(move, player, pieces)
+ @move = move
+ @player = player
+ @pieces_after_move = Hash.new
+ pieces.each {|k, p| @pieces_after_move[k] = p.dup}
+ @pieces_after_move.each_value {|p| p.contains = []}
+ # and now to make the captured pieces point to the copies
+ pieces.each do |k, p|
+ p.contains.each do |captured_piece|
+ @pieces_after_move[k].capture(@pieces_after_move[captured_piece.name])
+ end
+ end
+ end
+
+ def ==(other)
+ @move.to_s == other.move.to_s and
+ @player == other.player and
+ @piece_after_move == other.pieces_after_move
+ end
+
+end
+
+
+# A game of Trap the Cap. It keeps a history of all previous states.
+class Game
+
+ attr_reader :history
+ attr_reader :current_player, :players
+ attr_reader :board
+ attr_reader :pieces
+
+ # Create a new game
+ def initialize(players = 6, spokes = 6, spoke_length = 6, arc_length = 6,
+ pieces_each = 6)
+ @board = Board.new(spokes, spoke_length, arc_length)
+ @history = []
+ @pieces = Hash.new
+ @players = case
+ when players == 2 ; ['a', 'd']
+ when players == 3 ; ['a', 'c', 'e']
+ when players == 4 ; ['a', 'b', 'd', 'e']
+ when players == 5 ; ['a', 'b', 'c', 'd', 'e']
+ when players == 6 ; ['a', 'b', 'c', 'd', 'e', 'f']
+ end
+ @current_player = 'a'
+ @players.each do |player|
+ players_base = @board.positions[player]
+ (1..pieces_each).each do |count|
+ piece = Piece.new(count, players_base, player)
+ @pieces[player + count.to_s] = piece
+ end
+ end
+ end
+
+
+ # Apply a single move to a game.
+ def apply_move!(move, player = @current_player)
+ # Check the move is a valid one
+ raise(InvalidMoveError, "Piece #{move.piece} does not exist") unless @pieces.has_key?(move.piece.name)
+ raise(InvalidMoveError, "Player #{player} moving piece #{move.piece}") unless move.piece.colour == player
+ raise(InvalidMoveError, "Attempting to move captured piece #{move.piece}") if move.piece.captured
+ raise(InvalidMoveError, "Attempting to move #{move.piece} onto or via base without captured pieces") if move.via_base? and move.piece.contains.empty?
+ if move.destination.safe?
+ if (@pieces.find_all {|k, p| p.position == move.destination}).length >= 3
+ raise(InvalidMoveError, "Attempting to move #{move.piece} onto safe position #{move.destination} when there are already three or more pieces there")
+ end
+ end
+ if move.via_base?
+ moved_distance = board.distance_between[move.piece.position.place][player] +
+ board.distance_between[player][move.destination.place]
+ else
+ moved_distance = board.distance_between[move.piece.position.place][move.destination.place]
+ end
+ raise(InvalidMoveError, "Attempting to move piece #{move.piece} #{moved_distance} places (from #{move.piece.position} to #{move.destination})") if moved_distance < 1 or moved_distance > 6
+
+ # Apply this move
+ move.piece.move_to(move.destination)
+
+ # Capture anything already there (unless it's a safe place or a base,
+ # or our own colour, or already captured)
+ unless move.destination.safe? or move.destination.base?
+ @pieces.each do |name, target_piece|
+ if target_piece.position == move.destination and
+ target_piece != move.piece and
+ not move.piece.contains.member?(target_piece) and
+ target_piece.colour != player and
+ not target_piece.captured
+ move.piece.capture(target_piece)
+ end
+ end
+ end
+
+ # If the move was via our base, drop all captured pieces
+ if move.via_base?
+ capturers_base = board.positions[move.piece.colour]
+ move.piece.contains.each do |captured_piece|
+ captured_piece.move_to capturers_base
+ captured_piece.captured = false if captured_piece.colour == move.piece.colour
+ end
+ move.piece.contains = []
+ end
+
+ # Record the new stae
+ this_game_state = GameState.new(move, player, @pieces)
+ @history << this_game_state
+
+ # Retain only players that have uncaptured pieces.
+ # If there's only one player with uncaptured pieces, declare a win.
+ potential_players = []
+ @players.each do |p|
+ if (@pieces.values.select {|piece| piece.colour == p}).any? {|piece| not piece.captured}
+ potential_players << p
+ end
+ # potential_players << p if (@pieces.values.select {|p| p.colour == @current_player}).any? {|p| not p.captured}
+ end
+ if potential_players.length <= 1
+ raise(GameWonNotice, "Game won by #{potential_players[0]}")
+ end
+ @players = potential_players.sort
+ end
+
+ # Undo a move
+ def undo_move!
+ if @history.length > 1
+ # general case
+ state_to_restore = @history[-2]
+ @current_player = @history[-1].player
+ @pieces.each do |name, piece|
+ copy_piece = state_to_restore.pieces_after_move[name]
+ piece.position = copy_piece.position
+ piece.captured = copy_piece.captured
+ piece.contains = []
+ copy_piece.contains.each do |p|
+# piece.capture(@pieces[p.name])
+ piece.contains << @pieces[p.name]
+ end
+ end
+ @history.pop
+ elsif @history.length == 1
+ # reset to start
+ @current_player = 'a'
+ @pieces.each do |name, piece|
+ piece.position = @board.positions[piece.colour]
+ piece.captured = false
+ piece.contains = []
+ end
+ @history.pop
+ end
+ end
+
+ # Apply a list of moves in order
+ def apply_moves!(moves)
+ moves.each do |move|
+ if move.via_base?
+ moved_distance = board.distance_between[move.piece.position.place][@current_player] +
+ board.distance_between[@current_player][move.destination.place]
+ else
+ moved_distance = board.distance_between[move.piece.position.place][move.destination.place]
+ end
+ self.apply_move!(move, @current_player)
+ next_player! unless moved_distance == 6
+ end
+ end
+
+
+ # Set the current player to be the next player
+ def next_player!
+ original_player = @current_player
+ begin
+ if @current_player == @players[-1]
+ @current_player = @players[0]
+ else
+ @current_player = @players[@players.index(@current_player) + 1]
+ end
+ end while (@pieces.values.select {|p| p.colour == @current_player}).all? {|p| p.captured} and @current_player != original_player
+ @current_player
+ end
+
+
+ # Return an array of all possible moves from this state, given the die roll
+ # and the active player
+ def possible_moves(die_result, player = @current_player)
+ moves = []
+ @pieces.each do |key, piece|
+ # only move current player's pieces, and only if they're not captured
+ if piece.colour == player and (not piece.captured)
+ (@board.valid_moves[piece.position.place][die_result]).each do |destination|
+ if destination.safe?
+ if (@pieces.find_all {|k, p| p.position == destination}).length < 3
+ moves << Move.new(piece, destination, false)
+ end
+ else
+ moves << Move.new(piece, destination, false) unless destination.base?
+ end
+ end
+ # if we can move to our base (but not already on it), add moves via that...
+ if @board.distance_between[piece.position.place][player] <= die_result and
+ not piece.position.place == player and
+ not piece.contains.empty?
+ distance_after_base = die_result - @board.distance_between[piece.position.place][player]
+ (@board.valid_moves[player][distance_after_base]).each do |destination|
+ if destination.safe?
+ if (@pieces.find_all {|k, p| p.position == destination}).length < 3
+ moves << Move.new(piece, destination, true)
+ end
+ else
+ moves << Move.new(piece, destination, true)
+ end
+ end
+ end
+ end
+ end
+ moves
+ end
+
+
+ def build_state_string
+ outstr = "Current player = #{@current_player}\n"
+ @pieces.keys.sort.each do |piece_name|
+ if @pieces[piece_name].captured
+ outstr << "Piece #{piece_name} captured, at #{@pieces[piece_name].position}\n"
+ else
+ outstr << "Piece #{piece_name} is at #{@pieces[piece_name].position}, holds #{(@pieces[piece_name].contains.collect{|c| c.name}).join(' ')}\n"
+ end
+ end
+ outstr
+ end
+
+ # Show the state of the board
+ def show_state
+ puts build_state_string
+# @pieces.keys.sort.each do |piece_name|
+# if @pieces[piece_name].captured
+# puts "Piece #{piece_name} captured, at #{@pieces[piece_name].position}"
+# else
+# puts "Piece #{piece_name} is at #{@pieces[piece_name].position}, holds #{(@pieces[piece_name].contains.collect{|c| c.name}).join(' ')}"
+# end
+# end
+ end
+
+ def to_s
+ show_state
+ end
+
+ def to_str
+ to_s
+ end
+
+
+ # Given a set of lines from an input file, turn them into a Game object and
+ # a set of Move objects.
+ # Note the multiple return values.
+ # Class method
+ def Game.read_game(gamelines)
+ gamelines.each {|l| l.chomp!}
+ game = Game.new(gamelines[0].to_i, 6, 6, 6, 6)
+ moves = []
+ gamelines[1..-2].each {|m| moves << m.to_move(game)}
+ return game, moves, gamelines[-1].to_i
+ end
+
+
+end
+
+
+# Extension to String class to convert a move-description string into a Move object.
+# This is the inverse of the Move#to_s method
+class String
+ def to_move(game)
+ move_elements = self.downcase.split
+ piece_name = move_elements[0]
+ destination_name = move_elements[-1]
+ if destination_name.length > 2 and
+ destination_name[-2,2] == game.board.centre.place[-2,2]
+ destination_name = game.board.centre.place
+ end
+ raise(InvalidMoveError, "Invalid piece in move read") unless game.pieces.has_key?(piece_name)
+ raise(InvalidMoveError, "Invalid destination in move read") unless game.board.positions.has_key?(destination_name)
+ # Deal with the synonyms for the centre position
+ via_base = (destination_name.length == 1 or move_elements.length > 2)
+ Move.new(game.pieces[piece_name], game.board.positions[destination_name], via_base)
+ end
+end
+
+
+# Read a game description file and convert it into a Game object and set of Move objects.
+# Note that Game.read_game method returns multiple values, so this one does too.
+class IO
+ def IO.read_game(filename)
+ gamelines = IO.readlines(filename)
+ return Game.read_game(gamelines)
+ end
+end
diff --git a/lib/libpplayer.rb~ b/lib/libpplayer.rb~
new file mode 100644
index 0000000..9dc6bd4
--- /dev/null
+++ b/lib/libpplayer.rb~
@@ -0,0 +1,106 @@
+# == Synopsis
+#
+# Library to support a Trap the Cap player that uses potentials to select the
+# best move
+#
+# == Author
+# Neil Smith
+#
+# == Change history
+# Version 1.1:: 23 April 2008
+
+require 'libttc'
+require 'libgenetics'
+
+
+# Play Trap the Cap by using potential fields. For each possible move,
+# calculate the field strength and pick the move with the lowest potential
+class Potential_player
+
+ attr_reader :friend_pull, :enemy_pull, :base_pull,
+ :safe_bonus, :capture_bonus
+
+ def initialize(args, verbose = false)
+ @friend_pull = args[:friend_pull] || 1
+ @enemy_pull = args[:enemy_pull] || 0.5
+ @base_pull = args[:base_pull] || 2
+ @safe_bonus = args[:safe_bonus] || 8
+ @capture_bonus = args[:capture_bonus] || 10
+
+ @verbose = verbose
+ end
+
+ # Find the best move of the possible ones
+ def best_move(game, die_result)
+ me = game.current_player
+ possible_moves = game.possible_moves(die_result, me)
+ scored_moves = possible_moves.collect do |m|
+ begin
+ game.apply_move! m
+ score = score_position(game, me)
+# game.undo_move!
+ rescue GameWonNotice
+ score = 10000
+ ensure
+ game.undo_move!
+ end
+ puts "#{m} scores #{score}" if @verbose
+ [m, score]
+ end
+ best_move = (scored_moves.max {|a, b| a[1] <=> b[1]})[0]
+ end
+
+ # Calculate the potential score of a position for a given player
+ def score_position(game, player)
+ score = 0
+ game.pieces.each_value do |piece|
+ here = piece.position
+ if piece.colour == player
+ game.pieces.each_value do |other_piece|
+ if other_piece.colour == player
+ score += game.board.distance_between[here.place][other_piece.position.place] * @friend_pull
+ else
+ score += game.board.distance_between[here.place][other_piece.position.place] * @enemy_pull
+ end
+ end
+ score += piece.contains.length * @capture_bonus
+ score += game.board.distance_between[here.place][game.board.positions[player].place] *
+ piece.contains.length * @base_pull
+ elsif here == game.board.positions[player]
+ score += @safe_bonus
+ end
+ end
+ score
+ end
+
+
+ # Convert a player to a bitstring
+ def to_bitstring
+ (@friend_pull * 4).to_i.to_bitstring(4).gray_encode +
+ (@enemy_pull * 4).to_i.to_bitstring(4).gray_encode +
+ (@base_pull * 4).to_i.to_bitstring(4).gray_encode +
+ @safe_bonus.to_bitstring(4).gray_encode +
+ @capture_bonus.to_bitstring(4).gray_encode
+ end
+
+ # Convert a player to a genome
+ def to_genome
+ Genome.new(self.to_bitstring)
+ end
+end
+
+
+class Genome
+
+ # Create a potential player from a genome
+ def to_potential_player
+ friend_pull = @genome[0, 4].gray_decode.to_decimal.to_f / 4
+ enemy_pull = @genome[4, 4].gray_decode.to_decimal.to_f / 4
+ base_pull = @genome[8, 4].gray_decode.to_decimal.to_f / 4
+ safe_bonus = @genome[12, 4].gray_decode.to_decimal
+ capture_bonus = @genome[16, 4].gray_decode.to_decimal
+ Potential_player.new({:friend_pull => friend_pull,
+ :enemy_pull => enemy_pull, :base_pull => base_pull,
+ :safe_bonus => safe_bonus, :capture_bonus => capture_bonus})
+ end
+end
diff --git a/main.rb b/main.rb
new file mode 100755
index 0000000..ee03648
--- /dev/null
+++ b/main.rb
@@ -0,0 +1,13 @@
+#!/usr/bin/ruby -w
+
+require 'src/play'
+require 'src/selection'
+
+pop1 = Population.new(100, 20)
+
+start = Time.now
+puts "Started at #{start}"
+pop1.tournament_select_population(0.8, 1000, true)
+finish = Time.now
+puts "Took #{finish - start}"
+
diff --git a/nbproject/.svn/all-wcprops b/nbproject/.svn/all-wcprops
new file mode 100644
index 0000000..350b449
--- /dev/null
+++ b/nbproject/.svn/all-wcprops
@@ -0,0 +1,17 @@
+K 25
+svn:wc:ra_dav:version-url
+V 48
+/svn/njae/!svn/ver/24/TrapTheCap/trunk/nbproject
+END
+project.properties
+K 25
+svn:wc:ra_dav:version-url
+V 67
+/svn/njae/!svn/ver/23/TrapTheCap/trunk/nbproject/project.properties
+END
+project.xml
+K 25
+svn:wc:ra_dav:version-url
+V 60
+/svn/njae/!svn/ver/23/TrapTheCap/trunk/nbproject/project.xml
+END
diff --git a/nbproject/.svn/dir-prop-base b/nbproject/.svn/dir-prop-base
new file mode 100644
index 0000000..a7ce626
--- /dev/null
+++ b/nbproject/.svn/dir-prop-base
@@ -0,0 +1,6 @@
+K 10
+svn:ignore
+V 8
+private
+
+END
diff --git a/nbproject/.svn/entries b/nbproject/.svn/entries
new file mode 100644
index 0000000..a07ba75
--- /dev/null
+++ b/nbproject/.svn/entries
@@ -0,0 +1,52 @@
+8
+
+dir
+68
+http://scripts.njae.me.uk/svn/njae/TrapTheCap/trunk/nbproject
+http://scripts.njae.me.uk/svn/njae
+
+
+
+2008-03-28T15:47:09.723420Z
+24
+neil
+has-props
+
+svn:special svn:externals svn:needs-lock
+
+
+
+
+
+
+
+
+
+
+
+0ada9808-85ab-4924-adda-5bf89eae3818
+
+project.properties
+file
+
+
+
+
+2008-03-25T11:44:50.000000Z
+4903a98656892131addae4aea0a77d22
+2008-03-25T12:46:59.166018Z
+23
+neil
+
+project.xml
+file
+
+
+
+
+2008-03-25T11:44:50.000000Z
+9ff3dc942c9d9890138a20443f2eda06
+2008-03-25T12:46:59.166018Z
+23
+neil
+
diff --git a/nbproject/.svn/format b/nbproject/.svn/format
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/nbproject/.svn/format
@@ -0,0 +1 @@
+8
diff --git a/nbproject/.svn/text-base/project.properties.svn-base b/nbproject/.svn/text-base/project.properties.svn-base
new file mode 100644
index 0000000..3b52a29
--- /dev/null
+++ b/nbproject/.svn/text-base/project.properties.svn-base
@@ -0,0 +1,7 @@
+javac.classpath=
+main.file=ttc.rb
+ruby.includejava=false
+source.encoding=UTF-8
+src.dir=lib
+src.src.dir=src
+test.src.dir=test
diff --git a/nbproject/.svn/text-base/project.xml.svn-base b/nbproject/.svn/text-base/project.xml.svn-base
new file mode 100644
index 0000000..8e31144
--- /dev/null
+++ b/nbproject/.svn/text-base/project.xml.svn-base
@@ -0,0 +1,16 @@
+
+
+ org.netbeans.modules.ruby.rubyproject
+
+
+ TrapTheCap
+
+
+
+
+
+
+
+
+
+
diff --git a/nbproject/private/config.properties b/nbproject/private/config.properties
new file mode 100644
index 0000000..e69de29
diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties
new file mode 100644
index 0000000..e69de29
diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml
new file mode 100644
index 0000000..ee04c96
--- /dev/null
+++ b/nbproject/private/private.xml
@@ -0,0 +1,15 @@
+
+
+
+
+ file:/home/neil/programming/ruby/TrapTheCap/src/clockwise-cloud.rb
+ file:/home/neil/programming/ruby/TrapTheCap/src/gen1006.rb
+ file:/home/neil/programming/ruby/TrapTheCap/src/html-files/interface.html
+ file:/home/neil/programming/ruby/TrapTheCap/src/html-files/simple.html
+ file:/home/neil/programming/ruby/TrapTheCap/src/libttc-pplayer.rb
+ file:/home/neil/programming/ruby/TrapTheCap/src/libttc.rb
+ file:/home/neil/programming/ruby/TrapTheCap/src/sample-game.txt
+ file:/home/neil/programming/ruby/TrapTheCap/src/selection.rb
+ file:/home/neil/programming/ruby/TrapTheCap/src/ttc-ga-clustering.rb
+
+
diff --git a/nbproject/private/rake-d.txt b/nbproject/private/rake-d.txt
new file mode 100644
index 0000000..e69de29
diff --git a/nbproject/private/rake-t.txt b/nbproject/private/rake-t.txt
new file mode 100644
index 0000000..f686624
--- /dev/null
+++ b/nbproject/private/rake-t.txt
@@ -0,0 +1 @@
+(in /home/neil/programming/ruby/TrapTheCap)
diff --git a/nbproject/project.properties b/nbproject/project.properties
new file mode 100644
index 0000000..3b52a29
--- /dev/null
+++ b/nbproject/project.properties
@@ -0,0 +1,7 @@
+javac.classpath=
+main.file=ttc.rb
+ruby.includejava=false
+source.encoding=UTF-8
+src.dir=lib
+src.src.dir=src
+test.src.dir=test
diff --git a/nbproject/project.xml b/nbproject/project.xml
new file mode 100644
index 0000000..8e31144
--- /dev/null
+++ b/nbproject/project.xml
@@ -0,0 +1,16 @@
+
+
+ org.netbeans.modules.ruby.rubyproject
+
+
+ TrapTheCap
+
+
+
+
+
+
+
+
+
+
diff --git a/play-one-game.rb b/play-one-game.rb
new file mode 100644
index 0000000..f92e1e1
--- /dev/null
+++ b/play-one-game.rb
@@ -0,0 +1,29 @@
+#!/usr/bin/ruby -w
+
+require 'src/play'
+require 'src/selection'
+
+winner_success_chance = 0.8
+
+player_bitstrings = readlines.collect {|l| l.chomp.split(//).collect {|x| x.to_i}}
+
+# File.open('player.log', 'a') do |f|
+# player_bitstrings.each {|b| f.puts "Process #{Process.pid}: Received #{b}"}
+# end
+
+players = player_bitstrings.collect {|b| Genome.new(b).to_potential_player}
+
+handler = GameHandler.new(players, 1000)
+winner, moves = handler.play
+
+if winner == :draw or rand > winner_success_chance
+ successful_player = players[rand(players.length)]
+else
+ successful_player = winner
+end
+
+# File.open('player.log', 'a') do |f|
+# f.puts "Process #{Process.pid}: winner is #{successful_player.to_bitstring}"
+# end
+
+puts "#{successful_player.to_bitstring}"
\ No newline at end of file
diff --git a/run-ga.rb b/run-ga.rb
new file mode 100644
index 0000000..abd27c6
--- /dev/null
+++ b/run-ga.rb
@@ -0,0 +1,59 @@
+#!/usr/bin/ruby -w
+
+require 'src/play'
+require 'src/selection'
+# require 'systemu'
+
+pop = Population.new(5, 20)
+generation_count = 1
+max_generations = 3
+
+if File.file? 'player.log'
+ File.delete 'player.log'
+end
+
+puts "Generation number #{generation_count}"
+pop.individuals.sort {|x, y| x.genome <=> y.genome}.each {|i| puts "#{i.genome}"}
+
+while generation_count <= max_generations
+ start = Time.now
+ puts "Started at #{start}"
+
+ new_population = []
+ threads = []
+ 1.upto(pop.individuals.length) do |i|
+ threads << Thread.new do
+ puts "Starting thread #{i}"
+ sleep 2
+ player_count = rand(5) + 2
+ pool_size = pop.individuals.length
+ players = []
+ 1.upto(player_count) { players << pop.individuals[rand(pool_size)] }
+ IO.popen('ruby play-one-game.rb', 'r+') do |pipe|
+ players.each {|p| pipe << "#{p.genome}\n" ; puts "Game #{i}: putting player #{p.genome}"}
+# players.each {|p| pipe << "#{p.genome}\n"}
+ pipe.close_write
+ new_population << Genome.new(pipe.readline.chomp.split(//).collect {|x| x.to_i})
+ puts "Got result #{new_population[-1].genome}"
+ end
+# game_input = (players.collect {|p| p.genome.to_s}).join("\n")
+# game_result = ''
+# puts "Calling game #{i} with input #{game_input}"
+# status, game_result, stderr = systemu 'ruby play-one-game.rb', 'stdin' => game_input
+# puts "Game #{i} returned #{game_result}"
+# new_population << Genome.new(game_result.chomp.split(//).collect {|x| x.to_i})
+ end
+ threads.each {|t| t.join}
+ end
+
+ pop.individuals = new_population
+
+ finish = Time.now
+ puts "Took #{finish - start} seconds"
+ pop1 = pop.crossover(0.7)
+ pop = pop1.mutation(0.05)
+ generation_count += 1
+ puts "Generation number #{generation_count}"
+ pop.individuals.sort {|x, y| x.genome <=> y.genome}.each {|i| puts "#{i.genome}"}
+ $stdout.flush
+end
\ No newline at end of file
diff --git a/src/.svn/all-wcprops b/src/.svn/all-wcprops
new file mode 100644
index 0000000..e343057
--- /dev/null
+++ b/src/.svn/all-wcprops
@@ -0,0 +1,83 @@
+K 25
+svn:wc:ra_dav:version-url
+V 42
+/svn/njae/!svn/ver/68/TrapTheCap/trunk/src
+END
+gen1006-clusters.txt
+K 25
+svn:wc:ra_dav:version-url
+V 63
+/svn/njae/!svn/ver/69/TrapTheCap/trunk/src/gen1006-clusters.txt
+END
+gen1006.rb
+K 25
+svn:wc:ra_dav:version-url
+V 53
+/svn/njae/!svn/ver/69/TrapTheCap/trunk/src/gen1006.rb
+END
+clockwise-p1.rb
+K 25
+svn:wc:ra_dav:version-url
+V 58
+/svn/njae/!svn/ver/23/TrapTheCap/trunk/src/clockwise-p1.rb
+END
+libttc.rb
+K 25
+svn:wc:ra_dav:version-url
+V 52
+/svn/njae/!svn/ver/69/TrapTheCap/trunk/src/libttc.rb
+END
+sample-game.txt
+K 25
+svn:wc:ra_dav:version-url
+V 58
+/svn/njae/!svn/ver/69/TrapTheCap/trunk/src/sample-game.txt
+END
+play.rb
+K 25
+svn:wc:ra_dav:version-url
+V 50
+/svn/njae/!svn/ver/27/TrapTheCap/trunk/src/play.rb
+END
+selection.rb
+K 25
+svn:wc:ra_dav:version-url
+V 55
+/svn/njae/!svn/ver/69/TrapTheCap/trunk/src/selection.rb
+END
+clockwise-cloud.rb
+K 25
+svn:wc:ra_dav:version-url
+V 61
+/svn/njae/!svn/ver/23/TrapTheCap/trunk/src/clockwise-cloud.rb
+END
+libgenetics.rb
+K 25
+svn:wc:ra_dav:version-url
+V 57
+/svn/njae/!svn/ver/69/TrapTheCap/trunk/src/libgenetics.rb
+END
+ttc.rb
+K 25
+svn:wc:ra_dav:version-url
+V 49
+/svn/njae/!svn/ver/23/TrapTheCap/trunk/src/ttc.rb
+END
+gen1006-clusters-old.txt
+K 25
+svn:wc:ra_dav:version-url
+V 67
+/svn/njae/!svn/ver/69/TrapTheCap/trunk/src/gen1006-clusters-old.txt
+END
+libttc-pplayer.rb
+K 25
+svn:wc:ra_dav:version-url
+V 60
+/svn/njae/!svn/ver/69/TrapTheCap/trunk/src/libttc-pplayer.rb
+END
+ttc-ga-clustering.rb
+K 25
+svn:wc:ra_dav:version-url
+V 63
+/svn/njae/!svn/ver/69/TrapTheCap/trunk/src/ttc-ga-clustering.rb
+END
diff --git a/src/.svn/entries b/src/.svn/entries
new file mode 100644
index 0000000..100f0b1
--- /dev/null
+++ b/src/.svn/entries
@@ -0,0 +1,184 @@
+8
+
+dir
+68
+http://scripts.njae.me.uk/svn/njae/TrapTheCap/trunk/src
+http://scripts.njae.me.uk/svn/njae
+
+
+
+2009-02-19T08:59:38.293071Z
+68
+neil
+
+
+svn:special svn:externals svn:needs-lock
+
+
+
+
+
+
+
+
+
+
+
+0ada9808-85ab-4924-adda-5bf89eae3818
+
+gen1006.rb
+file
+69
+
+
+
+2009-02-23T13:32:58.000000Z
+597c993fb86e5502356a806a91127c5e
+2009-02-23T14:02:44.812274Z
+69
+
+has-props
+
+libttc.rb
+file
+69
+
+
+
+2009-02-23T13:25:21.000000Z
+7a2bf3e4c83b3d2b06850a96bca4c4bc
+2009-02-23T14:02:44.812274Z
+69
+
+selection.rb
+file
+69
+
+
+
+2009-02-23T13:26:05.000000Z
+a2a08d4d875fb316d0bd647564006a25
+2009-02-23T14:02:44.812274Z
+69
+neil
+
+clockwise-cloud.rb
+file
+
+
+
+
+2007-08-31T19:04:34.000000Z
+b53aaefb7e9da9aaf2ac304930c98504
+2008-03-25T12:46:59.166018Z
+23
+neil
+
+libgenetics.rb
+file
+69
+
+
+
+2009-02-23T13:25:19.000000Z
+9eeccabbfc44763ad8898e77c2b65358
+2009-02-23T14:02:44.812274Z
+69
+
+ttc.rb
+file
+
+
+
+
+2008-03-25T11:46:58.000000Z
+5609521da79d911a6144fded55f32d3f
+2008-03-25T12:46:59.166018Z
+23
+neil
+
+libttc-pplayer.rb
+file
+69
+
+
+
+2009-02-23T13:25:20.000000Z
+8c24369e159246ae762ba26115879019
+2009-02-23T14:02:44.812274Z
+69
+
+ttc-ga-clustering.rb
+file
+69
+
+
+
+2009-02-23T13:24:21.000000Z
+26b1e7b75853a57bf4af2854c3920b55
+2009-02-23T14:02:44.812274Z
+69
+
+gen1006-clusters.txt
+file
+69
+
+
+
+2009-02-20T16:29:20.000000Z
+8b954bea91eb9fb38495c3989a835a3e
+2009-02-23T14:02:44.812274Z
+69
+
+cgi-files
+dir
+
+clockwise-p1.rb
+file
+
+
+
+
+2007-08-31T11:19:53.000000Z
+7af8c3a0bb94e558fedf57c8b2cb035d
+2008-03-25T12:46:59.166018Z
+23
+neil
+
+html-files
+dir
+
+sample-game.txt
+file
+69
+
+
+
+2009-02-23T13:53:03.000000Z
+4a8276396b008060afd58562390d28d9
+2009-02-23T14:02:44.812274Z
+69
+
+play.rb
+file
+
+
+
+
+2008-04-23T19:32:54.000000Z
+8f509d131f0ad009f369c4cd7a46fbcc
+2008-04-23T19:36:22.892674Z
+27
+neil
+
+gen1006-clusters-old.txt
+file
+69
+
+
+
+2009-02-20T16:26:52.000000Z
+e06ee3749f74806beeb62c62b0a2557f
+2009-02-23T14:02:44.812274Z
+69
+
diff --git a/src/.svn/format b/src/.svn/format
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/src/.svn/format
@@ -0,0 +1 @@
+8
diff --git a/src/.svn/prop-base/gen1006.rb.svn-base b/src/.svn/prop-base/gen1006.rb.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/src/.svn/prop-base/gen1006.rb.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/src/.svn/text-base/clockwise-cloud.rb.svn-base b/src/.svn/text-base/clockwise-cloud.rb.svn-base
new file mode 100644
index 0000000..3df362f
--- /dev/null
+++ b/src/.svn/text-base/clockwise-cloud.rb.svn-base
@@ -0,0 +1,77 @@
+#!/usr/bin/ruby
+#
+# == Synopsis
+#
+# Play one move of a Trap the Cap game
+#
+# == Usage
+# clockwise-p1
+# Game state file read on STDIN
+# Move produced on STDOUT
+#
+# == Author
+# Neil Smith
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+
+
+require 'libttc'
+
+def more_clockwise(this, other)
+ here = this.place
+ there = other.place
+
+ # if both are on a spoke, choose the one with the lowest number (nearer the rim)
+ if here =~ /.c./ and there =~ /.c./
+ # break ties by preferring the most clockwise arc
+ if here[-1] == there[-1]
+ return here[0] <=> there[0]
+ else
+ return -1 * (here[-1] <=> there[-1])
+ end
+ # If one is one a spoke and the other is on the rim, choose the one on the rim
+ elsif here =~ /.c./ or there =~ /.c./
+ return -1 * (here.length <=> there.length)
+ # If one is in the 'f' rim section and the other in the 'a' rim section, choose the 'a'
+ elsif here[0,1] == 'a' and there[0,1] == 'f'
+ return +1
+ elsif here[0,1] == 'f' and there[0,1] == 'a'
+ return -1
+ # Otherwise, choose the one with highest arc code
+ else
+ return here <=> there
+ end
+
+end
+
+# Get the current game state
+game_lines = readlines
+game, moves, next_roll = Game.read_game(game_lines)
+game.apply_moves moves
+
+
+# The piece to move is the least clockwise of my uncaptured pieces
+# Always move pieces on the base first
+my_pieces = game.pieces.values.select {|p| p.colour == game.current_player and not p.captured}
+piece_to_move = (my_pieces.sort {|x, y| more_clockwise x.position, y.position})[0]
+
+# Find the most clockwise move for this piece
+potential_moves = game.possible_moves(next_roll).select {|m| m.piece == piece_to_move}
+sorted_moves = potential_moves.sort {|x, y| more_clockwise x.destination, y.destination}
+best_move = sorted_moves[-1]
+
+# return that move
+puts best_move
+
+
diff --git a/src/.svn/text-base/clockwise-p1.rb.netbeans-base b/src/.svn/text-base/clockwise-p1.rb.netbeans-base
new file mode 100644
index 0000000..fd8e726
--- /dev/null
+++ b/src/.svn/text-base/clockwise-p1.rb.netbeans-base
@@ -0,0 +1,63 @@
+#!/usr/bin/ruby
+#
+# == Synopsis
+#
+# Play one move of a Trap the Cap game
+#
+# == Usage
+# clockwise-p1
+# Game state file read on STDIN
+# Move produced on STDOUT
+#
+# == Author
+# Neil Smith
+
+
+require 'libttc'
+require 'rdoc/usage'
+
+def more_clockwise(this, other)
+ here = this.destination.place
+ there = other.destination.place
+
+ # if both are on a spoke, choose the one with the lowest number (nearer the rim)
+ if here =~ /.c./ and there =~ /.c./
+ # break ties by preferring the most clockwise arc
+ if here[-1] == there[-1]
+ return here[0] <=> there[0]
+ else
+ return -1 * (here[-1] <=> there[-1])
+ end
+ # If one is one a spoke and the other is on the rim, choose the one on the rim
+ elsif here =~ /.c./ or there =~ /.c./
+ return -1 * (here.length <=> there.length)
+ # If one is in the 'f' rim section and the other in the 'a' rim section, choose the 'a'
+ elsif here[0,1] == 'a' and there[0,1] == 'f'
+ return +1
+ elsif here[0,1] == 'f' and there[0,1] == 'a'
+ return -1
+ # Otherwise, choose the one with highest arc code
+ else
+ return here <=> there
+ end
+
+end
+
+# Get the current game state
+game_lines = readlines
+game, moves, next_roll = Game.read_game(game_lines)
+game.apply_moves moves
+
+# The piece to move is the uncaptured one of mine with the lowest number
+my_pieces = game.pieces.values.select {|p| p.colour == game.current_player and not p.captured}
+piece_to_move = (my_pieces.sort_by {|p| p.name})[0]
+
+# find the most clockwise move
+potential_moves = game.possible_moves(next_roll).select {|m| m.piece == piece_to_move}
+sorted_moves = potential_moves.sort {|x, y| more_clockwise x, y}
+best_move = sorted_moves[-1]
+
+# return that move
+puts best_move
+
+
diff --git a/src/.svn/text-base/clockwise-p1.rb.svn-base b/src/.svn/text-base/clockwise-p1.rb.svn-base
new file mode 100644
index 0000000..fd8e726
--- /dev/null
+++ b/src/.svn/text-base/clockwise-p1.rb.svn-base
@@ -0,0 +1,63 @@
+#!/usr/bin/ruby
+#
+# == Synopsis
+#
+# Play one move of a Trap the Cap game
+#
+# == Usage
+# clockwise-p1
+# Game state file read on STDIN
+# Move produced on STDOUT
+#
+# == Author
+# Neil Smith
+
+
+require 'libttc'
+require 'rdoc/usage'
+
+def more_clockwise(this, other)
+ here = this.destination.place
+ there = other.destination.place
+
+ # if both are on a spoke, choose the one with the lowest number (nearer the rim)
+ if here =~ /.c./ and there =~ /.c./
+ # break ties by preferring the most clockwise arc
+ if here[-1] == there[-1]
+ return here[0] <=> there[0]
+ else
+ return -1 * (here[-1] <=> there[-1])
+ end
+ # If one is one a spoke and the other is on the rim, choose the one on the rim
+ elsif here =~ /.c./ or there =~ /.c./
+ return -1 * (here.length <=> there.length)
+ # If one is in the 'f' rim section and the other in the 'a' rim section, choose the 'a'
+ elsif here[0,1] == 'a' and there[0,1] == 'f'
+ return +1
+ elsif here[0,1] == 'f' and there[0,1] == 'a'
+ return -1
+ # Otherwise, choose the one with highest arc code
+ else
+ return here <=> there
+ end
+
+end
+
+# Get the current game state
+game_lines = readlines
+game, moves, next_roll = Game.read_game(game_lines)
+game.apply_moves moves
+
+# The piece to move is the uncaptured one of mine with the lowest number
+my_pieces = game.pieces.values.select {|p| p.colour == game.current_player and not p.captured}
+piece_to_move = (my_pieces.sort_by {|p| p.name})[0]
+
+# find the most clockwise move
+potential_moves = game.possible_moves(next_roll).select {|m| m.piece == piece_to_move}
+sorted_moves = potential_moves.sort {|x, y| more_clockwise x, y}
+best_move = sorted_moves[-1]
+
+# return that move
+puts best_move
+
+
diff --git a/src/.svn/text-base/gen1006-clusters-old.txt.svn-base b/src/.svn/text-base/gen1006-clusters-old.txt.svn-base
new file mode 100644
index 0000000..3f15863
--- /dev/null
+++ b/src/.svn/text-base/gen1006-clusters-old.txt.svn-base
@@ -0,0 +1,156 @@
+[[0,0,0,0,0,1,0,0,1,1,1,0,1,1,1,1,0,0,1,1], 16]
+[[0,0,1,0,0,0,0,0,0,1,0,1,1,1,0,1,0,0,1,1], 17]
+[[0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,1,0,0,1,1], 19]
+[[0,0,0,0,1,0,1,1,0,1,1,1,0,1,1,1,1,0,0,1], 20]
+[[0,0,0,0,0,0,1,0,1,0,1,1,0,0,1,1,0,1,0,1], 22]
+[[0,0,0,0,0,0,1,0,1,0,0,0,1,0,0,1,0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0,0,0,1,0,0,0,0,1,1,1,1,1,0,0,1,0], 69]
+[[0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,1,1,1,0], 10] [[0,0,0,0,0,0,0,0,1,0,0,0,1,1,1,0,0,1,1,1], 28] [[0,1,0,0,0,0,1,0,0,0,0,1,1,0,0,0,1,1,1,0], 29] [[0,0,0,0,0,1,0,0,0,0,0,1,0,1,1,1,0,1,0,1], 31] [[0,0,0,0,1,1,0,0,0,1,1,1,1,0,0,0,1,0,1,0], 31] [[0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,1,0], 36] [[0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,0,0,0,1], 36] [[0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,1,1,0], 42] [[0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,1,0,0,1,0], 58] [[0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,1], 99]
diff --git a/src/.svn/text-base/gen1006-clusters.txt.svn-base b/src/.svn/text-base/gen1006-clusters.txt.svn-base
new file mode 100644
index 0000000..60fe934
--- /dev/null
+++ b/src/.svn/text-base/gen1006-clusters.txt.svn-base
@@ -0,0 +1,13 @@
+[[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,1], 140] [[0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0], 65] [[0,0,0,1,0,0,1,0,0,0,0,1,1,0,0,0,1,1,1,1], 43] [[0,0,0,0,0,1,0,0,0,0,1,0,1,0,0,0,1,1,1,0], 31] [[0,0,0,0,0,0,1,0,1,0,0,0,1,0,0,1,0,1,1,0], 27] [[0,0,0,0,0,0,1,0,1,0,1,1,0,0,1,1,0,1,0,1], 22] [[0,0,0,0,1,0,1,1,0,1,1,1,0,1,1,1,1,0,0,1], 20] [[0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,1,0,0,1,1], 19] [[0,0,1,0,0,0,0,0,0,1,0,1,1,1,0,1,0,0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,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,1,1,0], 42] [[0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,0,0,0,1], 36] [[0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,1,0], 36] [[0,0,0,0,1,1,0,0,0,1,1,1,1,0,0,0,1,0,1,0], 31] [[0,0,0,0,0,1,0,0,0,0,0,1,0,1,1,1,0,1,0,1], 31] [[0,1,0,0,0,0,1,0,0,0,0,1,1,0,0,0,1,1,1,0], 29] [[0,0,0,0,0,0,0,0,1,0,0,0,1,1,1,0,0,1,1,1], 28] [[0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,1,1,1,0], 10]
diff --git a/src/.svn/text-base/gen1006.rb.svn-base b/src/.svn/text-base/gen1006.rb.svn-base
new file mode 100644
index 0000000..2e49434
--- /dev/null
+++ b/src/.svn/text-base/gen1006.rb.svn-base
@@ -0,0 +1,35 @@
+#!/usr/bin/ruby
+#
+# == Synopsis
+#
+# Play one move of a Trap the Cap game
+#
+# == Usage
+# clockwise-p1
+# Game state file read on STDIN
+# Move produced on STDOUT
+#
+# == Author
+# Neil Smith
+
+
+require 'libttc'
+require 'libttc-pplayer'
+require 'rdoc/usage'
+
+
+# Get the current game state
+game_lines = readlines
+game, moves, next_roll = Game.read_game(game_lines)
+game.apply_moves! moves
+
+player = Potential_player.new({:friend_pull => 0.0,
+ :enemy_pull => 0.0,
+ :base_pull => 0.0,
+ :safe_bonus => 10,
+ :capture_bonus => 2})
+
+best_move = player.best_move(game, next_roll)
+
+# return that move
+puts best_move
diff --git a/src/.svn/text-base/libgenetics.rb.svn-base b/src/.svn/text-base/libgenetics.rb.svn-base
new file mode 100644
index 0000000..3632440
--- /dev/null
+++ b/src/.svn/text-base/libgenetics.rb.svn-base
@@ -0,0 +1,176 @@
+# == Synopsis
+#
+# Library to support genetic algorithms
+#
+# == Author
+# Neil Smith
+#
+# == Change history
+# Version 1.1:: 23 April 2008
+
+# A single genome in a population
+class Genome
+
+ attr_accessor :genome
+
+ # Create a random genome of the given length
+ def initialize(bitstring_or_length)
+ if bitstring_or_length.class == Fixnum
+ @genome = []
+ (1..bitstring_or_length).each do |i|
+ @genome << rand(2)
+ end
+ else
+ @genome = bitstring_or_length
+ end
+ end
+
+ # Mutate a genome with the given rate per bit
+ def mutate(mutation_probability = 0.05)
+ new_genome = Genome.new(@genome.length)
+ (0...@genome.length).each do |i|
+ if rand < mutation_probability
+ if @genome[i] == 0
+ new_genome.genome[i] = 1
+ else
+ new_genome.genome[i] = 0
+ end
+ else
+ new_genome.genome[i] = @genome[i]
+ end
+ end
+ new_genome
+ end
+
+ # Mutate a genome in-place with the given rate per bit
+ def mutate!(mutation_probability = 0.05)
+ (0...@genome.length).each do |i|
+ if rand < mutation_probability
+ if @genome[i] == 0
+ @genome[i] = 1
+ else
+ @genome[i] = 0
+ end
+ end
+ end
+ @genome
+ end
+
+ # Crossover two genomes at the given point
+ def crossover(other_genome, crossover_point)
+ raise ArgumentError, "Different size genomes" if @genome.length != other_genome.genome.length
+ raise ArgumentError, "Our of bounds crossover point" if crossover_point < 0 or crossover_point > @genome.length
+ child1 = Genome.new(0)
+ child2 = Genome.new(0)
+ child1.genome = @genome[0, crossover_point] + other_genome.genome[crossover_point, @genome.length]
+ child2.genome = other_genome.genome[0, crossover_point] + @genome[crossover_point, @genome.length]
+ [child1, child2]
+ end
+
+end
+
+
+class Array
+ def to_decimal
+ val = 0
+ bits = self.dup
+ while not bits.empty?
+ val = val * 2 + bits[0]
+ bits = bits[1..bits.length]
+ end
+ val
+ end
+
+ def gray_encode
+ gray = self[0..0]
+ (1...self.length).each do |i|
+ if (self[i - 1] == 1) ^ (self[i] == 1)
+ gray << 1
+ else
+ gray << 0
+ end
+ end
+ gray
+ end
+
+ def gray_decode
+ binary = self[0..0]
+ (1...self.length).each do |i|
+ if (binary[i - 1] == 1) ^ (self[i] == 1)
+ binary << 1
+ else
+ binary << 0
+ end
+ end
+ binary
+ end
+
+end
+
+class Fixnum
+ def to_bitstring(min_length = 0)
+ bits = []
+ k = self
+ while k > 0 do
+ if k % 2 == 1
+ bits << 1
+ else
+ bits << 0
+ end
+ k = k >> 1
+ end
+ while bits.length < min_length do
+ bits << 0
+ end
+ bits.reverse
+ end
+end
+
+
+# A population of genomes
+class Population
+ attr_accessor :individuals
+
+ # Create a population of a given size
+ def initialize(population_size, genome_length = 0)
+ @individuals = []
+ 1.upto(population_size) { @individuals << Genome.new(genome_length) }
+ end
+
+ # Perform the crossover step in a population, giving a new population
+ def crossover(crossover_rate)
+ parents = @individuals.dup # genomes that haven't been parents yet
+ next_population = Population.new(0)
+ while parents.length > 1
+ parent1 = parents.delete_at(rand(parents.length)).dup
+ parent2 = parents.delete_at(rand(parents.length)).dup
+ if rand < crossover_rate
+ child1, child2 = parent1.crossover parent2, rand(parent1.genome.length)
+ next_population.individuals << child1 << child2
+ else
+ next_population.individuals << parent1 << parent2
+ end
+ end
+ next_population.individuals.concat parents # pick up any parents that didn't get a chance to mate
+ next_population
+ end
+
+ # Perform the mutation step in a population, giving a new population
+ def mutation(mutation_rate)
+ parents = @individuals.dup # genomes that haven't been parents yet
+ next_population = Population.new(0)
+ while parents.length > 0
+ parent = parents.pop.dup
+ child = parent.mutate mutation_rate
+ next_population.individuals << child
+ end
+ next_population
+ end
+
+ def make_next_generation(tournament_winner_success_rate = 0.8, game_length = 1000, crossover_rate = 0.7, mutation_rate = 0.05)
+ @individuals = tournament_select_population(tournament_winner_success_rate, game_length, false)
+ @individuals = crossover(crossover_rate)
+ @individuals = mutation(mutation_rate)
+ end
+
+end
diff --git a/src/.svn/text-base/libttc-pplayer.rb.svn-base b/src/.svn/text-base/libttc-pplayer.rb.svn-base
new file mode 100644
index 0000000..a848045
--- /dev/null
+++ b/src/.svn/text-base/libttc-pplayer.rb.svn-base
@@ -0,0 +1,74 @@
+# == Synopsis
+#
+# Library to support a Trap the Cap player that uses potentials to select the
+# best move
+#
+# == Author
+# Neil Smith
+#
+# == Change history
+# Version 1.1:: 23 April 2008
+
+require 'libttc'
+
+# Play Trap the Cap by using potential fields. For each possible move,
+# calculate the field strength and pick the move with the lowest potential
+class Potential_player
+
+ attr_reader :friend_pull, :enemy_pull, :base_pull,
+ :safe_bonus, :capture_bonus
+
+ def initialize(args, verbose = false)
+ @friend_pull = args[:friend_pull] || 1
+ @enemy_pull = args[:enemy_pull] || 0.5
+ @base_pull = args[:base_pull] || 2
+ @safe_bonus = args[:safe_bonus] || 8
+ @capture_bonus = args[:capture_bonus] || 10
+
+ @verbose = verbose
+ end
+
+ # Find the best move of the possible ones
+ def best_move(game, die_result)
+ me = game.current_player
+ possible_moves = game.possible_moves(die_result, me)
+ scored_moves = possible_moves.collect do |m|
+ begin
+ game.apply_move! m
+ score = score_position(game, me)
+# game.undo_move!
+ rescue GameWonNotice
+ score = 10000
+ ensure
+ game.undo_move!
+ end
+ puts "#{m} scores #{score}" if @verbose
+ [m, score]
+ end
+ best_move = (scored_moves.max {|a, b| a[1] <=> b[1]})[0]
+ end
+
+ # Calculate the potential score of a position for a given player
+ def score_position(game, player)
+ score = 0
+ game.pieces.each_value do |piece|
+ here = piece.position
+ if piece.colour == player
+ game.pieces.each_value do |other_piece|
+ if other_piece.colour == player
+ score += game.board.distance_between[here.place][other_piece.position.place] * @friend_pull
+ else
+ score += game.board.distance_between[here.place][other_piece.position.place] * @enemy_pull
+ end
+ end
+ score += piece.contains.length * @capture_bonus
+ score += game.board.distance_between[here.place][game.board.positions[player].place] *
+ piece.contains.length * @base_pull
+ elsif here == game.board.positions[player]
+ score += @safe_bonus
+ end
+ end
+ score
+ end
+
+end
diff --git a/src/.svn/text-base/libttc.rb.svn-base b/src/.svn/text-base/libttc.rb.svn-base
new file mode 100644
index 0000000..97845c7
--- /dev/null
+++ b/src/.svn/text-base/libttc.rb.svn-base
@@ -0,0 +1,615 @@
+# == Synopsis
+#
+# Library to support Trap the Cap play
+#
+# == Author
+# Neil Smith
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+# == Change history
+# Version 1.1:: 07 Sep 2007
+# * Changed format for showing moves via bases.
+# * Raise error when moving via base without captured pieces
+# * Raise error when moving onto a safe space with 3 or more
+# pieces already there
+# Version 1.2:: 10 Sep 2007
+# * Incorporated changes in move legality above into
+# Game#possible_moves
+# Version 1.3:: 25 Mar 2008
+# * Fixed bug to detect a winner, and also eliminate players
+# that have no uncaptured pieces.
+
+# Errors for a game
+
+# Pieces can only capture pieces that they're on.
+class InvalidCaptureError < StandardError
+end
+
+# Moves can only be [1..6] spaces
+class InvalidMoveError < StandardError
+end
+
+# Game is won when only one player has uncaptured pieces
+class GameWonNotice < StandardError
+end
+
+
+# Each possible position for a piece is an object
+# Each neighbour is another position object
+class Position
+ attr_reader :place # the name of this place
+ attr_accessor :contains # the pieces it contains
+ attr_accessor :neighbours # the positions that neighbour it
+
+ def initialize(place, safety, base)
+ @place = place
+ @safe = safety
+ @base = base
+ @neighbours = Array.new
+ end
+
+ # is this position a safety one (i.e. no captures allowed)?
+ def safe?
+ @safe
+ end
+
+ # Is this position a base?
+ def base?
+ @base
+ end
+
+ def to_s
+ @place
+ end
+
+ def to_str
+ to_s
+ end
+
+end
+
+
+# The game board
+class Board
+
+ attr_reader :positions
+ attr_reader :valid_moves
+ attr_reader :distance_between
+ attr_reader :centre
+
+
+ # A laborious procedure to create all the positions and tie them all together
+ def initialize(spokes, spoke_length, arc_length)
+ # A hash of all positions, indexed by position names
+ @positions = Hash.new
+ @centre = Position.new('ac' + spoke_length.to_s, false, false)
+ @positions['ac' + spoke_length.to_s] = centre
+ a1_corner = nil
+ end_of_previous_arc = nil
+
+ # Do each arc-spoke-base set
+ (?a...(?a + spokes)).each do |arc_code|
+ arc = arc_code.chr
+ base = Position.new(arc, false, true)
+ this_arc = Array.new
+
+ # build the arc
+ (1..arc_length).each do |arc_position|
+ position_name = arc + arc_position.to_s
+ arc_place = Position.new(position_name, arc_position == 4, false)
+ arc_place.neighbours = []
+ @positions[position_name] = arc_place
+ this_arc << arc_place
+ a1_corner = a1_corner || arc_place
+ end
+ (0...arc_length).each do |arc_position|
+ if arc_position > 0
+ this_arc[arc_position].neighbours << this_arc[arc_position - 1]
+ end
+ if arc_position < (arc_length - 1)
+ this_arc[arc_position].neighbours << this_arc[arc_position + 1]
+ end
+ end
+
+ # build the spoke
+ this_spoke = Array.new
+ (1..(spoke_length - 1)).each do |spoke_position|
+ position_name = arc + "c" + spoke_position.to_s
+ spoke_place = Position.new(position_name, spoke_position == 3, false)
+ spoke_place.neighbours = []
+ @positions[position_name] = spoke_place
+ this_spoke << spoke_place
+ end
+ (0...(spoke_length - 1)).each do |spoke_position|
+ if spoke_position > 0
+ this_spoke[spoke_position].neighbours << this_spoke[spoke_position - 1]
+ end
+ if spoke_position < spoke_length - 2
+ this_spoke[spoke_position].neighbours << this_spoke[spoke_position + 1]
+ end
+ end
+
+ # tie the spoke and arc together,
+ this_arc[0].neighbours << this_spoke[0]
+ this_spoke[0].neighbours << this_arc[0]
+
+ # tie the spoke to the centre, and
+ this_spoke[-1].neighbours << @centre
+ @centre.neighbours << this_spoke[-1]
+
+ # tie the base to the arc
+ base = Position.new(arc, false, true)
+ @positions[arc] = base
+ base.neighbours << this_arc[0]
+ this_arc[0].neighbours << base
+
+ # record the ends of the arc for tying to adjacent arcs
+ if end_of_previous_arc
+ end_of_previous_arc.neighbours << this_arc[0]
+ this_arc[0].neighbours << end_of_previous_arc
+ end
+ end_of_previous_arc = this_arc[-1]
+
+ end # arc
+
+ # tie both ends of the rim together
+ a1_corner.neighbours << end_of_previous_arc
+ end_of_previous_arc.neighbours << a1_corner
+
+ cache_valid_moves
+
+ end # def
+
+ def to_s
+ layout
+ end
+
+ def to_str
+ to_s
+ end
+
+
+ # For each position, show its name and what it touches
+ def layout
+ out_string = ""
+ @positions.keys.sort.each do |position|
+ out_string << sprintf("%s touches ", @positions[position])
+ @positions[position].neighbours.each do |neighbour|
+ out_string << sprintf("%s, ", neighbour)
+ end
+ out_string << sprintf("\n")
+ end
+ out_string
+ end
+
+
+ # Precompute the valid moves for this board, and the distances between each
+ # pair of positions
+ def cache_valid_moves
+ # A hash of arrays. The has key is the name of a positions. The array
+ # element [i] stores the positions that are i spaces from here
+ @valid_moves = Hash.new
+ # A hash of hashes. Given two names, return the shortest distance between
+ # the two locations
+ @distance_between = Hash.new
+ @positions.each do |place, position|
+ @valid_moves[place] = Array.new
+ @distance_between[place] = Hash.new
+ @valid_moves[place][0] = [@positions[place]]
+ @distance_between[place][place] = 0
+ # Find the shortest routes by Dijkstra's algorithm
+ agenda = [position]
+ closed_list = [position]
+ i = 1
+ while not agenda.empty?
+ @valid_moves[place][i] = []
+ new_agenda = []
+ agenda.each do |pos|
+ valid_extensions = pos.neighbours.reject {|new_position| closed_list.include?(new_position) }
+ @valid_moves[place][i] += valid_extensions
+ valid_extensions.each {|ext| @distance_between[place][ext.place] ||= i }
+ closed_list += valid_extensions
+ new_agenda += valid_extensions
+ end
+ agenda = new_agenda
+ i += 1
+ end
+ end
+ end
+
+end
+
+
+# Each piece on the board is an object
+class Piece
+ attr_reader :colour
+ attr_accessor :position, :contains, :captured
+
+ def initialize(number, position, colour)
+ @number = number
+ @position = position
+ @colour = colour
+ @captured = false
+ @contains = []
+ end
+
+ def name
+ @colour + @number.to_s
+ end
+
+ def to_s
+ self.name
+ end
+
+ def to_str
+ to_s
+ end
+
+ def move_to(new_position)
+ @position = new_position
+ @contains.each {|c| c.move_to(new_position)}
+ end
+
+ # Caputre another piece
+ def capture(other_piece)
+ if @position = other_piece.position
+ @contains << other_piece
+ @contains += other_piece.contains
+ other_piece.contains = []
+ other_piece.captured = true
+ else
+ raise(InvalidCaptureError,
+ "Piece #{self.name} cannot capture #{other_piece.name}: different locations")
+ end
+ end
+
+end
+
+
+# A move in a game
+class Move
+ attr_reader :piece, :destination
+
+ def initialize(piece, destination, via_base = false)
+ @piece = piece
+ @destination = destination
+ @via_base = via_base
+ end
+
+ def via_base?
+ @via_base
+ end
+
+ # Write a move to a string
+ # Note the inverse, String#to_move, is defined below
+ def to_s
+ if @via_base
+ if @destination.base?
+ @piece.to_s + " " + @destination.to_s
+ else
+ @piece.to_s + " " + piece.colour + " " + @destination.to_s
+ end
+ else
+ @piece.to_s + " " + @destination.to_s
+ end
+ end
+
+ def to_str
+ to_s
+ end
+
+end
+
+
+
+# A class to record each of the states previously found in a game.
+# Note that this is a deep copy of the pieces and what they've captured, so
+# you'll need to convert back
+class GameState
+ attr_accessor :move, :player, :pieces_after_move
+
+ def initialize(move, player, pieces)
+ @move = move
+ @player = player
+ @pieces_after_move = Hash.new
+ pieces.each {|k, p| @pieces_after_move[k] = p.dup}
+ @pieces_after_move.each_value {|p| p.contains = []}
+ # and now to make the captured pieces point to the copies
+ pieces.each do |k, p|
+ p.contains.each do |captured_piece|
+ @pieces_after_move[k].capture(@pieces_after_move[captured_piece.name])
+ end
+ end
+ end
+
+ def ==(other)
+ @move.to_s == other.move.to_s and
+ @player == other.player and
+ @piece_after_move == other.pieces_after_move
+ end
+
+end
+
+
+# A game of Trap the Cap. It keeps a history of all previous states.
+class Game
+
+ attr_reader :history
+ attr_reader :current_player, :players
+ attr_reader :board
+ attr_reader :pieces
+
+ # Create a new game
+ def initialize(players = 6, spokes = 6, spoke_length = 6, arc_length = 6,
+ pieces_each = 6)
+ @board = Board.new(spokes, spoke_length, arc_length)
+ @history = []
+ @pieces = Hash.new
+ @players = case
+ when players == 2 ; ['a', 'd']
+ when players == 3 ; ['a', 'c', 'e']
+ when players == 4 ; ['a', 'b', 'd', 'e']
+ when players == 5 ; ['a', 'b', 'c', 'd', 'e']
+ when players == 6 ; ['a', 'b', 'c', 'd', 'e', 'f']
+ end
+ @current_player = 'a'
+ @players.each do |player|
+ players_base = @board.positions[player]
+ (1..pieces_each).each do |count|
+ piece = Piece.new(count, players_base, player)
+ @pieces[player + count.to_s] = piece
+ end
+ end
+ end
+
+
+ # Apply a single move to a game.
+ def apply_move!(move, player = @current_player)
+ # Check the move is a valid one
+ raise(InvalidMoveError, "Piece #{move.piece} does not exist") unless @pieces.has_key?(move.piece.name)
+ raise(InvalidMoveError, "Player #{player} moving piece #{move.piece}") unless move.piece.colour == player
+ raise(InvalidMoveError, "Attempting to move captured piece #{move.piece}") if move.piece.captured
+ raise(InvalidMoveError, "Attempting to move #{move.piece} onto or via base without captured pieces") if move.via_base? and move.piece.contains.empty?
+ if move.destination.safe?
+ if (@pieces.find_all {|k, p| p.position == move.destination}).length >= 3
+ raise(InvalidMoveError, "Attempting to move #{move.piece} onto safe position #{move.destination} when there are already three or more pieces there")
+ end
+ end
+ if move.via_base?
+ moved_distance = board.distance_between[move.piece.position.place][player] +
+ board.distance_between[player][move.destination.place]
+ else
+ moved_distance = board.distance_between[move.piece.position.place][move.destination.place]
+ end
+ raise(InvalidMoveError, "Attempting to move piece #{move.piece} #{moved_distance} places (from #{move.piece.position} to #{move.destination})") if moved_distance < 1 or moved_distance > 6
+
+ # Apply this move
+ move.piece.move_to(move.destination)
+
+ # Capture anything already there (unless it's a safe place or a base,
+ # or our own colour, or already captured)
+ unless move.destination.safe? or move.destination.base?
+ @pieces.each do |name, target_piece|
+ if target_piece.position == move.destination and
+ target_piece != move.piece and
+ not move.piece.contains.member?(target_piece) and
+ target_piece.colour != player and
+ not target_piece.captured
+ move.piece.capture(target_piece)
+ end
+ end
+ end
+
+ # If the move was via our base, drop all captured pieces
+ if move.via_base?
+ capturers_base = board.positions[move.piece.colour]
+ move.piece.contains.each do |captured_piece|
+ captured_piece.move_to capturers_base
+ captured_piece.captured = false if captured_piece.colour == move.piece.colour
+ end
+ move.piece.contains = []
+ end
+
+ # Record the new stae
+ this_game_state = GameState.new(move, player, @pieces)
+ @history << this_game_state
+
+ # Retain only players that have uncaptured pieces.
+ # If there's only one player with uncaptured pieces, declare a win.
+ potential_players = []
+ @players.each do |p|
+ if (@pieces.values.select {|piece| piece.colour == p}).any? {|piece| not piece.captured}
+ potential_players << p
+ end
+ # potential_players << p if (@pieces.values.select {|p| p.colour == @current_player}).any? {|p| not p.captured}
+ end
+ if potential_players.length <= 1
+ raise(GameWonNotice, "Game won by #{potential_players[0]}")
+ end
+ @players = potential_players.sort
+ end
+
+ # Undo a move
+ def undo_move!
+ if @history.length > 1
+ # general case
+ state_to_restore = @history[-2]
+ @current_player = @history[-1].player
+ @pieces.each do |name, piece|
+ copy_piece = state_to_restore.pieces_after_move[name]
+ piece.position = copy_piece.position
+ piece.captured = copy_piece.captured
+ piece.contains = []
+ copy_piece.contains.each do |p|
+# piece.capture(@pieces[p.name])
+ piece.contains << @pieces[p.name]
+ end
+ end
+ @history.pop
+ elsif @history.length == 1
+ # reset to start
+ @current_player = 'a'
+ @pieces.each do |name, piece|
+ piece.position = @board.positions[piece.colour]
+ piece.captured = false
+ piece.contains = []
+ end
+ @history.pop
+ end
+ end
+
+ # Apply a list of moves in order
+ def apply_moves!(moves)
+ moves.each do |move|
+ if move.via_base?
+ moved_distance = board.distance_between[move.piece.position.place][@current_player] +
+ board.distance_between[@current_player][move.destination.place]
+ else
+ moved_distance = board.distance_between[move.piece.position.place][move.destination.place]
+ end
+ self.apply_move!(move, @current_player)
+ next_player! unless moved_distance == 6
+ end
+ end
+
+
+ # Set the current player to be the next player
+ def next_player!
+ original_player = @current_player
+ begin
+ if @current_player == @players[-1]
+ @current_player = @players[0]
+ else
+ @current_player = @players[@players.index(@current_player) + 1]
+ end
+ end while (@pieces.values.select {|p| p.colour == @current_player}).all? {|p| p.captured} and @current_player != original_player
+ @current_player
+ end
+
+
+ # Return an array of all possible moves from this state, given the die roll
+ # and the active player
+ def possible_moves(die_result, player = @current_player)
+ moves = []
+ @pieces.each do |key, piece|
+ # only move current player's pieces, and only if they're not captured
+ if piece.colour == player and (not piece.captured)
+ (@board.valid_moves[piece.position.place][die_result]).each do |destination|
+ if destination.safe?
+ if (@pieces.find_all {|k, p| p.position == destination}).length < 3
+ moves << Move.new(piece, destination, false)
+ end
+ else
+ moves << Move.new(piece, destination, false) unless destination.base?
+ end
+ end
+ # if we can move to our base (but not already on it), add moves via that...
+ if @board.distance_between[piece.position.place][player] <= die_result and
+ not piece.position.place == player and
+ not piece.contains.empty?
+ distance_after_base = die_result - @board.distance_between[piece.position.place][player]
+ (@board.valid_moves[player][distance_after_base]).each do |destination|
+ if destination.safe?
+ if (@pieces.find_all {|k, p| p.position == destination}).length < 3
+ moves << Move.new(piece, destination, true)
+ end
+ else
+ moves << Move.new(piece, destination, true)
+ end
+ end
+ end
+ end
+ end
+ moves
+ end
+
+
+ def build_state_string
+ outstr = "Current player = #{@current_player}\n"
+ @pieces.keys.sort.each do |piece_name|
+ if @pieces[piece_name].captured
+ outstr << "Piece #{piece_name} captured, at #{@pieces[piece_name].position}\n"
+ else
+ outstr << "Piece #{piece_name} is at #{@pieces[piece_name].position}, holds #{(@pieces[piece_name].contains.collect{|c| c.name}).join(' ')}\n"
+ end
+ end
+ outstr
+ end
+
+ # Show the state of the board
+ def show_state
+ puts build_state_string
+# @pieces.keys.sort.each do |piece_name|
+# if @pieces[piece_name].captured
+# puts "Piece #{piece_name} captured, at #{@pieces[piece_name].position}"
+# else
+# puts "Piece #{piece_name} is at #{@pieces[piece_name].position}, holds #{(@pieces[piece_name].contains.collect{|c| c.name}).join(' ')}"
+# end
+# end
+ end
+
+ def to_s
+ show_state
+ end
+
+ def to_str
+ to_s
+ end
+
+
+ # Given a set of lines from an input file, turn them into a Game object and
+ # a set of Move objects.
+ # Note the multiple return values.
+ # Class method
+ def Game.read_game(gamelines)
+ gamelines.each {|l| l.chomp!}
+ game = Game.new(gamelines[0].to_i, 6, 6, 6, 6)
+ moves = []
+ gamelines[1..-2].each {|m| moves << m.to_move(game)}
+ return game, moves, gamelines[-1].to_i
+ end
+
+
+end
+
+
+# Extension to String class to convert a move-description string into a Move object.
+# This is the inverse of the Move#to_s method
+class String
+ def to_move(game)
+ move_elements = self.downcase.split
+ piece_name = move_elements[0]
+ destination_name = move_elements[-1]
+ if destination_name.length > 2 and
+ destination_name[-2,2] == game.board.centre.place[-2,2]
+ destination_name = game.board.centre.place
+ end
+ raise(InvalidMoveError, "Invalid piece in move read") unless game.pieces.has_key?(piece_name)
+ raise(InvalidMoveError, "Invalid destination in move read") unless game.board.positions.has_key?(destination_name)
+ # Deal with the synonyms for the centre position
+ via_base = (destination_name.length == 1 or move_elements.length > 2)
+ Move.new(game.pieces[piece_name], game.board.positions[destination_name], via_base)
+ end
+end
+
+
+# Read a game description file and convert it into a Game object and set of Move objects.
+# Note that Game.read_game method returns multiple values, so this one does too.
+class IO
+ def IO.read_game(filename)
+ gamelines = IO.readlines(filename)
+ return Game.read_game(gamelines)
+ end
+end
diff --git a/src/.svn/text-base/play.rb.netbeans-base b/src/.svn/text-base/play.rb.netbeans-base
new file mode 100644
index 0000000..01b2f29
--- /dev/null
+++ b/src/.svn/text-base/play.rb.netbeans-base
@@ -0,0 +1,61 @@
+# == Synopsis
+#
+# Play a game of Trap the Cap.
+#
+# == Author
+# Neil Smith
+#
+# == Change history
+# Version 1.1:: 23 April 2008
+
+require 'lib/libttc'
+require 'lib/libpplayer'
+
+# Play a game to completion, given a set of player agents.
+class GameHandler
+
+ attr_reader :game
+
+ # Create a game handler that uses a set of players
+ def initialize(players, limit = 5000, verbose = false, very_verbose = false)
+ @game = Game.new(players.length)
+ @verbose = verbose
+ @very_verbose = very_verbose
+ @limit = limit
+
+ # Give each player a name
+ @named_players = Hash.new
+ (@game.players.zip players).each do |kv|
+ @named_players[kv[0]] = kv[1]
+ end
+ end
+
+ # Play a game of Trap the Cap. If players make illegal moves, disqualify them and restart the game.
+ # Terminate the game if there's a winner, there's only one player left,
+ # or the game has gone on too long.
+ def play
+ while @game.history.length < @limit
+ roll = rand(6) + 1
+ move_to_apply = @named_players[@game.current_player].best_move(@game, roll)
+ puts "Move #{@game.history.length + 1}: Player #{@game.current_player} rolled #{roll}: making move #{move_to_apply}" if @verbose
+ @game.apply_moves! [move_to_apply]
+ puts @game if @very_verbose
+ end
+ puts "Game terminated after #{@game.history.length} moves" if @verbose
+ [:draw, @limit]
+ rescue GameWonNotice => win_notification
+ winner = win_notification.message[-1,1]
+ puts "Game won by #{winner} in #{@game.history.length} moves" if @verbose
+ [@named_players[winner], @game.history.length]
+ rescue InvalidCaptureError, InvalidMoveError
+ puts "Disqualifying player #{@game.current_player}" if @verbose
+ @named_players.delete @game.current_player
+ if @named_players.length > 1
+ retry
+ else
+ puts "Game won by #{@named_players.keys[0]} by default" if @verbose
+ [@named_players[@named_players.keys[0]], 0]
+ end
+ end
+end
+
\ No newline at end of file
diff --git a/src/.svn/text-base/play.rb.svn-base b/src/.svn/text-base/play.rb.svn-base
new file mode 100644
index 0000000..01b2f29
--- /dev/null
+++ b/src/.svn/text-base/play.rb.svn-base
@@ -0,0 +1,61 @@
+# == Synopsis
+#
+# Play a game of Trap the Cap.
+#
+# == Author
+# Neil Smith
+#
+# == Change history
+# Version 1.1:: 23 April 2008
+
+require 'lib/libttc'
+require 'lib/libpplayer'
+
+# Play a game to completion, given a set of player agents.
+class GameHandler
+
+ attr_reader :game
+
+ # Create a game handler that uses a set of players
+ def initialize(players, limit = 5000, verbose = false, very_verbose = false)
+ @game = Game.new(players.length)
+ @verbose = verbose
+ @very_verbose = very_verbose
+ @limit = limit
+
+ # Give each player a name
+ @named_players = Hash.new
+ (@game.players.zip players).each do |kv|
+ @named_players[kv[0]] = kv[1]
+ end
+ end
+
+ # Play a game of Trap the Cap. If players make illegal moves, disqualify them and restart the game.
+ # Terminate the game if there's a winner, there's only one player left,
+ # or the game has gone on too long.
+ def play
+ while @game.history.length < @limit
+ roll = rand(6) + 1
+ move_to_apply = @named_players[@game.current_player].best_move(@game, roll)
+ puts "Move #{@game.history.length + 1}: Player #{@game.current_player} rolled #{roll}: making move #{move_to_apply}" if @verbose
+ @game.apply_moves! [move_to_apply]
+ puts @game if @very_verbose
+ end
+ puts "Game terminated after #{@game.history.length} moves" if @verbose
+ [:draw, @limit]
+ rescue GameWonNotice => win_notification
+ winner = win_notification.message[-1,1]
+ puts "Game won by #{winner} in #{@game.history.length} moves" if @verbose
+ [@named_players[winner], @game.history.length]
+ rescue InvalidCaptureError, InvalidMoveError
+ puts "Disqualifying player #{@game.current_player}" if @verbose
+ @named_players.delete @game.current_player
+ if @named_players.length > 1
+ retry
+ else
+ puts "Game won by #{@named_players.keys[0]} by default" if @verbose
+ [@named_players[@named_players.keys[0]], 0]
+ end
+ end
+end
+
\ No newline at end of file
diff --git a/src/.svn/text-base/sample-game.txt.svn-base b/src/.svn/text-base/sample-game.txt.svn-base
new file mode 100644
index 0000000..9cffeaf
--- /dev/null
+++ b/src/.svn/text-base/sample-game.txt.svn-base
@@ -0,0 +1,8 @@
+3
+A1 AC2
+C4 B5
+E1 EC5
+E2 E3
+A1 EC5
+C4 B2
+4
\ No newline at end of file
diff --git a/src/.svn/text-base/selection.rb.svn-base b/src/.svn/text-base/selection.rb.svn-base
new file mode 100644
index 0000000..7422a7d
--- /dev/null
+++ b/src/.svn/text-base/selection.rb.svn-base
@@ -0,0 +1,78 @@
+# == Synopsis
+#
+# Use a GA to breed a good potential player
+#
+# == Author
+# Neil Smith
+#
+# == Change history
+# Version 1.1:: 23 April 2008
+
+
+require 'libttc'
+require 'libpplayer'
+require 'libgenetics'
+require 'play'
+
+class Population
+ # Use tournament selection to pick an individual for the next generation
+ def tournament_select_one(winner_success_chance = 0.8, max_game_length= 1000, verbose = false)
+ player_count = rand(5) + 2
+ pool_size = @individuals.length
+ players = []
+ 1.upto(player_count) { players << @individuals[rand(pool_size)].to_potential_player }
+ game = GameHandler.new(players, max_game_length, false, false)
+ winner, length = game.play
+ puts "Winner = #{winner} in #{length} moves. Game had #{player_count} players" if verbose
+ # If the game was a draw, or the winner is unlucky, pick a parent at random
+ if winner == :draw or rand > winner_success_chance
+ successful_player = players[rand(player_count)]
+ else
+ successful_player = winner
+ end
+ successful_player
+ end
+
+ # Select a new population the same size as the current population
+ def tournament_select_population(winner_success_chance = 0.8, max_game_length = 1000, verbose = false)
+ new_population = []
+ 1.upto(@individuals.length) do
+ new_population << tournament_select_one(winner_success_chance, max_game_length, verbose).to_genome
+ puts "Created #{new_population.length} indivduals" if verbose
+ end
+ new_population
+ end
+
+end
+
+class Potential_player
+ # Convert a player to a bitstring
+ def to_bitstring
+ (@friend_pull * 4).to_i.to_bitstring(4).gray_encode +
+ (@enemy_pull * 4).to_i.to_bitstring(4).gray_encode +
+ (@base_pull * 4).to_i.to_bitstring(4).gray_encode +
+ @safe_bonus.to_bitstring(4).gray_encode +
+ @capture_bonus.to_bitstring(4).gray_encode
+ end
+
+ # Convert a player to a genome
+ def to_genome
+ Genome.new(self.to_bitstring)
+ end
+end
+
+
+class Genome
+
+ # Create a potential player from a genome
+ def to_potential_player
+ friend_pull = @genome[0, 4].gray_decode.to_decimal.to_f / 4
+ enemy_pull = @genome[4, 4].gray_decode.to_decimal.to_f / 4
+ base_pull = @genome[8, 4].gray_decode.to_decimal.to_f / 4
+ safe_bonus = @genome[12, 4].gray_decode.to_decimal
+ capture_bonus = @genome[16, 4].gray_decode.to_decimal
+ Potential_player.new({:friend_pull => friend_pull,
+ :enemy_pull => enemy_pull, :base_pull => base_pull,
+ :safe_bonus => safe_bonus, :capture_bonus => capture_bonus})
+ end
+end
diff --git a/src/.svn/text-base/ttc-ga-clustering.rb.svn-base b/src/.svn/text-base/ttc-ga-clustering.rb.svn-base
new file mode 100644
index 0000000..6396d06
--- /dev/null
+++ b/src/.svn/text-base/ttc-ga-clustering.rb.svn-base
@@ -0,0 +1,27 @@
+require '/home/neil/programming/ruby/programming-collective/intelligence/k-means-clustering'
+
+def read_genome_file(filename)
+ genomes = []
+ IO.foreach(filename) { |line| genomes << line.chomp.split('').collect {|i| i.to_i} }
+ genomes
+end
+
+def find_centroid_sets(rows, k = 10, n = 10)
+ centroid_set = []
+ 1.upto(n) do
+ centroid_set << (k_means_cluster(rows, k, :domain => :discrete) {|x, y| hamming_distance x, y})
+ end
+ centroid_set
+end
+
+def order_centroids_by_cluster_size(centroids, rows)
+ clusters = clusters_of_centroids(centroids, rows) {|x, y| hamming_distance x, y}
+ cluster_sizes = clusters.collect {|c| c.length}
+ sized_centroids = centroid.zip(cluster_sizes)
+ sorted_sized_centroids = (sized_centroids.sort_by {|t| t[1]}).reverse
+end
+
+def best_centroids(centroid_set)
+ centroid_set.collect {|tc| tc[0][0]}
+end
+
\ No newline at end of file
diff --git a/src/.svn/text-base/ttc.rb.svn-base b/src/.svn/text-base/ttc.rb.svn-base
new file mode 100644
index 0000000..9526d54
--- /dev/null
+++ b/src/.svn/text-base/ttc.rb.svn-base
@@ -0,0 +1,36 @@
+#!/usr/bin/ruby -w
+#
+# == Synopsis
+#
+# Play one move of a Trap the Cap game
+#
+# == Usage
+# ttc [ -b | --board-size SIZE ] [ -i | --input FILE ] [ -r | --robot ROBOT ] [ -h | --help ]
+#
+# == Author
+# Neil Smith
+
+require File.join(File.dirname(__FILE__), '..', 'lib', 'libttc')
+require 'open3'
+require 'timeout'
+require 'optparse'
+require 'rdoc/usage'
+
+
+class InvalidRobotError < StandardError
+end
+
+class NoInputFileError < StandardError
+end
+
+class InvalidMoveInHistoryError < StandardError
+end
+
+class GameWonInHistoryError < StandardError
+end
+
+
+
+board = Board.new(6, 5, 6)
+puts board
+
diff --git a/src/cgi-files/.svn/all-wcprops b/src/cgi-files/.svn/all-wcprops
new file mode 100644
index 0000000..6ce5f64
--- /dev/null
+++ b/src/cgi-files/.svn/all-wcprops
@@ -0,0 +1,11 @@
+K 25
+svn:wc:ra_dav:version-url
+V 52
+/svn/njae/!svn/ver/65/TrapTheCap/trunk/src/cgi-files
+END
+ttc-simple.rb
+K 25
+svn:wc:ra_dav:version-url
+V 66
+/svn/njae/!svn/ver/71/TrapTheCap/trunk/src/cgi-files/ttc-simple.rb
+END
diff --git a/src/cgi-files/.svn/entries b/src/cgi-files/.svn/entries
new file mode 100644
index 0000000..7287613
--- /dev/null
+++ b/src/cgi-files/.svn/entries
@@ -0,0 +1,41 @@
+8
+
+dir
+68
+http://scripts.njae.me.uk/svn/njae/TrapTheCap/trunk/src/cgi-files
+http://scripts.njae.me.uk/svn/njae
+
+
+
+2009-01-30T14:59:52.075953Z
+65
+
+
+
+svn:special svn:externals svn:needs-lock
+
+
+
+
+
+
+
+
+
+
+
+0ada9808-85ab-4924-adda-5bf89eae3818
+
+ttc-simple.rb
+file
+71
+
+
+
+2009-02-23T14:20:37.000000Z
+ba2f5d4e3bfffbcc1393e87df9638fcd
+2009-02-23T14:20:51.158868Z
+71
+
+has-props
+
diff --git a/src/cgi-files/.svn/format b/src/cgi-files/.svn/format
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/src/cgi-files/.svn/format
@@ -0,0 +1 @@
+8
diff --git a/src/cgi-files/.svn/prop-base/ttc-simple.rb.svn-base b/src/cgi-files/.svn/prop-base/ttc-simple.rb.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/src/cgi-files/.svn/prop-base/ttc-simple.rb.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/src/cgi-files/.svn/text-base/ttc-simple.rb.svn-base b/src/cgi-files/.svn/text-base/ttc-simple.rb.svn-base
new file mode 100644
index 0000000..903754b
--- /dev/null
+++ b/src/cgi-files/.svn/text-base/ttc-simple.rb.svn-base
@@ -0,0 +1,151 @@
+#!/usr/bin/ruby -w
+#
+# == Synopsis
+#
+# Play one move of a Trap the Cap game
+#
+# == Usage
+# ttc [ -b | --board-size SIZE ] [ -i | --input FILE ] [ -r | --robot ROBOT ] [ -h | --help ]
+#
+# == Author
+# Neil Smith
+
+require 'libttc'
+require 'cgi'
+require 'open3'
+require 'timeout'
+
+# Prevent dangerous operations
+$SAFE = 1
+
+class InvalidRobotError < StandardError
+end
+
+class NoInputFileError < StandardError
+end
+
+class InvalidMoveInHistoryError < StandardError
+end
+
+class GameWonInHistoryError < StandardError
+end
+
+
+# A table of the known game-playing robots
+
+$ROBOT_NAME_TABLE = {
+ 'Always clockwise simple' => '/var/www/scripts.njae.me.uk/trap-the-cap/robots/1',
+ 'Clockwise cloud' => '/var/www/scripts.njae.me.uk/trap-the-cap/robots/2',
+ 'GA generation 1006' => '/var/www/scripts.njae.me.uk/trap-the-cap/robots/3'
+}
+
+$ROBOT_CODE_TABLE = {
+ '1' => '/var/www/scripts.njae.me.uk/trap-the-cap/robots/1',
+ '2' => '/var/www/scripts.njae.me.uk/trap-the-cap/robots/2',
+ '3' => '/var/www/scripts.njae.me.uk/trap-the-cap/robots/3'
+}
+
+
+# How long the robot has to respond
+$ROBOT_TIMEOUT = 10
+
+
+def generate_output(cgi, returned_move, annotation)
+ if returned_move.empty?
+ return_part = ""
+ else
+ return_part = cgi.p { "Result is: " } + "\n" + cgi.h1 { returned_move } + "\n"
+ end
+
+ if annotation.empty?
+ annotation_part = ""
+ else
+ annotation_part = cgi.p { annotation }
+ end
+
+ cgi.html {
+ cgi.head { "\n" + cgi.title{"Move result"} } + "\n" +
+ cgi.body { return_part + annotation_part }
+ }
+end
+
+
+begin
+
+ cgi = CGI.new("html4")
+
+ chosen_robot = cgi['robot']
+ if $ROBOT_NAME_TABLE.has_key? chosen_robot
+ chosen_robot_dir = $ROBOT_NAME_TABLE[chosen_robot]
+ chosen_robot_dir.untaint
+ else
+ raise InvalidRobotError, "#{chosen_robot} is not a valid robot code"
+ end
+
+ begin
+ game, moves, next_roll = Game.read_game(cgi['moves'].downcase.split("\n"))
+ game.apply_moves! moves
+ rescue InvalidMoveError => error
+ raise(InvalidMoveInHistoryError, error.message)
+ rescue GameWonNotice => error
+ raise(GameWonInHistoryError, error.message)
+ end
+
+ current_directory = Dir.pwd
+ current_directory.untaint
+ Dir.chdir chosen_robot_dir
+
+ returned_move = ""
+ returned_error = ""
+ robot_input = game.players.length.to_s + "\n"
+ robot_input += (moves.collect {|m| m.to_s}).join("\n") + "\n" if not moves.empty?
+ robot_input += next_roll.to_s
+
+# cgi.out { generate_output(cgi, "", "passing robot #{game.players.length.to_s + "#" + (moves.collect {|m| m.to_s}).join('!\n!') + "#" + next_roll.to_s}!") }
+# cgi.out { generate_output(cgi, "", "passing robot #{robot_input}!") }
+
+
+ Timeout.timeout($ROBOT_TIMEOUT + 1) do
+ Open3.popen3('./runme') do |robot_in, robot_out, robot_err|
+ robot_in << robot_input
+ robot_in.close_write
+ returned_move = robot_out.gets
+ returned_error = robot_err.gets
+ end
+ end
+
+ Dir.chdir current_directory
+
+# cgi.out { generate_output(cgi, "", "Returned move #{returned_move}; robot error was #{returned_error}!") }
+
+ raise(InvalidMoveError, "Robot returned error '#{returned_error}'") if returned_error != nil
+ raise(InvalidMoveError, "Null move") if returned_move.nil? or returned_move.empty?
+ next_move = returned_move.chomp.to_move(game)
+ game.apply_move! next_move
+
+# cgi.out { generate_output(cgi, "", "Applied move #{returned_move}!") }
+ cgi.out { generate_output(cgi, returned_move, "") }
+
+rescue InvalidMoveInHistoryError => error
+ cgi.out { generate_output(cgi, "", "Invalid move in history: #{error}") }
+# puts "Invalid move in history: #{error}"
+rescue GameWonInHistoryError => error
+ cgi.out { generate_output(cgi, "", "Game already won in historic moves: #{error}") }
+# puts "Game already won in historic moves: #{error}"
+
+rescue InvalidMoveError => error
+ cgi.out { generate_output(cgi, "", "Robot returned invalid move: #{error}") }
+# puts "Robot returned invalid move: #{error}"
+rescue GameWonNotice => error
+ cgi.out { generate_output(cgi, returned_move, "Game won: #{error}") }
+# puts "Robot returned #{returned_move}"
+# puts "Game won: #{error}"
+
+rescue InvalidRobotError => error
+ cgi.out { generate_output(cgi, "", "Invalid robot selection: #{error}") }
+# puts "Invalid robot selection: #{error}"
+rescue Timeout::Error => error
+ cgi.out { generate_output(cgi, "", "Robot timed out") }
+# puts "Robot timeout: #{error}"
+
+end
diff --git a/src/cgi-files/ttc-simple.rb b/src/cgi-files/ttc-simple.rb
new file mode 100755
index 0000000..903754b
--- /dev/null
+++ b/src/cgi-files/ttc-simple.rb
@@ -0,0 +1,151 @@
+#!/usr/bin/ruby -w
+#
+# == Synopsis
+#
+# Play one move of a Trap the Cap game
+#
+# == Usage
+# ttc [ -b | --board-size SIZE ] [ -i | --input FILE ] [ -r | --robot ROBOT ] [ -h | --help ]
+#
+# == Author
+# Neil Smith
+
+require 'libttc'
+require 'cgi'
+require 'open3'
+require 'timeout'
+
+# Prevent dangerous operations
+$SAFE = 1
+
+class InvalidRobotError < StandardError
+end
+
+class NoInputFileError < StandardError
+end
+
+class InvalidMoveInHistoryError < StandardError
+end
+
+class GameWonInHistoryError < StandardError
+end
+
+
+# A table of the known game-playing robots
+
+$ROBOT_NAME_TABLE = {
+ 'Always clockwise simple' => '/var/www/scripts.njae.me.uk/trap-the-cap/robots/1',
+ 'Clockwise cloud' => '/var/www/scripts.njae.me.uk/trap-the-cap/robots/2',
+ 'GA generation 1006' => '/var/www/scripts.njae.me.uk/trap-the-cap/robots/3'
+}
+
+$ROBOT_CODE_TABLE = {
+ '1' => '/var/www/scripts.njae.me.uk/trap-the-cap/robots/1',
+ '2' => '/var/www/scripts.njae.me.uk/trap-the-cap/robots/2',
+ '3' => '/var/www/scripts.njae.me.uk/trap-the-cap/robots/3'
+}
+
+
+# How long the robot has to respond
+$ROBOT_TIMEOUT = 10
+
+
+def generate_output(cgi, returned_move, annotation)
+ if returned_move.empty?
+ return_part = ""
+ else
+ return_part = cgi.p { "Result is: " } + "\n" + cgi.h1 { returned_move } + "\n"
+ end
+
+ if annotation.empty?
+ annotation_part = ""
+ else
+ annotation_part = cgi.p { annotation }
+ end
+
+ cgi.html {
+ cgi.head { "\n" + cgi.title{"Move result"} } + "\n" +
+ cgi.body { return_part + annotation_part }
+ }
+end
+
+
+begin
+
+ cgi = CGI.new("html4")
+
+ chosen_robot = cgi['robot']
+ if $ROBOT_NAME_TABLE.has_key? chosen_robot
+ chosen_robot_dir = $ROBOT_NAME_TABLE[chosen_robot]
+ chosen_robot_dir.untaint
+ else
+ raise InvalidRobotError, "#{chosen_robot} is not a valid robot code"
+ end
+
+ begin
+ game, moves, next_roll = Game.read_game(cgi['moves'].downcase.split("\n"))
+ game.apply_moves! moves
+ rescue InvalidMoveError => error
+ raise(InvalidMoveInHistoryError, error.message)
+ rescue GameWonNotice => error
+ raise(GameWonInHistoryError, error.message)
+ end
+
+ current_directory = Dir.pwd
+ current_directory.untaint
+ Dir.chdir chosen_robot_dir
+
+ returned_move = ""
+ returned_error = ""
+ robot_input = game.players.length.to_s + "\n"
+ robot_input += (moves.collect {|m| m.to_s}).join("\n") + "\n" if not moves.empty?
+ robot_input += next_roll.to_s
+
+# cgi.out { generate_output(cgi, "", "passing robot #{game.players.length.to_s + "#" + (moves.collect {|m| m.to_s}).join('!\n!') + "#" + next_roll.to_s}!") }
+# cgi.out { generate_output(cgi, "", "passing robot #{robot_input}!") }
+
+
+ Timeout.timeout($ROBOT_TIMEOUT + 1) do
+ Open3.popen3('./runme') do |robot_in, robot_out, robot_err|
+ robot_in << robot_input
+ robot_in.close_write
+ returned_move = robot_out.gets
+ returned_error = robot_err.gets
+ end
+ end
+
+ Dir.chdir current_directory
+
+# cgi.out { generate_output(cgi, "", "Returned move #{returned_move}; robot error was #{returned_error}!") }
+
+ raise(InvalidMoveError, "Robot returned error '#{returned_error}'") if returned_error != nil
+ raise(InvalidMoveError, "Null move") if returned_move.nil? or returned_move.empty?
+ next_move = returned_move.chomp.to_move(game)
+ game.apply_move! next_move
+
+# cgi.out { generate_output(cgi, "", "Applied move #{returned_move}!") }
+ cgi.out { generate_output(cgi, returned_move, "") }
+
+rescue InvalidMoveInHistoryError => error
+ cgi.out { generate_output(cgi, "", "Invalid move in history: #{error}") }
+# puts "Invalid move in history: #{error}"
+rescue GameWonInHistoryError => error
+ cgi.out { generate_output(cgi, "", "Game already won in historic moves: #{error}") }
+# puts "Game already won in historic moves: #{error}"
+
+rescue InvalidMoveError => error
+ cgi.out { generate_output(cgi, "", "Robot returned invalid move: #{error}") }
+# puts "Robot returned invalid move: #{error}"
+rescue GameWonNotice => error
+ cgi.out { generate_output(cgi, returned_move, "Game won: #{error}") }
+# puts "Robot returned #{returned_move}"
+# puts "Game won: #{error}"
+
+rescue InvalidRobotError => error
+ cgi.out { generate_output(cgi, "", "Invalid robot selection: #{error}") }
+# puts "Invalid robot selection: #{error}"
+rescue Timeout::Error => error
+ cgi.out { generate_output(cgi, "", "Robot timed out") }
+# puts "Robot timeout: #{error}"
+
+end
diff --git a/src/clockwise-cloud.rb b/src/clockwise-cloud.rb
new file mode 100644
index 0000000..3df362f
--- /dev/null
+++ b/src/clockwise-cloud.rb
@@ -0,0 +1,77 @@
+#!/usr/bin/ruby
+#
+# == Synopsis
+#
+# Play one move of a Trap the Cap game
+#
+# == Usage
+# clockwise-p1
+# Game state file read on STDIN
+# Move produced on STDOUT
+#
+# == Author
+# Neil Smith
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+
+
+require 'libttc'
+
+def more_clockwise(this, other)
+ here = this.place
+ there = other.place
+
+ # if both are on a spoke, choose the one with the lowest number (nearer the rim)
+ if here =~ /.c./ and there =~ /.c./
+ # break ties by preferring the most clockwise arc
+ if here[-1] == there[-1]
+ return here[0] <=> there[0]
+ else
+ return -1 * (here[-1] <=> there[-1])
+ end
+ # If one is one a spoke and the other is on the rim, choose the one on the rim
+ elsif here =~ /.c./ or there =~ /.c./
+ return -1 * (here.length <=> there.length)
+ # If one is in the 'f' rim section and the other in the 'a' rim section, choose the 'a'
+ elsif here[0,1] == 'a' and there[0,1] == 'f'
+ return +1
+ elsif here[0,1] == 'f' and there[0,1] == 'a'
+ return -1
+ # Otherwise, choose the one with highest arc code
+ else
+ return here <=> there
+ end
+
+end
+
+# Get the current game state
+game_lines = readlines
+game, moves, next_roll = Game.read_game(game_lines)
+game.apply_moves moves
+
+
+# The piece to move is the least clockwise of my uncaptured pieces
+# Always move pieces on the base first
+my_pieces = game.pieces.values.select {|p| p.colour == game.current_player and not p.captured}
+piece_to_move = (my_pieces.sort {|x, y| more_clockwise x.position, y.position})[0]
+
+# Find the most clockwise move for this piece
+potential_moves = game.possible_moves(next_roll).select {|m| m.piece == piece_to_move}
+sorted_moves = potential_moves.sort {|x, y| more_clockwise x.destination, y.destination}
+best_move = sorted_moves[-1]
+
+# return that move
+puts best_move
+
+
diff --git a/src/clockwise-p1.rb b/src/clockwise-p1.rb
new file mode 100644
index 0000000..fd8e726
--- /dev/null
+++ b/src/clockwise-p1.rb
@@ -0,0 +1,63 @@
+#!/usr/bin/ruby
+#
+# == Synopsis
+#
+# Play one move of a Trap the Cap game
+#
+# == Usage
+# clockwise-p1
+# Game state file read on STDIN
+# Move produced on STDOUT
+#
+# == Author
+# Neil Smith
+
+
+require 'libttc'
+require 'rdoc/usage'
+
+def more_clockwise(this, other)
+ here = this.destination.place
+ there = other.destination.place
+
+ # if both are on a spoke, choose the one with the lowest number (nearer the rim)
+ if here =~ /.c./ and there =~ /.c./
+ # break ties by preferring the most clockwise arc
+ if here[-1] == there[-1]
+ return here[0] <=> there[0]
+ else
+ return -1 * (here[-1] <=> there[-1])
+ end
+ # If one is one a spoke and the other is on the rim, choose the one on the rim
+ elsif here =~ /.c./ or there =~ /.c./
+ return -1 * (here.length <=> there.length)
+ # If one is in the 'f' rim section and the other in the 'a' rim section, choose the 'a'
+ elsif here[0,1] == 'a' and there[0,1] == 'f'
+ return +1
+ elsif here[0,1] == 'f' and there[0,1] == 'a'
+ return -1
+ # Otherwise, choose the one with highest arc code
+ else
+ return here <=> there
+ end
+
+end
+
+# Get the current game state
+game_lines = readlines
+game, moves, next_roll = Game.read_game(game_lines)
+game.apply_moves moves
+
+# The piece to move is the uncaptured one of mine with the lowest number
+my_pieces = game.pieces.values.select {|p| p.colour == game.current_player and not p.captured}
+piece_to_move = (my_pieces.sort_by {|p| p.name})[0]
+
+# find the most clockwise move
+potential_moves = game.possible_moves(next_roll).select {|m| m.piece == piece_to_move}
+sorted_moves = potential_moves.sort {|x, y| more_clockwise x, y}
+best_move = sorted_moves[-1]
+
+# return that move
+puts best_move
+
+
diff --git a/src/gen1006-clusters-old.txt b/src/gen1006-clusters-old.txt
new file mode 100644
index 0000000..3f15863
--- /dev/null
+++ b/src/gen1006-clusters-old.txt
@@ -0,0 +1,156 @@
+[[0,0,0,0,0,1,0,0,1,1,1,0,1,1,1,1,0,0,1,1], 16]
+[[0,0,1,0,0,0,0,0,0,1,0,1,1,1,0,1,0,0,1,1], 17]
+[[0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,1,0,0,1,1], 19]
+[[0,0,0,0,1,0,1,1,0,1,1,1,0,1,1,1,1,0,0,1], 20]
+[[0,0,0,0,0,0,1,0,1,0,1,1,0,0,1,1,0,1,0,1], 22]
+[[0,0,0,0,0,0,1,0,1,0,0,0,1,0,0,1,0,1,1,0], 27]
+[[0,0,0,0,0,1,0,0,0,0,1,0,1,0,0,0,1,1,1,0], 31]
+[[0,0,0,1,0,0,1,0,0,0,0,1,1,0,0,0,1,1,1,1], 43]
+[[0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0], 65]
+[[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,1], 140]
+--
+[[0,0,0,1,0,0,1,0,1,1,0,0,1,0,0,1,0,0,1,1], 19]
+[[0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,1,0], 26]
+[[0,0,0,1,0,1,1,0,0,0,1,1,1,0,0,0,1,1,0,0], 29]
+[[0,0,0,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36] [[0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,1,1,0], 42] [[0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,1,0,0,1,0], 58] [[0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,1], 99]
diff --git a/src/gen1006-clusters.txt b/src/gen1006-clusters.txt
new file mode 100644
index 0000000..60fe934
--- /dev/null
+++ b/src/gen1006-clusters.txt
@@ -0,0 +1,13 @@
+[[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,1], 140] [[0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0], 65] [[0,0,0,1,0,0,1,0,0,0,0,1,1,0,0,0,1,1,1,1], 43] [[0,0,0,0,0,1,0,0,0,0,1,0,1,0,0,0,1,1,1,0], 31] [[0,0,0,0,0,0,1,0,1,0,0,0,1,0,0,1,0,1,1,0], 27] [[0,0,0,0,0,0,1,0,1,0,1,1,0,0,1,1,0,1,0,1], 22] [[0,0,0,0,1,0,1,1,0,1,1,1,0,1,1,1,1,0,0,1], 20] [[0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,1,0,0,1,1], 19] [[0,0,1,0,0,0,0,0,0,1,0,1,1,1,0,1,0,0,1,1], 17] [[0,0,0,0,0,1,0,0,1,1,1,0,1,1,1,1,0,0,1,1], 16]
+[[0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,0,0,1,0], 81] [[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,1], 65] [[0,0,0,0,0,0,0,1,0,0,1,0,0,1,1,1,0,0,0,1], 48] [[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0], 45] [[0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,0,0], 29] [[0,0,0,0,0,0,0,1,0,1,1,1,1,0,0,0,1,1,1,1], 29] [[0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,0,1,0], 29] [[0,0,0,1,0,1,1,0,0,0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755
index 0000000..2e49434
--- /dev/null
+++ b/src/gen1006.rb
@@ -0,0 +1,35 @@
+#!/usr/bin/ruby
+#
+# == Synopsis
+#
+# Play one move of a Trap the Cap game
+#
+# == Usage
+# clockwise-p1
+# Game state file read on STDIN
+# Move produced on STDOUT
+#
+# == Author
+# Neil Smith
+
+
+require 'libttc'
+require 'libttc-pplayer'
+require 'rdoc/usage'
+
+
+# Get the current game state
+game_lines = readlines
+game, moves, next_roll = Game.read_game(game_lines)
+game.apply_moves! moves
+
+player = Potential_player.new({:friend_pull => 0.0,
+ :enemy_pull => 0.0,
+ :base_pull => 0.0,
+ :safe_bonus => 10,
+ :capture_bonus => 2})
+
+best_move = player.best_move(game, next_roll)
+
+# return that move
+puts best_move
diff --git a/src/html-files/.svn/all-wcprops b/src/html-files/.svn/all-wcprops
new file mode 100644
index 0000000..660e5fd
--- /dev/null
+++ b/src/html-files/.svn/all-wcprops
@@ -0,0 +1,59 @@
+K 25
+svn:wc:ra_dav:version-url
+V 53
+/svn/njae/!svn/ver/41/TrapTheCap/trunk/src/html-files
+END
+layout.html
+K 25
+svn:wc:ra_dav:version-url
+V 65
+/svn/njae/!svn/ver/41/TrapTheCap/trunk/src/html-files/layout.html
+END
+board-thumb.jpg
+K 25
+svn:wc:ra_dav:version-url
+V 69
+/svn/njae/!svn/ver/41/TrapTheCap/trunk/src/html-files/board-thumb.jpg
+END
+interface.html
+K 25
+svn:wc:ra_dav:version-url
+V 68
+/svn/njae/!svn/ver/70/TrapTheCap/trunk/src/html-files/interface.html
+END
+schematic-board-thumb.png
+K 25
+svn:wc:ra_dav:version-url
+V 79
+/svn/njae/!svn/ver/41/TrapTheCap/trunk/src/html-files/schematic-board-thumb.png
+END
+board.jpg
+K 25
+svn:wc:ra_dav:version-url
+V 63
+/svn/njae/!svn/ver/41/TrapTheCap/trunk/src/html-files/board.jpg
+END
+schematic-board.png
+K 25
+svn:wc:ra_dav:version-url
+V 73
+/svn/njae/!svn/ver/41/TrapTheCap/trunk/src/html-files/schematic-board.png
+END
+index.html
+K 25
+svn:wc:ra_dav:version-url
+V 64
+/svn/njae/!svn/ver/70/TrapTheCap/trunk/src/html-files/index.html
+END
+simple.html
+K 25
+svn:wc:ra_dav:version-url
+V 65
+/svn/njae/!svn/ver/69/TrapTheCap/trunk/src/html-files/simple.html
+END
+trap-the-cap.pdf
+K 25
+svn:wc:ra_dav:version-url
+V 70
+/svn/njae/!svn/ver/41/TrapTheCap/trunk/src/html-files/trap-the-cap.pdf
+END
diff --git a/src/html-files/.svn/entries b/src/html-files/.svn/entries
new file mode 100644
index 0000000..a909c3b
--- /dev/null
+++ b/src/html-files/.svn/entries
@@ -0,0 +1,128 @@
+8
+
+dir
+68
+http://scripts.njae.me.uk/svn/njae/TrapTheCap/trunk/src/html-files
+http://scripts.njae.me.uk/svn/njae
+
+
+
+2008-10-16T14:11:23.436422Z
+41
+
+
+
+svn:special svn:externals svn:needs-lock
+
+layout.html
+file
+
+
+
+
+2007-05-14T21:17:46.000000Z
+2f4d0c3ae6d9e99aeb5023c4a1d06463
+2008-10-16T14:11:23.436422Z
+41
+
+interface.html
+file
+70
+
+
+
+2009-02-23T14:08:48.000000Z
+cb3ca592cfbf181798dd5374fb31c5df
+2009-02-23T14:09:06.882172Z
+70
+
+board-thumb.jpg
+file
+
+
+
+
+2007-05-14T21:17:46.000000Z
+11bf63c82d0d8b62e42e1868a3247cff
+2008-10-16T14:11:23.436422Z
+41
+
+has-props
+
+schematic-board-thumb.png
+file
+
+
+
+
+2007-05-14T21:17:46.000000Z
+faa2c4f54dcd474c027faec304b91548
+2008-10-16T14:11:23.436422Z
+41
+
+has-props
+
+board.jpg
+file
+
+
+
+
+2007-05-14T21:17:46.000000Z
+b52bed753ac7272a364b4569d235b219
+2008-10-16T14:11:23.436422Z
+41
+
+has-props
+
+robots
+dir
+
+schematic-board.png
+file
+
+
+
+
+2007-05-14T21:17:46.000000Z
+7369d4c42a02fc535e19bd68d0d2e209
+2008-10-16T14:11:23.436422Z
+41
+
+has-props
+
+index.html
+file
+70
+
+
+
+2009-02-23T14:08:12.000000Z
+3be6c076657c7510db235ab857136314
+2009-02-23T14:09:06.882172Z
+70
+
+simple.html
+file
+69
+
+
+
+2009-02-23T13:55:00.000000Z
+f9a24e4eadb298e29094a60ebbb20f4c
+2009-02-23T14:02:44.812274Z
+69
+
+trap-the-cap.pdf
+file
+
+
+
+
+2007-05-14T21:17:46.000000Z
+9b7e0b7381e7e7e0894f105690345a7c
+2008-10-16T14:11:23.436422Z
+41
+
+has-props
+
diff --git a/src/html-files/.svn/format b/src/html-files/.svn/format
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/src/html-files/.svn/format
@@ -0,0 +1 @@
+8
diff --git a/src/html-files/.svn/prop-base/board-thumb.jpg.svn-base b/src/html-files/.svn/prop-base/board-thumb.jpg.svn-base
new file mode 100644
index 0000000..5e9587e
--- /dev/null
+++ b/src/html-files/.svn/prop-base/board-thumb.jpg.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:mime-type
+V 24
+application/octet-stream
+END
diff --git a/src/html-files/.svn/prop-base/board.jpg.svn-base b/src/html-files/.svn/prop-base/board.jpg.svn-base
new file mode 100644
index 0000000..5e9587e
--- /dev/null
+++ b/src/html-files/.svn/prop-base/board.jpg.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:mime-type
+V 24
+application/octet-stream
+END
diff --git a/src/html-files/.svn/prop-base/schematic-board-thumb.png.svn-base b/src/html-files/.svn/prop-base/schematic-board-thumb.png.svn-base
new file mode 100644
index 0000000..5e9587e
--- /dev/null
+++ b/src/html-files/.svn/prop-base/schematic-board-thumb.png.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:mime-type
+V 24
+application/octet-stream
+END
diff --git a/src/html-files/.svn/prop-base/schematic-board.png.svn-base b/src/html-files/.svn/prop-base/schematic-board.png.svn-base
new file mode 100644
index 0000000..5e9587e
--- /dev/null
+++ b/src/html-files/.svn/prop-base/schematic-board.png.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:mime-type
+V 24
+application/octet-stream
+END
diff --git a/src/html-files/.svn/prop-base/trap-the-cap.pdf.svn-base b/src/html-files/.svn/prop-base/trap-the-cap.pdf.svn-base
new file mode 100644
index 0000000..5e9587e
--- /dev/null
+++ b/src/html-files/.svn/prop-base/trap-the-cap.pdf.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:mime-type
+V 24
+application/octet-stream
+END
diff --git a/src/html-files/.svn/text-base/board-thumb.jpg.svn-base b/src/html-files/.svn/text-base/board-thumb.jpg.svn-base
new file mode 100644
index 0000000..16faf49
Binary files /dev/null and b/src/html-files/.svn/text-base/board-thumb.jpg.svn-base differ
diff --git a/src/html-files/.svn/text-base/board.jpg.svn-base b/src/html-files/.svn/text-base/board.jpg.svn-base
new file mode 100644
index 0000000..1f6787c
Binary files /dev/null and b/src/html-files/.svn/text-base/board.jpg.svn-base differ
diff --git a/src/html-files/.svn/text-base/index.html.svn-base b/src/html-files/.svn/text-base/index.html.svn-base
new file mode 100644
index 0000000..3533ab1
--- /dev/null
+++ b/src/html-files/.svn/text-base/index.html.svn-base
@@ -0,0 +1,70 @@
+
+
+Trap the Cap
+
+
+
+
Trap The Cap
+
+
+
+
The board
+
+
+
Changes
+
+
+
+
23 February 2009
+
Added a new player robot and fixed the sample game file to a legal one.
+
+
+
22 April 2008
+
Updated library again: fixed bugs to detect a winner, and also eliminate players that have no uncaptured pieces.
+
+
+
+
10 September 2007
+
Updated library again: Game#possible_moves now shows the legal moves as described below.
+
+
+
+
7 September 2007
+
Updated library: now prevents moves via base without captured pieces and prevents more than three pieces on a safe position.
+Changed format for moves that end on a base
+
+
+
+
Trap The Cap is a simple board game of captuing (and
+recapturing) pieces. You can read the
+rules and look at the board to see how the game is played (rules
+and image both from Board Game
+Geek).
There is a simple interface to a test for
+your programs, with two simple robots to play against.
+
+
'Always clockwise simple' [source
+code] always moves the lowest-valued piece clockwise around the
+rim of the board. 'Clockwise cloud' [source
+code] always moves the least clockwise piece clockwise around the
+rim. They should be pretty easy to beat. Both robots are witten in
+Ruby and use the libttc.rb library (updated 10
+September 2007). Feel free to base your own robots on this code. All
+this code is released under the GNU General Public Licence
+v3.
+
+
+
diff --git a/src/html-files/.svn/text-base/interface.html.svn-base b/src/html-files/.svn/text-base/interface.html.svn-base
new file mode 100644
index 0000000..c761980
--- /dev/null
+++ b/src/html-files/.svn/text-base/interface.html.svn-base
@@ -0,0 +1,106 @@
+
+
+Trap the Cap Interface
+
+
+
+
Updated library: now prevents moves via base without captured pieces and prevents more than three pieces on a safe position.
+Changed format for moves that end on a base
+
+
+
+
31 August 2007
+
Changed example input file (old one was invalid)
+Added notation for moves via bases
+Changed time limit to 10 seconds
+
+
+
+
The game will be played between two and six players. See below for
+the identities of the players.
+
+
+
No. of players
Players
+
2
A, D
+
3
A, C, E
+
4
A, B, D, E
+
5
A, B, C, D, E
+
6
A, B, C, D, E, F
+
+
+
Your program will be run afresh for each move it has to make. Your
+program will be fed the history of the game so far on standard input.
+It will then have 10 seconds to report its move on standard
+output.
+
+
The format of the input is as follows. The first line will be a
+single digit, giving the number of players. Subsequent lines will
+give the moves played so far in the game. The final line will be the
+dice roll for your move. Each move will be in the format
+<piece moved> <location moved to>
+
+(that's a single space between the two parts of the line). If a move
+is via a base, the move will be in the format
+<piece moved> <base moved via> <location moved
+to>
+If a move is to a base, the move notation may be in either form.
+
+
It may be that one player may have many consecutive moves if they
+roll multiple sixes. There are no additional spaces or blank lines in
+the file.
+
+
Here is an example of a valid input file:
+
+
3
+A1 AC2
+C4 B5
+E1 EC5
+E2 E3
+A1 EC5
+C4 B2
+4
+
+
(Note the caputre of piece E1 by piece A1 on position EC5.)
+
+
Player program will run on a Linux machine (probably some version
+of Ubuntu Linux). Exact specification is unclear at the moment, but
+it may run on a twin-processor machine.
+
+
The player's program must be named runme; it may be a
+binary executable or a driver shell script that starts up the actual
+program. It will be invoked as
+
+
./runme
+
+with the program's top-level directory as the current working
+directory; libraries and other support data may thus be accessed with
+the relative path name
+
+
support/...
+
+
The program is run once for every move and then terminates; the
+current move state will be passed to the program on standard
+input. Persistent inter-move state may be kept in the
+support/ directory if desired. When the program has
+chosen a move, it should print the move to standard output and
+exit. If the program has not done so after 10 seconds (real or "wall
+clock" time), the program will be terminated forcibly, and lose the
+game.
+
+
There should be no child processes alive after the top-level
+process exits; the program must ensure that all its child processes
+have exited before the top-level process exits itself.
+
+
+
diff --git a/src/html-files/.svn/text-base/layout.html.svn-base b/src/html-files/.svn/text-base/layout.html.svn-base
new file mode 100644
index 0000000..e738373
--- /dev/null
+++ b/src/html-files/.svn/text-base/layout.html.svn-base
@@ -0,0 +1,32 @@
+
+
+Trap the Cap Board Layout
+
+
+
+
+
+
+
+
+
diff --git a/src/html-files/.svn/text-base/trap-the-cap.pdf.svn-base b/src/html-files/.svn/text-base/trap-the-cap.pdf.svn-base
new file mode 100644
index 0000000..fc0c15c
Binary files /dev/null and b/src/html-files/.svn/text-base/trap-the-cap.pdf.svn-base differ
diff --git a/src/html-files/board-thumb.jpg b/src/html-files/board-thumb.jpg
new file mode 100644
index 0000000..16faf49
Binary files /dev/null and b/src/html-files/board-thumb.jpg differ
diff --git a/src/html-files/board.jpg b/src/html-files/board.jpg
new file mode 100644
index 0000000..1f6787c
Binary files /dev/null and b/src/html-files/board.jpg differ
diff --git a/src/html-files/index.html b/src/html-files/index.html
new file mode 100644
index 0000000..3533ab1
--- /dev/null
+++ b/src/html-files/index.html
@@ -0,0 +1,70 @@
+
+
+Trap the Cap
+
+
+
+
Trap The Cap
+
+
+
+
The board
+
+
+
Changes
+
+
+
+
23 February 2009
+
Added a new player robot and fixed the sample game file to a legal one.
+
+
+
22 April 2008
+
Updated library again: fixed bugs to detect a winner, and also eliminate players that have no uncaptured pieces.
+
+
+
+
10 September 2007
+
Updated library again: Game#possible_moves now shows the legal moves as described below.
+
+
+
+
7 September 2007
+
Updated library: now prevents moves via base without captured pieces and prevents more than three pieces on a safe position.
+Changed format for moves that end on a base
+
+
+
+
Trap The Cap is a simple board game of captuing (and
+recapturing) pieces. You can read the
+rules and look at the board to see how the game is played (rules
+and image both from Board Game
+Geek).
There is a simple interface to a test for
+your programs, with two simple robots to play against.
+
+
'Always clockwise simple' [source
+code] always moves the lowest-valued piece clockwise around the
+rim of the board. 'Clockwise cloud' [source
+code] always moves the least clockwise piece clockwise around the
+rim. They should be pretty easy to beat. Both robots are witten in
+Ruby and use the libttc.rb library (updated 10
+September 2007). Feel free to base your own robots on this code. All
+this code is released under the GNU General Public Licence
+v3.
+
+
+
diff --git a/src/html-files/interface.html b/src/html-files/interface.html
new file mode 100644
index 0000000..c761980
--- /dev/null
+++ b/src/html-files/interface.html
@@ -0,0 +1,106 @@
+
+
+Trap the Cap Interface
+
+
+
+
Updated library: now prevents moves via base without captured pieces and prevents more than three pieces on a safe position.
+Changed format for moves that end on a base
+
+
+
+
31 August 2007
+
Changed example input file (old one was invalid)
+Added notation for moves via bases
+Changed time limit to 10 seconds
+
+
+
+
The game will be played between two and six players. See below for
+the identities of the players.
+
+
+
No. of players
Players
+
2
A, D
+
3
A, C, E
+
4
A, B, D, E
+
5
A, B, C, D, E
+
6
A, B, C, D, E, F
+
+
+
Your program will be run afresh for each move it has to make. Your
+program will be fed the history of the game so far on standard input.
+It will then have 10 seconds to report its move on standard
+output.
+
+
The format of the input is as follows. The first line will be a
+single digit, giving the number of players. Subsequent lines will
+give the moves played so far in the game. The final line will be the
+dice roll for your move. Each move will be in the format
+<piece moved> <location moved to>
+
+(that's a single space between the two parts of the line). If a move
+is via a base, the move will be in the format
+<piece moved> <base moved via> <location moved
+to>
+If a move is to a base, the move notation may be in either form.
+
+
It may be that one player may have many consecutive moves if they
+roll multiple sixes. There are no additional spaces or blank lines in
+the file.
+
+
Here is an example of a valid input file:
+
+
3
+A1 AC2
+C4 B5
+E1 EC5
+E2 E3
+A1 EC5
+C4 B2
+4
+
+
(Note the caputre of piece E1 by piece A1 on position EC5.)
+
+
Player program will run on a Linux machine (probably some version
+of Ubuntu Linux). Exact specification is unclear at the moment, but
+it may run on a twin-processor machine.
+
+
The player's program must be named runme; it may be a
+binary executable or a driver shell script that starts up the actual
+program. It will be invoked as
+
+
./runme
+
+with the program's top-level directory as the current working
+directory; libraries and other support data may thus be accessed with
+the relative path name
+
+
support/...
+
+
The program is run once for every move and then terminates; the
+current move state will be passed to the program on standard
+input. Persistent inter-move state may be kept in the
+support/ directory if desired. When the program has
+chosen a move, it should print the move to standard output and
+exit. If the program has not done so after 10 seconds (real or "wall
+clock" time), the program will be terminated forcibly, and lose the
+game.
+
+
There should be no child processes alive after the top-level
+process exits; the program must ensure that all its child processes
+have exited before the top-level process exits itself.
+
+
+
diff --git a/src/html-files/layout.html b/src/html-files/layout.html
new file mode 100644
index 0000000..e738373
--- /dev/null
+++ b/src/html-files/layout.html
@@ -0,0 +1,32 @@
+
+
+Trap the Cap Board Layout
+
+
+
+
Given the rules and board layout
+(right), we can start to label the pieces and places.
+
+
+
The six home bases are labelled 'A' .. 'F'.
+
The six playing pieces for each player each have their own names:
+A1.. A6 for player A, B1..B6 for player B, and so on.
+
The locations on the board are given in terms of the nearest home base.
+
The player's home base is given the label 'A' for player A, and so
+on.
+
Places around the rim are counted clockwise from the home base,
+given labels 'A1', 'A2' ... 'A6'.
+
Places on the spokes are labelled, from the outside in, 'AC1',
+'AC2' ... 'AC5'
+
The central space is, simultaneously, 'AC6', 'BC6', 'CC6'...
+
+
+
+
diff --git a/src/html-files/robots/.svn/all-wcprops b/src/html-files/robots/.svn/all-wcprops
new file mode 100644
index 0000000..260701e
--- /dev/null
+++ b/src/html-files/robots/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 60
+/svn/njae/!svn/ver/41/TrapTheCap/trunk/src/html-files/robots
+END
diff --git a/src/html-files/robots/.svn/entries b/src/html-files/robots/.svn/entries
new file mode 100644
index 0000000..37dc581
--- /dev/null
+++ b/src/html-files/robots/.svn/entries
@@ -0,0 +1,25 @@
+8
+
+dir
+68
+http://scripts.njae.me.uk/svn/njae/TrapTheCap/trunk/src/html-files/robots
+http://scripts.njae.me.uk/svn/njae
+
+
+
+2008-10-16T14:11:23.436422Z
+41
+
+
+
+svn:special svn:externals svn:needs-lock
+
+1
+dir
+
+2
+dir
+
+3
+dir
+
diff --git a/src/html-files/robots/.svn/format b/src/html-files/robots/.svn/format
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/src/html-files/robots/.svn/format
@@ -0,0 +1 @@
+8
diff --git a/src/html-files/robots/1/.svn/all-wcprops b/src/html-files/robots/1/.svn/all-wcprops
new file mode 100644
index 0000000..bc1edd1
--- /dev/null
+++ b/src/html-files/robots/1/.svn/all-wcprops
@@ -0,0 +1,11 @@
+K 25
+svn:wc:ra_dav:version-url
+V 62
+/svn/njae/!svn/ver/41/TrapTheCap/trunk/src/html-files/robots/1
+END
+runme
+K 25
+svn:wc:ra_dav:version-url
+V 68
+/svn/njae/!svn/ver/41/TrapTheCap/trunk/src/html-files/robots/1/runme
+END
diff --git a/src/html-files/robots/1/.svn/entries b/src/html-files/robots/1/.svn/entries
new file mode 100644
index 0000000..b69db3d
--- /dev/null
+++ b/src/html-files/robots/1/.svn/entries
@@ -0,0 +1,29 @@
+8
+
+dir
+68
+http://scripts.njae.me.uk/svn/njae/TrapTheCap/trunk/src/html-files/robots/1
+http://scripts.njae.me.uk/svn/njae
+
+
+
+2008-10-16T14:11:23.436422Z
+41
+
+
+
+svn:special svn:externals svn:needs-lock
+
+runme
+file
+
+
+
+
+2008-05-22T10:01:10.000000Z
+508e127b6cb4b5f78a524e17c54cf532
+2008-10-16T14:11:23.436422Z
+41
+
+has-props
+
diff --git a/src/html-files/robots/1/.svn/format b/src/html-files/robots/1/.svn/format
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/src/html-files/robots/1/.svn/format
@@ -0,0 +1 @@
+8
diff --git a/src/html-files/robots/1/.svn/prop-base/runme.svn-base b/src/html-files/robots/1/.svn/prop-base/runme.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/src/html-files/robots/1/.svn/prop-base/runme.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/src/html-files/robots/1/.svn/text-base/runme.svn-base b/src/html-files/robots/1/.svn/text-base/runme.svn-base
new file mode 100644
index 0000000..a702f0e
--- /dev/null
+++ b/src/html-files/robots/1/.svn/text-base/runme.svn-base
@@ -0,0 +1,75 @@
+#!/usr/bin/ruby
+#
+# == Synopsis
+#
+# Play one move of a Trap the Cap game
+#
+# == Usage
+# clockwise-p1
+# Game state file read on STDIN
+# Move produced on STDOUT
+#
+# == Author
+# Neil Smith
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+
+
+require 'libttc'
+
+def more_clockwise(this, other)
+ here = this.destination.place
+ there = other.destination.place
+
+ # if both are on a spoke, choose the one with the lowest number (nearer the rim)
+ if here =~ /.c./ and there =~ /.c./
+ # break ties by preferring the most clockwise arc
+ if here[-1] == there[-1]
+ return here[0] <=> there[0]
+ else
+ return -1 * (here[-1] <=> there[-1])
+ end
+ # If one is one a spoke and the other is on the rim, choose the one on the rim
+ elsif here =~ /.c./ or there =~ /.c./
+ return -1 * (here.length <=> there.length)
+ # If one is in the 'f' rim section and the other in the 'a' rim section, choose the 'a'
+ elsif here[0,1] == 'a' and there[0,1] == 'f'
+ return +1
+ elsif here[0,1] == 'f' and there[0,1] == 'a'
+ return -1
+ # Otherwise, choose the one with highest arc code
+ else
+ return here <=> there
+ end
+
+end
+
+# Get the current game state
+game_lines = readlines
+game, moves, next_roll = Game.read_game(game_lines)
+game.apply_moves! moves
+
+# The piece to move is the uncaptured one of mine with the lowest number
+my_pieces = game.pieces.values.select {|p| p.colour == game.current_player and not p.captured}
+piece_to_move = (my_pieces.sort_by {|p| p.name})[0]
+
+# find the most clockwise move
+potential_moves = game.possible_moves(next_roll).select {|m| m.piece == piece_to_move}
+sorted_moves = potential_moves.sort {|x, y| more_clockwise x, y}
+best_move = sorted_moves[-1]
+
+# return that move
+puts best_move
+
+
diff --git a/src/html-files/robots/1/runme b/src/html-files/robots/1/runme
new file mode 100755
index 0000000..a702f0e
--- /dev/null
+++ b/src/html-files/robots/1/runme
@@ -0,0 +1,75 @@
+#!/usr/bin/ruby
+#
+# == Synopsis
+#
+# Play one move of a Trap the Cap game
+#
+# == Usage
+# clockwise-p1
+# Game state file read on STDIN
+# Move produced on STDOUT
+#
+# == Author
+# Neil Smith
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+
+
+require 'libttc'
+
+def more_clockwise(this, other)
+ here = this.destination.place
+ there = other.destination.place
+
+ # if both are on a spoke, choose the one with the lowest number (nearer the rim)
+ if here =~ /.c./ and there =~ /.c./
+ # break ties by preferring the most clockwise arc
+ if here[-1] == there[-1]
+ return here[0] <=> there[0]
+ else
+ return -1 * (here[-1] <=> there[-1])
+ end
+ # If one is one a spoke and the other is on the rim, choose the one on the rim
+ elsif here =~ /.c./ or there =~ /.c./
+ return -1 * (here.length <=> there.length)
+ # If one is in the 'f' rim section and the other in the 'a' rim section, choose the 'a'
+ elsif here[0,1] == 'a' and there[0,1] == 'f'
+ return +1
+ elsif here[0,1] == 'f' and there[0,1] == 'a'
+ return -1
+ # Otherwise, choose the one with highest arc code
+ else
+ return here <=> there
+ end
+
+end
+
+# Get the current game state
+game_lines = readlines
+game, moves, next_roll = Game.read_game(game_lines)
+game.apply_moves! moves
+
+# The piece to move is the uncaptured one of mine with the lowest number
+my_pieces = game.pieces.values.select {|p| p.colour == game.current_player and not p.captured}
+piece_to_move = (my_pieces.sort_by {|p| p.name})[0]
+
+# find the most clockwise move
+potential_moves = game.possible_moves(next_roll).select {|m| m.piece == piece_to_move}
+sorted_moves = potential_moves.sort {|x, y| more_clockwise x, y}
+best_move = sorted_moves[-1]
+
+# return that move
+puts best_move
+
+
diff --git a/src/html-files/robots/1/runme~ b/src/html-files/robots/1/runme~
new file mode 100755
index 0000000..ddeb2d8
--- /dev/null
+++ b/src/html-files/robots/1/runme~
@@ -0,0 +1,75 @@
+#!/usr/bin/ruby
+#
+# == Synopsis
+#
+# Play one move of a Trap the Cap game
+#
+# == Usage
+# clockwise-p1
+# Game state file read on STDIN
+# Move produced on STDOUT
+#
+# == Author
+# Neil Smith
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+
+
+require 'libttc'
+
+def more_clockwise(this, other)
+ here = this.destination.place
+ there = other.destination.place
+
+ # if both are on a spoke, choose the one with the lowest number (nearer the rim)
+ if here =~ /.c./ and there =~ /.c./
+ # break ties by preferring the most clockwise arc
+ if here[-1] == there[-1]
+ return here[0] <=> there[0]
+ else
+ return -1 * (here[-1] <=> there[-1])
+ end
+ # If one is one a spoke and the other is on the rim, choose the one on the rim
+ elsif here =~ /.c./ or there =~ /.c./
+ return -1 * (here.length <=> there.length)
+ # If one is in the 'f' rim section and the other in the 'a' rim section, choose the 'a'
+ elsif here[0,1] == 'a' and there[0,1] == 'f'
+ return +1
+ elsif here[0,1] == 'f' and there[0,1] == 'a'
+ return -1
+ # Otherwise, choose the one with highest arc code
+ else
+ return here <=> there
+ end
+
+end
+
+# Get the current game state
+game_lines = readlines
+game, moves, next_roll = Game.read_game(game_lines)
+game.apply_moves moves
+
+# The piece to move is the uncaptured one of mine with the lowest number
+my_pieces = game.pieces.values.select {|p| p.colour == game.current_player and not p.captured}
+piece_to_move = (my_pieces.sort_by {|p| p.name})[0]
+
+# find the most clockwise move
+potential_moves = game.possible_moves(next_roll).select {|m| m.piece == piece_to_move}
+sorted_moves = potential_moves.sort {|x, y| more_clockwise x, y}
+best_move = sorted_moves[-1]
+
+# return that move
+puts best_move
+
+
diff --git a/src/html-files/robots/2/.svn/all-wcprops b/src/html-files/robots/2/.svn/all-wcprops
new file mode 100644
index 0000000..f4455ac
--- /dev/null
+++ b/src/html-files/robots/2/.svn/all-wcprops
@@ -0,0 +1,11 @@
+K 25
+svn:wc:ra_dav:version-url
+V 62
+/svn/njae/!svn/ver/41/TrapTheCap/trunk/src/html-files/robots/2
+END
+runme
+K 25
+svn:wc:ra_dav:version-url
+V 68
+/svn/njae/!svn/ver/41/TrapTheCap/trunk/src/html-files/robots/2/runme
+END
diff --git a/src/html-files/robots/2/.svn/entries b/src/html-files/robots/2/.svn/entries
new file mode 100644
index 0000000..3985f66
--- /dev/null
+++ b/src/html-files/robots/2/.svn/entries
@@ -0,0 +1,29 @@
+8
+
+dir
+68
+http://scripts.njae.me.uk/svn/njae/TrapTheCap/trunk/src/html-files/robots/2
+http://scripts.njae.me.uk/svn/njae
+
+
+
+2008-10-16T14:11:23.436422Z
+41
+
+
+
+svn:special svn:externals svn:needs-lock
+
+runme
+file
+
+
+
+
+2008-05-22T10:01:21.000000Z
+15f27beb7a6886db08f2b276546a8cdb
+2008-10-16T14:11:23.436422Z
+41
+
+has-props
+
diff --git a/src/html-files/robots/2/.svn/format b/src/html-files/robots/2/.svn/format
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/src/html-files/robots/2/.svn/format
@@ -0,0 +1 @@
+8
diff --git a/src/html-files/robots/2/.svn/prop-base/runme.svn-base b/src/html-files/robots/2/.svn/prop-base/runme.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/src/html-files/robots/2/.svn/prop-base/runme.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/src/html-files/robots/2/.svn/text-base/runme.svn-base b/src/html-files/robots/2/.svn/text-base/runme.svn-base
new file mode 100644
index 0000000..f086b57
--- /dev/null
+++ b/src/html-files/robots/2/.svn/text-base/runme.svn-base
@@ -0,0 +1,77 @@
+#!/usr/bin/ruby
+#
+# == Synopsis
+#
+# Play one move of a Trap the Cap game
+#
+# == Usage
+# clockwise-p1
+# Game state file read on STDIN
+# Move produced on STDOUT
+#
+# == Author
+# Neil Smith
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+
+
+require 'libttc'
+
+def more_clockwise(this, other)
+ here = this.place
+ there = other.place
+
+ # if both are on a spoke, choose the one with the lowest number (nearer the rim)
+ if here =~ /.c./ and there =~ /.c./
+ # break ties by preferring the most clockwise arc
+ if here[-1] == there[-1]
+ return here[0] <=> there[0]
+ else
+ return -1 * (here[-1] <=> there[-1])
+ end
+ # If one is one a spoke and the other is on the rim, choose the one on the rim
+ elsif here =~ /.c./ or there =~ /.c./
+ return -1 * (here.length <=> there.length)
+ # If one is in the 'f' rim section and the other in the 'a' rim section, choose the 'a'
+ elsif here[0,1] == 'a' and there[0,1] == 'f'
+ return +1
+ elsif here[0,1] == 'f' and there[0,1] == 'a'
+ return -1
+ # Otherwise, choose the one with highest arc code
+ else
+ return here <=> there
+ end
+
+end
+
+# Get the current game state
+game_lines = readlines
+game, moves, next_roll = Game.read_game(game_lines)
+game.apply_moves! moves
+
+
+# The piece to move is the least clockwise of my uncaptured pieces
+# Always move pieces on the base first
+my_pieces = game.pieces.values.select {|p| p.colour == game.current_player and not p.captured}
+piece_to_move = (my_pieces.sort {|x, y| more_clockwise x.position, y.position})[0]
+
+# Find the most clockwise move for this piece
+potential_moves = game.possible_moves(next_roll).select {|m| m.piece == piece_to_move}
+sorted_moves = potential_moves.sort {|x, y| more_clockwise x.destination, y.destination}
+best_move = sorted_moves[-1]
+
+# return that move
+puts best_move
+
+
diff --git a/src/html-files/robots/2/runme b/src/html-files/robots/2/runme
new file mode 100755
index 0000000..f086b57
--- /dev/null
+++ b/src/html-files/robots/2/runme
@@ -0,0 +1,77 @@
+#!/usr/bin/ruby
+#
+# == Synopsis
+#
+# Play one move of a Trap the Cap game
+#
+# == Usage
+# clockwise-p1
+# Game state file read on STDIN
+# Move produced on STDOUT
+#
+# == Author
+# Neil Smith
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+
+
+require 'libttc'
+
+def more_clockwise(this, other)
+ here = this.place
+ there = other.place
+
+ # if both are on a spoke, choose the one with the lowest number (nearer the rim)
+ if here =~ /.c./ and there =~ /.c./
+ # break ties by preferring the most clockwise arc
+ if here[-1] == there[-1]
+ return here[0] <=> there[0]
+ else
+ return -1 * (here[-1] <=> there[-1])
+ end
+ # If one is one a spoke and the other is on the rim, choose the one on the rim
+ elsif here =~ /.c./ or there =~ /.c./
+ return -1 * (here.length <=> there.length)
+ # If one is in the 'f' rim section and the other in the 'a' rim section, choose the 'a'
+ elsif here[0,1] == 'a' and there[0,1] == 'f'
+ return +1
+ elsif here[0,1] == 'f' and there[0,1] == 'a'
+ return -1
+ # Otherwise, choose the one with highest arc code
+ else
+ return here <=> there
+ end
+
+end
+
+# Get the current game state
+game_lines = readlines
+game, moves, next_roll = Game.read_game(game_lines)
+game.apply_moves! moves
+
+
+# The piece to move is the least clockwise of my uncaptured pieces
+# Always move pieces on the base first
+my_pieces = game.pieces.values.select {|p| p.colour == game.current_player and not p.captured}
+piece_to_move = (my_pieces.sort {|x, y| more_clockwise x.position, y.position})[0]
+
+# Find the most clockwise move for this piece
+potential_moves = game.possible_moves(next_roll).select {|m| m.piece == piece_to_move}
+sorted_moves = potential_moves.sort {|x, y| more_clockwise x.destination, y.destination}
+best_move = sorted_moves[-1]
+
+# return that move
+puts best_move
+
+
diff --git a/src/html-files/robots/2/runme~ b/src/html-files/robots/2/runme~
new file mode 100755
index 0000000..3df362f
--- /dev/null
+++ b/src/html-files/robots/2/runme~
@@ -0,0 +1,77 @@
+#!/usr/bin/ruby
+#
+# == Synopsis
+#
+# Play one move of a Trap the Cap game
+#
+# == Usage
+# clockwise-p1
+# Game state file read on STDIN
+# Move produced on STDOUT
+#
+# == Author
+# Neil Smith
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+
+
+require 'libttc'
+
+def more_clockwise(this, other)
+ here = this.place
+ there = other.place
+
+ # if both are on a spoke, choose the one with the lowest number (nearer the rim)
+ if here =~ /.c./ and there =~ /.c./
+ # break ties by preferring the most clockwise arc
+ if here[-1] == there[-1]
+ return here[0] <=> there[0]
+ else
+ return -1 * (here[-1] <=> there[-1])
+ end
+ # If one is one a spoke and the other is on the rim, choose the one on the rim
+ elsif here =~ /.c./ or there =~ /.c./
+ return -1 * (here.length <=> there.length)
+ # If one is in the 'f' rim section and the other in the 'a' rim section, choose the 'a'
+ elsif here[0,1] == 'a' and there[0,1] == 'f'
+ return +1
+ elsif here[0,1] == 'f' and there[0,1] == 'a'
+ return -1
+ # Otherwise, choose the one with highest arc code
+ else
+ return here <=> there
+ end
+
+end
+
+# Get the current game state
+game_lines = readlines
+game, moves, next_roll = Game.read_game(game_lines)
+game.apply_moves moves
+
+
+# The piece to move is the least clockwise of my uncaptured pieces
+# Always move pieces on the base first
+my_pieces = game.pieces.values.select {|p| p.colour == game.current_player and not p.captured}
+piece_to_move = (my_pieces.sort {|x, y| more_clockwise x.position, y.position})[0]
+
+# Find the most clockwise move for this piece
+potential_moves = game.possible_moves(next_roll).select {|m| m.piece == piece_to_move}
+sorted_moves = potential_moves.sort {|x, y| more_clockwise x.destination, y.destination}
+best_move = sorted_moves[-1]
+
+# return that move
+puts best_move
+
+
diff --git a/src/html-files/robots/3/.svn/all-wcprops b/src/html-files/robots/3/.svn/all-wcprops
new file mode 100644
index 0000000..92906ad
--- /dev/null
+++ b/src/html-files/robots/3/.svn/all-wcprops
@@ -0,0 +1,11 @@
+K 25
+svn:wc:ra_dav:version-url
+V 62
+/svn/njae/!svn/ver/69/TrapTheCap/trunk/src/html-files/robots/3
+END
+runme.rb
+K 25
+svn:wc:ra_dav:version-url
+V 71
+/svn/njae/!svn/ver/69/TrapTheCap/trunk/src/html-files/robots/3/runme.rb
+END
diff --git a/src/html-files/robots/3/.svn/entries b/src/html-files/robots/3/.svn/entries
new file mode 100644
index 0000000..d63a278
--- /dev/null
+++ b/src/html-files/robots/3/.svn/entries
@@ -0,0 +1,27 @@
+8
+
+dir
+69
+http://scripts.njae.me.uk/svn/njae/TrapTheCap/trunk/src/html-files/robots/3
+http://scripts.njae.me.uk/svn/njae
+
+
+
+2009-02-23T14:02:44.812274Z
+69
+
+
+
+svn:special svn:externals svn:needs-lock
+
+runme.rb
+file
+
+
+
+
+2009-02-23T14:01:47.000000Z
+597c993fb86e5502356a806a91127c5e
+2009-02-23T14:02:44.812274Z
+69
+
diff --git a/src/html-files/robots/3/.svn/format b/src/html-files/robots/3/.svn/format
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/src/html-files/robots/3/.svn/format
@@ -0,0 +1 @@
+8
diff --git a/src/html-files/robots/3/.svn/text-base/runme.rb.svn-base b/src/html-files/robots/3/.svn/text-base/runme.rb.svn-base
new file mode 100644
index 0000000..2e49434
--- /dev/null
+++ b/src/html-files/robots/3/.svn/text-base/runme.rb.svn-base
@@ -0,0 +1,35 @@
+#!/usr/bin/ruby
+#
+# == Synopsis
+#
+# Play one move of a Trap the Cap game
+#
+# == Usage
+# clockwise-p1
+# Game state file read on STDIN
+# Move produced on STDOUT
+#
+# == Author
+# Neil Smith
+
+
+require 'libttc'
+require 'libttc-pplayer'
+require 'rdoc/usage'
+
+
+# Get the current game state
+game_lines = readlines
+game, moves, next_roll = Game.read_game(game_lines)
+game.apply_moves! moves
+
+player = Potential_player.new({:friend_pull => 0.0,
+ :enemy_pull => 0.0,
+ :base_pull => 0.0,
+ :safe_bonus => 10,
+ :capture_bonus => 2})
+
+best_move = player.best_move(game, next_roll)
+
+# return that move
+puts best_move
diff --git a/src/html-files/robots/3/runme.rb b/src/html-files/robots/3/runme.rb
new file mode 100644
index 0000000..2e49434
--- /dev/null
+++ b/src/html-files/robots/3/runme.rb
@@ -0,0 +1,35 @@
+#!/usr/bin/ruby
+#
+# == Synopsis
+#
+# Play one move of a Trap the Cap game
+#
+# == Usage
+# clockwise-p1
+# Game state file read on STDIN
+# Move produced on STDOUT
+#
+# == Author
+# Neil Smith
+
+
+require 'libttc'
+require 'libttc-pplayer'
+require 'rdoc/usage'
+
+
+# Get the current game state
+game_lines = readlines
+game, moves, next_roll = Game.read_game(game_lines)
+game.apply_moves! moves
+
+player = Potential_player.new({:friend_pull => 0.0,
+ :enemy_pull => 0.0,
+ :base_pull => 0.0,
+ :safe_bonus => 10,
+ :capture_bonus => 2})
+
+best_move = player.best_move(game, next_roll)
+
+# return that move
+puts best_move
diff --git a/src/html-files/schematic-board-thumb.png b/src/html-files/schematic-board-thumb.png
new file mode 100644
index 0000000..078063b
Binary files /dev/null and b/src/html-files/schematic-board-thumb.png differ
diff --git a/src/html-files/schematic-board.png b/src/html-files/schematic-board.png
new file mode 100644
index 0000000..3afe838
Binary files /dev/null and b/src/html-files/schematic-board.png differ
diff --git a/src/html-files/simple.html b/src/html-files/simple.html
new file mode 100644
index 0000000..3afa6d0
--- /dev/null
+++ b/src/html-files/simple.html
@@ -0,0 +1,35 @@
+
+
+Simple Trap the Cap form
+
+
+
+