Implement the tic-tac-toe game on Console with two human players.
The game should be implemented using TDD. To make the kata interesting, there are two constraints to take into account
Set a clock timer to two minutes. When the alarm sounds, pass all your tests, if they don't pass, revert the changes to the last commit:
git reset --hard
Object Calisthenics are programming exercises, formalized as a set of 9 rules invented by Jeff Bay in his book The ThoughtWorks Anthology. The word Object is related to Object Oriented Programming. The word Calisthenics is derived from greek, and means exercises under the context of gymnastics. By trying to follow these rules as much as possible, you will naturally change how you write code. It doesn’t mean you have to follow all these rules, all the time. Find your balance with these rules, use some of them only if you feel comfortable with them.
These rules focus on maintainability, readability, testability, and comprehensibility of your code. If you already write code that is maintainable, readable, testable, and comprehensible, then these rules will help you write code that is more maintainable, more readable, more testable, and more comprehensible.
The 9 rules listed below:
- Only One Level Of Indentation Per Method
- Don’t Use The ELSE Keyword
- Wrap All Primitives And Strings
- First Class Collections
- One Dot Per Line
- Don’t Abbreviate
- Keep All Entities Small
- No Classes With More Than Two Instance Variables
- No Getters/Setters/Properties
(defvar problema-cercaA*
(list tl-operadors
#'(lambda (info-node-pare estat nom-operador) ;;; *** info-node-pare = (estat-pare (g g-plus-h))
(let ((estat-pare (car info-node-pare)) ;;; Això també és diferent de l'original
(g (caadr info-node-pare))
(g-plus-h (cadadr info-node-pare)))
(list (+ g (cost estat-pare estat))
(+ (+ g (cost estat-pare estat)) (heuristica estat)))))
'A
#'(lambda (estat) (equal estat 'G))
#'(lambda (estat) (list 0 (heuristica estat))) ))