skatenerd / tic-tac-pro Goto Github PK
View Code? Open in Web Editor NEWTic Tac Toe.
Tic Tac Toe.
This is an implementation of TTT in Prolog. Learning Prolog: I learned Prolog from these two resources: http://www.learnprolognow.org/ http://boklm.eu/prolog/ I prefer the first site because it is clear and moves quickly. The author of the second site takes good photographs, though. Try to really understand the idea of a predicate, and solving for a predicate. The idea is that Prolog resolves predicates for you. You see a lot of predicates with what look like "output arguments". DO NOT, I repeat, DO NOT just think of these as output arguments. These variables are inputs to the predicate. Prolog is looking for values to assign to these arguments in order to satisfy the predicate! Fortunately, there is not much syntax. Unfortunately, understanding Prolog requires understanding a lot about how Prolog works. Don't be afraid to dive in and try to understand "backtracking". This is the process through which Prolog tries to resolve predicates. Setting up the environment: Go to http://www.swi-prolog.org/download/stable Download the binary appropriate to your environment It will be named something like, "swi-prolog-6.0.2-lion-intel.mpkg.zip" Double click it to install. Now you can enter the repl by typing "/opt/local/bin/swipl" at the command line. Important prolog fact: All inputs must be followed by a period ("."). The interpreter doesn't know when you have finished typing unelss you use a period. Running the tests: CD to project root. You can run tests on modules individually by typing: consult('spec/my_module_spec.pl'). run_tests(test_group_name). Alternatively, you can run tests on all of the modules at once by typing: consult('spec/run_tests.pl'). run_all. Running all of the tests at once will produce some output. Make sure the word "error" does not appear. Running the game: CD to project root. Enter repl ("/opt/local/bin/swipl") Type: consult('src/ttt'). ttt:initialize_game. Play!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.