fiveinarow 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.idea/.rakeTasks +7 -0
- data/.idea/encodings.xml +6 -0
- data/.idea/fiveinarow.iml +64 -0
- data/.idea/misc.xml +4 -0
- data/.idea/modules.xml +8 -0
- data/.idea/vagrant.xml +7 -0
- data/.idea/vcs.xml +6 -0
- data/.idea/workspace.xml +714 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +38 -0
- data/Rakefile +2 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/fiveinarow.gemspec +33 -0
- data/lib/fiveinarow.rb +101 -0
- data/lib/fiveinarow/ai_player.rb +99 -0
- data/lib/fiveinarow/board.rb +132 -0
- data/lib/fiveinarow/cell.rb +32 -0
- data/lib/fiveinarow/generic_player.rb +8 -0
- data/lib/fiveinarow/hotseat_player.rb +4 -0
- data/lib/fiveinarow/version.rb +3 -0
- data/lib/fiveinarow/z_order.rb +3 -0
- data/lib/media/background_800_800.png +0 -0
- data/lib/media/cell_alpha_35_35.png +0 -0
- data/lib/media/cell_o_35_35.png +0 -0
- data/lib/media/cell_white_35_35.png +0 -0
- data/lib/media/cell_win_35_35.png +0 -0
- data/lib/media/cell_x_35_35.png +0 -0
- data/lib/media/the_end_800_800.png +0 -0
- metadata +120 -0
@@ -0,0 +1,32 @@
|
|
1
|
+
class Cell
|
2
|
+
attr_accessor :value
|
3
|
+
attr_reader :row
|
4
|
+
attr_reader :col
|
5
|
+
|
6
|
+
EMPTY = 0
|
7
|
+
PLAYER_A = 1
|
8
|
+
PLAYER_B = 2
|
9
|
+
|
10
|
+
def initialize(row, col, val)
|
11
|
+
@row = row
|
12
|
+
@col = col
|
13
|
+
@value = val
|
14
|
+
end
|
15
|
+
|
16
|
+
def set(v)
|
17
|
+
puts "changed to #{v}"
|
18
|
+
@value = v
|
19
|
+
end
|
20
|
+
|
21
|
+
def e?
|
22
|
+
@value == Cell::EMPTY
|
23
|
+
end
|
24
|
+
|
25
|
+
def a?
|
26
|
+
@value == Cell::PLAYER_A
|
27
|
+
end
|
28
|
+
|
29
|
+
def b?
|
30
|
+
@value == Cell::PLAYER_B
|
31
|
+
end
|
32
|
+
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
metadata
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fiveinarow
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tomáš Nesrovnal
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-01-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.11'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.11'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: gosu
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.10.5
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.10.5
|
55
|
+
description: Five-in-a-row is a classic board game. You need to make a line of five
|
56
|
+
to win.
|
57
|
+
email:
|
58
|
+
- nesro@nesro.cz
|
59
|
+
executables: []
|
60
|
+
extensions: []
|
61
|
+
extra_rdoc_files: []
|
62
|
+
files:
|
63
|
+
- ".gitignore"
|
64
|
+
- ".idea/.rakeTasks"
|
65
|
+
- ".idea/encodings.xml"
|
66
|
+
- ".idea/fiveinarow.iml"
|
67
|
+
- ".idea/misc.xml"
|
68
|
+
- ".idea/modules.xml"
|
69
|
+
- ".idea/vagrant.xml"
|
70
|
+
- ".idea/vcs.xml"
|
71
|
+
- ".idea/workspace.xml"
|
72
|
+
- CODE_OF_CONDUCT.md
|
73
|
+
- Gemfile
|
74
|
+
- LICENSE.txt
|
75
|
+
- README.md
|
76
|
+
- Rakefile
|
77
|
+
- bin/console
|
78
|
+
- bin/setup
|
79
|
+
- fiveinarow.gemspec
|
80
|
+
- lib/fiveinarow.rb
|
81
|
+
- lib/fiveinarow/ai_player.rb
|
82
|
+
- lib/fiveinarow/board.rb
|
83
|
+
- lib/fiveinarow/cell.rb
|
84
|
+
- lib/fiveinarow/generic_player.rb
|
85
|
+
- lib/fiveinarow/hotseat_player.rb
|
86
|
+
- lib/fiveinarow/version.rb
|
87
|
+
- lib/fiveinarow/z_order.rb
|
88
|
+
- lib/media/background_800_800.png
|
89
|
+
- lib/media/cell_alpha_35_35.png
|
90
|
+
- lib/media/cell_o_35_35.png
|
91
|
+
- lib/media/cell_white_35_35.png
|
92
|
+
- lib/media/cell_win_35_35.png
|
93
|
+
- lib/media/cell_x_35_35.png
|
94
|
+
- lib/media/the_end_800_800.png
|
95
|
+
homepage: https://github.com/nesro/fiveinarow
|
96
|
+
licenses:
|
97
|
+
- MIT
|
98
|
+
metadata:
|
99
|
+
allowed_push_host: https://rubygems.org
|
100
|
+
post_install_message:
|
101
|
+
rdoc_options: []
|
102
|
+
require_paths:
|
103
|
+
- lib
|
104
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
105
|
+
requirements:
|
106
|
+
- - ">="
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '0'
|
109
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
|
+
requirements:
|
111
|
+
- - ">="
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: '0'
|
114
|
+
requirements: []
|
115
|
+
rubyforge_project:
|
116
|
+
rubygems_version: 2.4.8
|
117
|
+
signing_key:
|
118
|
+
specification_version: 4
|
119
|
+
summary: Five-in-a-row game
|
120
|
+
test_files: []
|