Add colorcubes

This commit is contained in:
Yutao Yuan 2016-06-10 17:35:20 +08:00
parent 418c53925a
commit 86788d65f0
5 changed files with 118 additions and 0 deletions

View File

@ -0,0 +1,19 @@
P2
16 16
9
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7

19
index/colorcubes_1.pgm Normal file
View File

@ -0,0 +1,19 @@
P2
16 16
1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 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1 0 1
1 0 1 0 1 0 1 1 1 1 0 1 0 1 0 1
1 0 1 0 1 0 0 0 0 0 0 1 0 1 0 1
1 0 1 0 1 1 1 1 1 1 1 1 0 1 0 1
1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 1
1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

42
rules/colorcubes.py Normal file
View File

@ -0,0 +1,42 @@
import itertools
_colorcubes_colors = {
'yellow', 'orange', 'brown', 'red', 'pink', 'magenta', 'violet',
'redviolet', 'blue', 'cyan', 'green', 'dark_green', 'white',
'light_gray', 'dark_gray', 'black', 'lime', 'aqua', 'skyblue',
}
_colorcubes_color_map = {
name: 'color_' + name.replace('pink', 'light_red')
for name in _colorcubes_colors
}
_colorcubes_1_textures = {
'colorcubes_1_' + name: (color, 'colorcubes_1')
for name, color in _colorcubes_color_map.items()
}
_colorcubes_4_textures = {
'colorcubes_4_' + name: (color, 'colorcubes_4')
for name, color in _colorcubes_color_map.items()
}
_colorcubes_inward_textures = {
'colorcubes_inward_' + name: (color, 'colorcubes_inward')
for name, color in _colorcubes_color_map.items()
}
_colorcubes_window_textures = {
'colorcubes_window_' + name: (
color, 'colorcubes_1', 'colorcubes_window')
for name, color in _colorcubes_color_map.items()
}
textures = dict(itertools.chain(
_colorcubes_1_textures.items(),
_colorcubes_4_textures.items(),
_colorcubes_inward_textures.items(),
_colorcubes_window_textures.items(),
))