1
0
Fork 0

Compare commits

...

5 Commits

6 changed files with 36 additions and 15 deletions

3
bootstrap.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
autoreconf -vif

View File

@ -2,6 +2,7 @@
#:use-module (srfi srfi-1)
#:export (make-board
board-ref
board-assert-vacant
board-choose!
board-display
board-winner?))
@ -11,14 +12,13 @@
(define (make-board)
(make-array #f ggg-size ggg-size))
(define (board-ref board x y)
(array-ref board y x))
(define (board-assert-vacant board x y)
(define ref (board-ref board x y))
(if ref (error "That space is already occupied with:" ref) ref))
(define (board-choose! board val x y)
(define ref (board-ref board x y))
(if ref
(error "That space is already occupied with:" ref)
(array-set! board val y x)))
(board-assert-vacant board x y)
(array-set! board val y x))
(define (board-display board)
(array-slice-for-each-in-order

View File

@ -31,12 +31,14 @@
;; TODO: These need to go somewhere else so the peer can't move or init for us!
[(try-transition) 'playing]
[(initialize!)
(on (<- peer 'try-transition) (lambda (status) (format #t "Peer's status: ~a\n" status)) #:promise? #t)]
(on (<- peer 'try-transition) (λ (status) (format #t "Peer's status: ~a\n" status)) #:promise? #t)]
[(my-turn! x y)
(if my-turn?
(begin
(board-choose! board mark x y)
(set! my-turn? (not my-turn?))
(display)
(<- peer 'peer-turn! x y))
(board-assert-vacant board x y)
(on (<- peer 'peer-turn! x y)
(λ (_)
(board-choose! board mark x y)
(set! my-turn? (not my-turn?))
(display))))
(error "It's not my turn."))]))

View File

@ -3,17 +3,26 @@
((guix licenses) #:prefix license:)
(guix download)
(guix build-system gnu)
(guix gexp)
(gnu packages)
(gnu packages autotools)
(gnu packages guile)
(gnu packages guile-xyz)
(gnu packages pkg-config)
(gnu packages texinfo))
(gnu packages texinfo)
(srfi srfi-1))
(define (keep-file? file stat)
(not (any (lambda (my-string)
(string-contains file my-string))
(list ".git" ".dir-locals.el" "guix.scm"))))
(package
(name "gib-gab-gob")
(version "0.1")
(source "./gib-gab-gob-0.1.tar.gz")
(source (local-file (dirname (current-filename))
#:recursive? #t
#:select? keep-file?))
(build-system gnu-build-system)
(arguments
`(#:modules

View File

@ -30,9 +30,11 @@
(in-file "make-initiator")
(text-file "make-initiator")
(text-file "make-joiner")))))
(documentation ((org-file "README")))
(documentation
((text-file "COPYING") (org-file "README")))
(infrastructure
((in-file "pre-inst-env")
((scheme-file "guix")
(in-file "pre-inst-env")
(directory
"build-aux"
((tex-file "texinfo")

5
manifest.scm Normal file
View File

@ -0,0 +1,5 @@
;; What follows is a "manifest" equivalent to the command line you gave.
;; You can store it in a file that you may then pass to any 'guix' command
;; that accepts a '--manifest' (or '-m') option.
(specifications->manifest (list "tor"))