-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
264 lines (243 loc) · 14.2 KB
/
build.gradle
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
// Copyright by Barry G. Becker, 2013 - 2023. Licensed under MIT License: http://www.opensource.org/licenses/MIT
buildscript {
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots/"}
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}
dependencies {
classpath 'com.barrybecker4:bb4-gradle:1.8-SNAPSHOT'
}
}
description = 'A game playing framework and a collection of two-player and multi-player games. ' +
'In all games, one or more intelligent computer opponents are allowed to play.'
group = 'com.barrybecker4'
version = '1.8-SNAPSHOT'
ext {
archivesBaseName = 'bb4-game'
mainClass = "com.barrybecker4.game.common.ui.GameApp"
gameApp = 'com.barrybecker4.game.common.ui.GameApp'
}
apply from: project.buildscript.classLoader.getResource('bb4.gradle').toURI()
dependencies {
implementation 'com.barrybecker4:bb4-math:1.8-SNAPSHOT'
implementation 'com.barrybecker4:bb4-common:1.8-SNAPSHOT'
implementation 'com.barrybecker4:bb4-sound:1.8-SNAPSHOT'
implementation 'com.barrybecker4:bb4-ui:1.8-SNAPSHOT'
implementation 'com.barrybecker4:bb4-optimization:1.8-SNAPSHOT'
implementation 'com.barrybecker4:bb4-A-star:1.8-SNAPSHOT'
implementation 'com.barrybecker4:bb4-sgf:1.1.3'
// jars needed for go
implementation fileTree(dir: 'lib', include: '*.jar')
}
task runKgsTesujisoftGoClient(type: JavaExec) {
group = 'application'
main = 'com.barrybecker4.game.twoplayer.go.GtpKgsTesujisoftGoClient'
classpath = sourceSets.main.runtimeClasspath
}
/*
task runGoGui(type: JavaExec) {
main = 'gogui.Main'
args = ["arg1", "-program", "arg2", "${java_compiler} -ea -classpath ${classesDir};${libDir}/gogui7.1.jar com.barrybecker4.game.twoplayer.go.server.GtpTesujisoftGoServer"]
classpath = sourceSets.main.runtimeClasspath
} */
/*
task runTrivialServer(type: JavaExec) {
main = 'com.barrybecker4.game.common.online.ui.OnlineGameServerFrame'
args = ["-game", "trivial"]
classpath = sourceSets.main.runtimeClasspath
}
task runTrivialServerAndClients(type: JavaExec) {
tasks.runTrivialServer.execute()
tasks.runTrivial.execute()
tasks.runTrivial.execute()
tasks.runTrivial.execute()
}*/
task runPokerServer(type: JavaExec) {
group = 'application'
main = 'com.barrybecker4.game.common.online.ui.OnlineGameServerFrame'
args = ["-game", "poker", "-locale", "ENGLISH"]
classpath = sourceSets.main.runtimeClasspath
}
task runGameComparisons(type: JavaExec) {
group = 'application'
main = "com.barrybecker4.game.twoplayer.comparison.GameComparisonApp"
args = ["-name", "gomoku", "-locale", "ENGLISH"]
classpath = sourceSets.main.runtimeClasspath
}
/* Some ant code to run poker server and clients was here, but deleted. See git */
// The appMap is used to create the list of available application in the html index page and to generate the app tasks.
ext.appMap = new LinkedHashMap()
appMap['gomoku'] = [
title: 'Go-Moku',
command: 'bb4-games -name gomoku',
description: 'Try to win by getting five in a row before the computer does.',
longDescription: 'Try to win by getting five in a row before the computer does. ' +
'I used to play <a href="http://en.wikipedia.org/wiki/GoMoku">gomoku</a> ' +
'a lot with my wife when we first met (she is quite good at it). ' +
'GoMoku is the first game that I created using my game framework. I first created a ' +
'<a href="http://en.wikipedia.org/wiki/Turbo_Pascal">Turbo Pascal</a> version back in 1991, n' +
'but this one is better. My motivation has been to make it good enough to beat my wife. ' +
'The object of the game is to get 5 in a row (horizontally, vertically, or diagonally). ' +
'As with all the games created using this framework, ' +
'you can play against the computer, another person, or have the computer play against itself.'
]
appMap['chess'] = [
title: 'Chess',
command: 'bb4-games -name chess',
description: 'Try to beat the computer by checkmating her king. Your pieces are at the top. ' +
'Move them using drag and drop.',
longDescription: '<a href="http://en.wikipedia.org/wiki/Chess">Chess</a> ' +
'is a relatively simple game compared to go. I implemented it in only 3 days - ' +
'after I spent a year implementing go and the rest of my java game framework. ' +
'Try to beat the computer by check-mating her king. Your pieces are at the top. ' +
'Checkmate the opponent\'s King to win.'
]
appMap['checkers'] = [
title: 'Checkers',
command: 'bb4-games -name checkers',
description: 'Try to beat the computer by capturing all her pieces. ' +
'Your pieces are at the top. Move them using drag and drop.',
longDescription: '<a href="http://www.ehow.com/way_5421915_checkers-game-instructions.html">Checkers</a> ' +
'is a simple game. I implemented it in only 2 weekends after I got the gomoku program ' +
'running and already established a framework for creating additional games. ' +
'Capture all of the opponents pieces to win.'
]
appMap['go'] = [
title: 'Go',
command: 'bb4-games -name go',
description: 'Try to beat the computer by capturing more territory. ' +
'When a group of stones is completely surrounded, ' +
'they are removed from the board and become captures.',
longDescription: '<a href="http://en.wikipedia.org/wiki/Go_(game)">Go</a> ' +
'has long been a grand challenge for computer scientists. Until the year 2000, ' +
'the Ing Foundation offered <a href="http://www.computer-go.info/h-c/">' +
'a million dollar prize</a> to anyone that could create a go program capable of ' +
'beating a professional player. ' +
'In 2017, <a href="https://deepmind.com/research/alphago/">AlphaGo</a> ' +
'became the first program to beat a professional. I started work on this program in the year 2000. ' +
'It does not play very well, but it lead me on an interesting journey. ' +
'For those interested in learning about a deep learning solution to Go, ' +
'I recommend looking at <a href="https://github.com/gcp/leela-zero">Leela-Zero</a>.'
]
appMap['blockade'] = [
title: 'Blockade',
command: 'bb4-games -name blockade',
description: 'Try to beat the computer by reaching her home base first. ' +
'After each piece movement you need to place a wall. ' +
'When placing a wall, however, you are not allowed to completely ' +
'cut off any piece from reaching any opponent home base.',
longDescription: '<a href="http://boardgamegeek.com/boardgame/2559/blockade">Blockade</a> ' +
'is a relatively new game created by Lakeside. ' +
'I used to play it as a kid, but I don\'t see it in the stores anymore. ' +
'Each player starts with two pawns on designated spaces near their side of the board. ' +
'They each have (typically) ten blue walls and ten green walls, which fit in the slots ' +
'between the grid squares and are two squares wide. A player\'s turn consists ' +
'of moving his pawn two spaces and then placing a wall anywhere on the grid. ' +
'The object is to get one of your pawns around the obstacles being set by your ' +
'opponent and onto one of his or her starting spaces.'
]
appMap['hex'] = [
title: 'Hex',
command: 'bb4-games -name hex',
description: 'Your goal is to place tiles until you make a path that connects the two sides ' +
'of the board that match your color.',
longDescription: '<a href="https://en.wikipedia.org/wiki/Hex_(board_game)">Hex</a> ' +
'Alternate placing of pieces. When players edges connect by a string of pieces of the same color, ' +
'that player wins. The player who goes first has a distinct advantage.'
]
appMap['galactic'] = [
title: 'Galactic Empire',
command: 'bb4-games -name galactic',
description: 'Your goal is to place tiles until you make a path that connects the two sides ' +
'of the board that match your color.',
longDescription: 'This multi-player game is loosely based on a game I played ' +
'on a Comodore 128 back in the late 80\'s. ' +
'<a href="http://en.wikipedia.org/wiki/Galactic_Empire_(Br%C3%B8derbund_video_game)">' +
'the original game</a> had only text graphics, ' +
'but was fun to play with friends in the college dorm at ' +
'<a href="http://rpi.edu/">RPI</a>. This version has several improvements: ' +
'better graphics, robot players, and there are visual indications of fleet sizes and locations.'
]
appMap['poker'] = [
title: 'Poker',
command: 'bb4-games -name poker',
description: 'Try your hand at winning poker against other human and computer opponents.',
longDescription: 'This is basic 5 card stud <a href="http://en.wikipedia.org/wiki/Poker">poker</a>. ' +
'I may expand it to play Texas holdem and other poker variations in the future. ' +
'There is also a client server version of this and the other games for online play, ' +
'but its a work in progress. This version takes a little while to start because it ' +
'checks to see if there is a server first, and has to wait for that check to timeout.'
]
appMap['mancala'] = [
title: 'Mancala',
command: 'bb4-games -name mancala',
description: 'Your goal is to get more stones into your home than the computer can get into its home.',
longDescription: '<a href="https://en.wikipedia.org/wiki/Mancala">Mancala</a> ' +
'Move stones on your side of the board. ' +
'To move, you click on one of the bins in your row. ' +
'This picks up all the stones in that bin and moves them counter-clockwise, ' +
'putting one stone in each bin as it goes. If the last stone lands in your home, then you go again. ' +
'If the last stone lands in an empty bin on your side and there are stones in the opponent\'s cup ' +
'right across from it, then all the stones in both cups get put into your home.'
]
appMap['set'] = [
title: 'Set',
command: 'bb4-games -name set',
description: 'Try to find more "Sets" before other human and computer opponents. ' +
'A set is 3 cards that are all the same or all different for the ' +
'4 attributes: color, shape, texture, and number.',
longDescription: '<a href=http://www.setgame.com/set/index.html>Set</a> is a simple card ' +
'card played with a deck of 81 cards. ' +
'A set is 3 cards that are all the same or all different for the 4 attributes: color, shape, ' +
'texture, and number. When you see a set, click on the player to claim it, then select the three ' +
'cards you think are a set. Be careful - you lose a point if you are wrong (but cannot go below 0). ' +
'There is no computer player in this game because it would be too easy for it to win.',
// This cannot be deploy publicly for legal reasons.
deploy: false
]
appMap['tictactoe'] = [
title: 'Tic-Tac-Toe',
command: 'bb4-games -name tictactoe',
description: 'Simple game of 3 in a row.',
longDescription: 'Implementing unbeatable ' +
'<a href="https://en.wikipedia.org/wiki/Tic-tac-toe">Tic-Tac-Toe</a> ' +
'was very easy using the game framework. ' +
'If you want to add your own game, this implementation may provide a useful example.'
]
appMap['trivial'] = [
title: 'Trivial',
command: 'bb4-games -name trivial',
description: 'Try your hand at winning trivial against other human and computer opponents.',
longDescription: 'This is a trivial game where the high value wins. ' +
'It provides a template for building other more interesting multi-player games ' +
'that use the same client server model.',
deploy: false
]
ext.jarMap = new LinkedHashMap()
jarMap['game'] =
[include:['com/barrybecker4/game/common/**', 'com/barrybecker4/game/card/**', 'com/barrybecker4/game/*.xml']]
jarMap['twoplayer'] = [include:['com/barrybecker4/game/twoplayer/common/**']]
jarMap['multiplayer'] =[include:['com/barrybecker4/game/multiplayer/common/**']]
jarMap['blockade'] = [include:['com/barrybecker4/game/twoplayer/blockade/**']]
jarMap['chess'] = [include:['com/barrybecker4/game/twoplayer/chess/**', 'com/barrybecker4/game/twoplayer/checkers/**']]
jarMap['go'] = [include:['com/barrybecker4/game/twoplayer/go/**']]
jarMap['gomoku'] = [include:['com/barrybecker4/game/twoplayer/gomoku/**']]
jarMap['tictactoe'] = [include:['com/barrybecker4/game/twoplayer/tictactoe/**']]
jarMap['mancala'] = [include:['com/barrybecker4/game/twoplayer/mancala/**']]
jarMap['hex'] = [include:['com/barrybecker4/game/twoplayer/hex/**']]
jarMap['galactic'] = [include:['com/barrybecker4/game/multiplayer/galactic/**']]
jarMap['poker'] = [include:['com/barrybecker4/game/multiplayer/poker/**']]
jarMap['set'] = [include:['com/barrybecker4/game/multiplayer/set/**']]
appMap.each { appId, propMap ->
def mainClass = appMap['mainClass'] ?: gameApp
def argsList = ["-name", "${appId}"]
tasks.create(name: "run${appId.capitalize()}", type: JavaExec, description: "${propMap.description}") {
group = 'application'
main = "${mainClass}"
args = argsList
classpath = sourceSets.main.runtimeClasspath
jvmArgs = ["-ea"]
}
}
apply from: project.buildscript.classLoader.getResource('bb4-publish.gradle').toURI()
apply from: project.buildscript.classLoader.getResource('bb4-deploy.gradle').toURI()