Skip to content

Commit 2010ade

Browse files
committed
Initial upload.
0 parents  commit 2010ade

39 files changed

+7053
-0
lines changed

.gitattributes

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Custom for Visual Studio
5+
*.cs diff=csharp
6+
*.sln merge=union
7+
*.csproj merge=union
8+
*.vbproj merge=union
9+
*.fsproj merge=union
10+
*.dbproj merge=union
11+
12+
# Standard to msysgit
13+
*.doc diff=astextplain
14+
*.DOC diff=astextplain
15+
*.docx diff=astextplain
16+
*.DOCX diff=astextplain
17+
*.dot diff=astextplain
18+
*.DOT diff=astextplain
19+
*.pdf diff=astextplain
20+
*.PDF diff=astextplain
21+
*.rtf diff=astextplain
22+
*.RTF diff=astextplain

.gitignore

+215
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
#################
2+
## Eclipse
3+
#################
4+
5+
*.pydevproject
6+
.project
7+
.metadata
8+
bin/
9+
tmp/
10+
*.tmp
11+
*.bak
12+
*.swp
13+
*~.nib
14+
local.properties
15+
.classpath
16+
.settings/
17+
.loadpath
18+
19+
# External tool builders
20+
.externalToolBuilders/
21+
22+
# Locally stored "Eclipse launch configurations"
23+
*.launch
24+
25+
# CDT-specific
26+
.cproject
27+
28+
# PDT-specific
29+
.buildpath
30+
31+
32+
#################
33+
## Visual Studio
34+
#################
35+
36+
## Ignore Visual Studio temporary files, build results, and
37+
## files generated by popular Visual Studio add-ons.
38+
39+
# User-specific files
40+
*.suo
41+
*.user
42+
*.sln.docstates
43+
44+
# Build results
45+
46+
[Dd]ebug/
47+
[Rr]elease/
48+
x64/
49+
build/
50+
[Bb]in/
51+
[Oo]bj/
52+
53+
# MSTest test Results
54+
[Tt]est[Rr]esult*/
55+
[Bb]uild[Ll]og.*
56+
57+
*_i.c
58+
*_p.c
59+
*.ilk
60+
*.meta
61+
*.obj
62+
*.pch
63+
*.pdb
64+
*.pgc
65+
*.pgd
66+
*.rsp
67+
*.sbr
68+
*.tlb
69+
*.tli
70+
*.tlh
71+
*.tmp
72+
*.tmp_proj
73+
*.log
74+
*.vspscc
75+
*.vssscc
76+
.builds
77+
*.pidb
78+
*.log
79+
*.scc
80+
81+
# Visual C++ cache files
82+
ipch/
83+
*.aps
84+
*.ncb
85+
*.opensdf
86+
*.sdf
87+
*.cachefile
88+
89+
# Visual Studio profiler
90+
*.psess
91+
*.vsp
92+
*.vspx
93+
94+
# Guidance Automation Toolkit
95+
*.gpState
96+
97+
# ReSharper is a .NET coding add-in
98+
_ReSharper*/
99+
*.[Rr]e[Ss]harper
100+
101+
# TeamCity is a build add-in
102+
_TeamCity*
103+
104+
# DotCover is a Code Coverage Tool
105+
*.dotCover
106+
107+
# NCrunch
108+
*.ncrunch*
109+
.*crunch*.local.xml
110+
111+
# Installshield output folder
112+
[Ee]xpress/
113+
114+
# DocProject is a documentation generator add-in
115+
DocProject/buildhelp/
116+
DocProject/Help/*.HxT
117+
DocProject/Help/*.HxC
118+
DocProject/Help/*.hhc
119+
DocProject/Help/*.hhk
120+
DocProject/Help/*.hhp
121+
DocProject/Help/Html2
122+
DocProject/Help/html
123+
124+
# Click-Once directory
125+
publish/
126+
127+
# Publish Web Output
128+
*.Publish.xml
129+
*.pubxml
130+
131+
# NuGet Packages Directory
132+
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
133+
#packages/
134+
135+
# Windows Azure Build Output
136+
csx
137+
*.build.csdef
138+
139+
# Windows Store app package directory
140+
AppPackages/
141+
142+
# Others
143+
sql/
144+
*.Cache
145+
ClientBin/
146+
[Ss]tyle[Cc]op.*
147+
~$*
148+
*~
149+
*.dbmdl
150+
*.[Pp]ublish.xml
151+
*.pfx
152+
*.publishsettings
153+
154+
# RIA/Silverlight projects
155+
Generated_Code/
156+
157+
# Backup & report files from converting an old project file to a newer
158+
# Visual Studio version. Backup files are not needed, because we have git ;-)
159+
_UpgradeReport_Files/
160+
Backup*/
161+
UpgradeLog*.XML
162+
UpgradeLog*.htm
163+
164+
# SQL Server files
165+
App_Data/*.mdf
166+
App_Data/*.ldf
167+
168+
#############
169+
## Windows detritus
170+
#############
171+
172+
# Windows image file caches
173+
Thumbs.db
174+
ehthumbs.db
175+
176+
# Folder config file
177+
Desktop.ini
178+
179+
# Recycle Bin used on file shares
180+
$RECYCLE.BIN/
181+
182+
# Mac crap
183+
.DS_Store
184+
185+
186+
#############
187+
## Python
188+
#############
189+
190+
*.py[co]
191+
192+
# Packages
193+
*.egg
194+
*.egg-info
195+
dist/
196+
build/
197+
eggs/
198+
parts/
199+
var/
200+
sdist/
201+
develop-eggs/
202+
.installed.cfg
203+
204+
# Installer logs
205+
pip-log.txt
206+
207+
# Unit test / coverage reports
208+
.coverage
209+
.tox
210+
211+
#Translations
212+
*.mo
213+
214+
#Mr Developer
215+
.mr.developer.cfg

Gruntfile.js

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/** Gruntfile for basis.
2+
3+
@author <a href="mailto:[email protected]">Leonardo Val</a>
4+
@licence MIT Licence
5+
*/
6+
var umdWrapper = function (init) {
7+
if (typeof define === 'function' && define.amd) {
8+
define(['basis'], init); // AMD module.
9+
} else if (typeof module === 'object' && module.exports) {
10+
module.exports = init(require('basis')); // CommonJS module.
11+
} else {
12+
var global = (0, eval)('this');
13+
global.inveniemus = init(global.basis); // Global namespace.
14+
}
15+
};
16+
17+
module.exports = function(grunt) {
18+
// Init config. ////////////////////////////////////////////////////////////////
19+
grunt.initConfig({
20+
pkg: grunt.file.readJSON('package.json'),
21+
concat: {
22+
options: {
23+
separator: '\n\n',
24+
banner: '"use strict"; ('+ umdWrapper +')(function (basis){ var exports = {};\n',
25+
footer: '\nreturn exports;\n});'
26+
},
27+
build: {
28+
src: [
29+
'src/Game.js', 'src/Player.js', 'src/Match.js',
30+
'src/Tournament.js',
31+
'src/randoms.js',
32+
'src/players/RandomPlayer.js', 'src/players/TracePlayer.js',
33+
'src/players/HeuristicPlayer.js', 'src/players/MiniMaxPlayer.js',
34+
'src/players/MonteCarloPlayer.js',
35+
'src/players/UserInterfacePlayer.js',
36+
'src/games/__Predefined__.js', 'src/games/Choose2Win.js',
37+
'src/games/OddsAndEvens.js', 'src/games/TicTacToe.js',
38+
'src/games/ToadsAndFrogs.js', 'src/games/Mancala.js',
39+
'src/tournaments/MeasurementTournament.js'
40+
],
41+
dest: './<%= pkg.name %>.js',
42+
},
43+
},
44+
uglify: {
45+
options: {
46+
banner: '//! <%= pkg.name %> <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd") %>)\n',
47+
report: 'min'
48+
},
49+
build: {
50+
src: './<%= pkg.name %>.js',
51+
dest: './<%= pkg.name %>.min.js'
52+
}
53+
}
54+
});
55+
56+
// Load tasks. /////////////////////////////////////////////////////////////////
57+
grunt.loadNpmTasks('grunt-contrib-uglify');
58+
grunt.loadNpmTasks('grunt-contrib-concat');
59+
60+
// Register tasks. /////////////////////////////////////////////////////////////
61+
grunt.registerTask('default', ['concat', 'uglify']);
62+
};

LICENSE.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
The MIT License
2+
===============
3+
4+
Source code for ludorum.js is Copyright (C) 2013 [Leonardo Val](mailto:[email protected]).
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7+
8+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9+
10+
**THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.**

README.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# ludorum.js
2+
3+
Ludorum is a board game framework. It is not focused on graphics or user interfaces, but on artificial players design, implementation and testing. Among other thing, it currently includes implementations for:
4+
* Players based on [MiniMax](http://en.wikipedia.org/wiki/Minimax#Minimax_algorithm_with_alternate_moves) with [alfa-beta pruning](http://en.wikipedia.org/wiki/Alpha-beta_pruning).
5+
* Implementations for some simple reference games, including: [TicTacToe](http://en.wikipedia.org/wiki/Tic-tac-toe), [ToadsAndFrogs](http://en.wikipedia.org/wiki/Toads_and_Frogs_%28game%29) and [Mancala](http://en.wikipedia.org/wiki/Kalah).
6+
7+
It supports loading with AMD (with [RequireJS](http://requirejs.org/)) or a script tag (sets 'ludorum' in the global namespace). In order to work requires another library of mine called [basis](https://github.com/LeonardoVal/basis).
8+
9+
## License
10+
11+
Open source under an MIT license. See [LICENSE](LICENSE.md).
12+
13+
## Development
14+
15+
Development requires [NodeJS](http://nodejs.org/) (ver >= 0.10). Download the repository and run `npm install` to install: [RequireJS](http://requirejs.org/), [Grunt](http://gruntjs.com/) and some of its plugins. For testing I also use [jsconsole](http://jsconsole.com/).
16+
17+
## Contact
18+
19+
This software is being continually developed. Suggestions and comments are always welcome via [email](mailto:[email protected]).

0 commit comments

Comments
 (0)