-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug fixes. User games. Selection script view.
- Loading branch information
Showing
66 changed files
with
3,148 additions
and
920 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -243,3 +243,5 @@ ModelManifest.xml | |
*.zrf | ||
/old | ||
GamesZrf | ||
/Unity/User Games | ||
*.diagsession |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,201 @@ | ||
; include file for unit testing | ||
(define game1 | ||
(game | ||
(title "testincl game1") | ||
(players X O) | ||
(turn-order X O) | ||
(board) | ||
) | ||
) | ||
|
||
(define game2 | ||
(game | ||
(title "testincl game2") | ||
(players X O) | ||
(turn-order X O) | ||
(board) | ||
) | ||
) | ||
|
||
;; simple board test | ||
(define gameb1 | ||
(game | ||
(title "board1") | ||
(players X O) | ||
(turn-order X O) | ||
(board | ||
(image "board1.png") | ||
(grid | ||
(start-rectangle 16 16 112 112) ; top-left position | ||
(dimensions | ||
("A-/B-/C-/D-" (0 112)) ; rows | ||
("1/2/3/4/5" (112 0))) ; columns | ||
(directions (n -1 0) (e 0 1) (s 1 0) (w 0 -1)) | ||
) | ||
) | ||
) | ||
) | ||
|
||
;; simple game stub | ||
(define gamestub1 | ||
(title "stub1") | ||
(players X O N) | ||
(turn-order X O) | ||
) | ||
|
||
;; simple game stub, can do variant | ||
(define gamestub2 | ||
(title $1) | ||
(players X O N) | ||
(turn-order X O) | ||
) | ||
|
||
;; simple board, no grid | ||
(define boardlink1 | ||
(image "board1.png") | ||
(positions | ||
(a1 11 12 13 14) | ||
(a2 21 22 23 24) | ||
(a0 41 42 43 44) | ||
(b0 41 42 43 44) | ||
(b1 31 32 33 34) | ||
(b2 41 42 43 44) | ||
) | ||
(links n (a2 a1) (b2 b1)) | ||
(links e (a1 b1) (a2 b2)) | ||
(links w (b1 a1) (b2 a2)) | ||
(unlink b2 (b1 e) (b2 b1) (b1 w)) | ||
(kill-positions a0 b0) | ||
(zone | ||
(name zone1) | ||
(players X) | ||
(positions a1 a2) | ||
) | ||
) | ||
|
||
;; board with grid | ||
(define boardgrid33 | ||
(image "board33.png") | ||
(grid | ||
(start-rectangle 16 16 112 112) ; top-left position | ||
(dimensions | ||
("A-/B-/C-" (0 112)) ; rows | ||
("1/2/3" (112 0))) ; columns | ||
(directions | ||
(n -1 0) (e 0 1) (s 1 0) (w 0 -1) | ||
(nw -1 -1) (ne -1 1) (se 1 1) (sw 1 -1) | ||
) | ||
) | ||
) | ||
|
||
(define boardgrid45 | ||
(image "board45.png") | ||
(grid | ||
(start-rectangle 16 16 112 112) ; top-left position | ||
(dimensions | ||
("A-/B-/C-/D-" (0 112)) ; rows | ||
("1/2/3/4/5" (112 0))) ; columns | ||
(directions | ||
(n -1 0) (e 0 1) (s 1 0) (w 0 -1) | ||
(nw -1 -1) (ne -1 1) (se 1 1) (sw 1 -1) | ||
) | ||
) | ||
) | ||
|
||
;; define single piece | ||
(define piece1 | ||
(name man) | ||
(attribute male true) | ||
(description "man desc") | ||
(notation "M") | ||
(help "man help") | ||
(image X "MANX.png" | ||
O "MANO.png") | ||
) | ||
|
||
;; define two pieces | ||
(define piece2 | ||
(name chip) | ||
(image X "CHIPX.png" | ||
O "CHIPO.png") | ||
) | ||
|
||
;; setup for single piece, one player | ||
(define setup1 | ||
(X (man A-1 B-1 off 5 C-1)) | ||
) | ||
|
||
;; setup for single piece, both players | ||
(define setup2 | ||
(X (man A-1 B-1 off 5 C-1)) | ||
(O (man off 8 C-2)) | ||
) | ||
|
||
;; win conditions | ||
(define relcondttt | ||
(X O) | ||
(or (relative-config man n man n man) | ||
(relative-config man e man e man) | ||
(relative-config man ne man ne man) | ||
(relative-config man nw man nw man) | ||
) | ||
) | ||
|
||
; win condition equivalent to above | ||
(define abscondttt | ||
(X O) | ||
(or | ||
(absolute-config man (A-1 A-2 A-3)) | ||
(absolute-config man (B-1 B-2 B-3)) | ||
(absolute-config man (C-1 C-2 C-3)) | ||
(absolute-config man (A-1 B-1 C-1)) | ||
(absolute-config man (A-2 B-2 C-2)) | ||
(absolute-config man (A-3 B-3 C-3)) | ||
(absolute-config man (A-1 B-2 C-3)) | ||
(absolute-config man (A-3 B-2 C-1)) | ||
) | ||
) | ||
|
||
(define pce-rem-cond | ||
(X O) | ||
(or | ||
(pieces-remaining 3) | ||
(pieces-remaining 2 chip) | ||
) | ||
) | ||
|
||
(define tot-pce-cond | ||
(X O) | ||
(or | ||
(total-piece-count 3) | ||
(total-piece-count 2 chip) | ||
) | ||
) | ||
|
||
;; define some simple drops | ||
(define piecedrops1 | ||
(name man) | ||
(drops | ||
(n add) | ||
) | ||
) | ||
;; setup for moves testing predicates | ||
(define setup-xon1 | ||
(X (man C-1)) | ||
(O (man A-3)) | ||
(N (chip A-4)) | ||
) | ||
|
||
(define pce-drop-xon1 | ||
(name xx) | ||
(drops | ||
((if adjacent-to-enemy? add)) | ||
((if not-empty? e e add)) | ||
((if friend? e add)) | ||
((if enemy? w w add)) | ||
((if neutral? s add)) | ||
((if (piece? chip) se add)) | ||
((if (position? E-4) add)) | ||
) | ||
) | ||
|
Oops, something went wrong.