1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
|
#-*- coding:utf-8 -*-
# Copyright © 2009-2015 B. Clausius <barcc@gmx.de>
#
# 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 <http://www.gnu.org/licenses/>.
# pylint: disable=C0321
def play_stripes_Brick_nnn_2(game):
size = game.current_state.model.sizes
for unused_j in 0, 1:
for i in range(size[1]-1, size[1]//2-1, -1): game.add_moves([(1, i, 0)])
for i in range(1, size[0], 2): game.add_moves([(0, i, 0)])
for i in range(1, size[2], 2): game.add_moves([(2, i, 0)])
def play_stripes_Brick_nn1_4(game):
size = game.current_state.model.sizes
for i in range(1, size[0], 2): game.add_moves([(0, i, 0)])
for i in range(size[1]-1, size[1]//2, -1): game.add_moves([(1, i, 0)])
for i in range(1, size[0] // 2, 2): game.add_moves([(0, i, 0)])
game.add_moves([(1, size[1]//2, 0)])
for i in range(size[0]//2+1, size[0], 2): game.add_moves([(0, i, 0)])
for i in range(size[1]-1, size[1]//2-1, -1): game.add_moves([(1, i, 0)])
def play_stripes_Brick_1nn_4(game):
size = game.current_state.model.sizes
for i in range(1, size[2], 2): game.add_moves([(2, i, 0)])
for i in range(size[1]-1, size[1]//2, -1): game.add_moves([(1, i, 0)])
for i in range(1, size[2] // 2, 2): game.add_moves([(2, i, 0)])
game.add_moves([(1, size[1]//2, 0)])
for i in range(size[2]//2+1, size[2], 2): game.add_moves([(2, i, 0)])
for i in range(size[1]-1, size[1]//2-1, -1): game.add_moves([(1, i, 0)])
def play_stripes_Cube_nnn_2(game):
size = game.current_state.model.sizes
for i in range(0, size[0], 2): game.add_moves([(0, i, 0)] * 2)
for i in range(0, size[2], 2): game.add_moves([(2, i, 0)] * 2)
for i in range(0, size[0], 2): game.add_moves([(0, i, 0)] * 2)
def play_stripes_TowerBrick_nnn_2(game):
size = game.current_state.model.sizes
for i in range(0, size[0], 2): game.add_moves([(0, i, 0)])
for i in range(0, size[2], 2): game.add_moves([(2, i, 0)])
for i in range(0, size[0], 2): game.add_moves([(0, i, 0)])
def play_chessboard(game):
model = game.current_state.model
size = model.sizes
dups = [s//2 for s in model.symmetries]
# Moves are 3-Tuples (axis, slice, dir) axis=0,1,2 slice=0,...,size-1 dir=0,1
if size[0] % 2 == size[1] % 2 == 1:
moves = [(0, i, 0) for i in range(1, size[0], 2)]
moves += [(1, i, 0) for i in range(1, size[1], 2)]
moves += [(2, i, 0) for i in range(1, size[2], 2)]
elif size[1] % 2 == size[2] % 2 == 1:
moves = [(1, i, 0) for i in range(1, size[1], 2)]
moves += [(2, i, 0) for i in range(1, size[2], 2)]
moves += [(0, i, 0) for i in range(1, size[0], 2)]
elif size[2] % 2 == size[0] % 2 == 1:
moves = [(2, i, 0) for i in range(1, size[2], 2)]
moves += [(0, i, 0) for i in range(1, size[0], 2)]
moves += [(1, i, 0) for i in range(1, size[1], 2)]
for move in moves:
game.add_moves([move] * dups[move[0]])
def play_t_time_Cube_odd(game):
size = game.current_state.model.sizes
ll = 'l{0}l{0}'.format(size[0] // 2 + 1)
ff = 'f{0}f{0}'.format(size[0] // 2 + 1)
game.add_code("{0}du-{1}ud-{0}duu{0}uu{0}d-{0}uu".format(ll, ff))
def play_t_time_Cube_even(game):
size = game.current_state.model.sizes
ll = 'l{0}l{0}l{1}l{1}'.format(size[0] // 2, size[0] // 2 + 1)
ff = 'f{0}f{0}f{1}f{1}'.format(size[0] // 2, size[0] // 2 + 1)
game.add_code("{0}dd2u-u2-{1}uu2d-d2-{0}dd2uuu2u2{0}uuu2u2{0}d-d2-{0}uuu2u2".format(ll, ff))
def play_t_time_Tower_odd(game):
size = game.current_state.model.sizes
ll = 'l{0}'.format(size[0] // 2 + 1)
ff = 'f{0}'.format(size[0] // 2 + 1)
game.add_code("{0}du-{1}ud-{0}duu{0}uu{0}d-{0}uu".format(ll, ff))
def play_t_time_Tower_even(game):
size = game.current_state.model.sizes
ll = 'l{0}l{1}'.format(size[0] // 2, size[0] // 2 + 1)
ff = 'f{0}f{1}'.format(size[0] // 2, size[0] // 2 + 1)
game.add_code("{0}dd2u-u2-{1}uu2d-d2-{0}dd2uuu2u2{0}uuu2u2{0}d-d2-{0}uuu2u2".format(ll, ff))
def play_plus_Cube_odd(game):
size = game.current_state.model.sizes
for i in range(0, (size[1]-1) // 2): game.add_moves([(1, size[1] - 1 - i, 0)] * 2)
game.add_moves([(0, size[0] // 2, 0)] * 2)
game.add_moves([(2, size[2] // 2, 0)] * 2)
for i in range(0, (size[1]-1) // 2): game.add_moves([(1, i, 0)] * 2)
game.add_moves([(0, size[0] // 2, 0)] * 2)
game.add_moves([(2, size[2] // 2, 0)] * 2)
def play_plus_Cube_even(game):
size = game.current_state.model.sizes
for i in range(0, (size[1]-1) // 2): game.add_moves([(1, size[1] - 1 - i, 0)] * 2)
game.add_moves([(0, size[0] // 2 - 1, 0)] * 2)
game.add_moves([(0, size[0] // 2, 0)] * 2)
game.add_moves([(2, size[2] // 2, 0)] * 2)
game.add_moves([(2, size[2] // 2 - 1, 0)] * 2)
for i in range(0, (size[1]-1) // 2): game.add_moves([(1, i, 0)] * 2)
game.add_moves([(0, size[0] // 2 - 1, 0)] * 2)
game.add_moves([(0, size[0] // 2, 0)] * 2)
game.add_moves([(2, size[2] // 2, 0)] * 2)
game.add_moves([(2, size[2] // 2 - 1, 0)] * 2)
def play_plus_Tower_on(game):
size = game.current_state.model.sizes
for i in range(0, (size[1]-1) // 2): game.add_moves([(1, size[1] - 1 - i, 0)] * 2)
game.add_moves([(0, size[0] // 2, 0)])
game.add_moves([(2, size[2] // 2, 0)])
for i in range(0, (size[1]-1) // 2): game.add_moves([(1, i, 0)] * 2)
game.add_moves([(0, size[0] // 2, 0)])
game.add_moves([(2, size[2] // 2, 0)])
def play_plus_Tower_en(game):
size = game.current_state.model.sizes
for i in range(0, (size[1]-1) // 2): game.add_moves([(1, size[1] - 1 - i, 0)] * 2)
game.add_moves([(0, size[0] // 2 - 1, 0)])
game.add_moves([(0, size[0] // 2, 0)])
game.add_moves([(2, size[2] // 2, 0)])
game.add_moves([(2, size[2] // 2 - 1, 0)])
for i in range(0, (size[1]-1) // 2): game.add_moves([(1, i, 0)] * 2)
game.add_moves([(0, size[0] // 2 - 1, 0)])
game.add_moves([(0, size[0] // 2, 0)])
game.add_moves([(2, size[2] // 2, 0)])
game.add_moves([(2, size[2] // 2 - 1, 0)])
def play_plus_Brick_ono(game):
size = game.current_state.model.sizes
for i in range(0, (size[1]-1) // 2): game.add_moves([(1, size[1] - 1 - i, 0)])
game.add_moves([(0, size[0] // 2, 0)])
game.add_moves([(2, size[2] // 2, 0)])
for i in range(0, (size[1]-1) // 2): game.add_moves([(1, i, 0)])
game.add_moves([(0, size[0] // 2, 0)])
game.add_moves([(2, size[2] // 2, 0)])
def play_plus_Brick_one(game):
size = game.current_state.model.sizes
for i in range(0, (size[1]-1) // 2): game.add_moves([(1, size[1] - 1 - i, 0)])
game.add_moves([(0, size[0] // 2, 0)])
game.add_moves([(2, size[2] // 2, 0)])
game.add_moves([(2, size[2] // 2 - 1, 0)])
for i in range(0, (size[1]-1) // 2): game.add_moves([(1, i, 0)])
game.add_moves([(0, size[0] // 2, 0)])
game.add_moves([(2, size[2] // 2, 0)])
game.add_moves([(2, size[2] // 2 - 1, 0)])
def play_plus_Brick_eno(game):
size = game.current_state.model.sizes
for i in range(0, (size[1]-1) // 2): game.add_moves([(1, size[1] - 1 - i, 0)])
game.add_moves([(0, size[0] // 2 - 1, 0)])
game.add_moves([(0, size[0] // 2, 0)])
game.add_moves([(2, size[2] // 2, 0)])
for i in range(0, (size[1]-1) // 2): game.add_moves([(1, i, 0)])
game.add_moves([(0, size[0] // 2 - 1, 0)])
game.add_moves([(0, size[0] // 2, 0)])
game.add_moves([(2, size[2] // 2, 0)])
def play_plus_Brick_ene(game):
size = game.current_state.model.sizes
for i in range(0, (size[1]-1) // 2): game.add_moves([(1, size[1] - 1 - i, 0)])
game.add_moves([(0, size[0] // 2 - 1, 0)])
game.add_moves([(0, size[0] // 2, 0)])
game.add_moves([(2, size[2] // 2, 0)])
game.add_moves([(2, size[2] // 2 - 1, 0)])
for i in range(0, (size[1]-1) // 2): game.add_moves([(1, i, 0)])
game.add_moves([(0, size[0] // 2 - 1, 0)])
game.add_moves([(0, size[0] // 2, 0)])
game.add_moves([(2, size[2] // 2, 0)])
game.add_moves([(2, size[2] // 2 - 1, 0)])
def play_minus_CubeTower_odd(game):
size = game.current_state.model.sizes
game.add_moves([(1, size[1] // 2, 0)] * 2)
def play_minus_CubeTower_even(game):
size = game.current_state.model.sizes
game.add_moves([(1, size[1] // 2, 0)] * 2)
game.add_moves([(1, size[1] // 2 - 1, 0)] * 2)
def play_minus_Brick_non(game):
size = game.current_state.model.sizes
game.add_moves([(1, size[1] // 2, 0)])
def play_minus_Brick_nen(game):
size = game.current_state.model.sizes
game.add_moves([(1, size[1] // 2, 0)])
game.add_moves([(1, size[1] // 2 - 1, 0)])
|