This file contains hidden or 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
:- use_module(library(pairs)). | |
:- use_module(library(reif)). | |
not_in_list(K, L) :- | |
if_((L = []), | |
true, | |
([X | More] = L, | |
dif(K, X), | |
not_in_list(K, More))). |
This file contains hidden or 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
(define fsm-ho2 | |
(lambda (str) | |
(letrec ([S0 (lambda (b) | |
(case b | |
[(0) S0] | |
[(1) S1] | |
[else #t]))] | |
[S1 (lambda (b) | |
(case b | |
[(0) S2] |
This file contains hidden or 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 is a simplified version of the card game War written in Puppy. ) | |
( Simple version of War: ) | |
( Two values on top of the stack represent dealt cards for the left and the ) | |
( right players. Figure out which is bigger, and send the cards to that ) | |
( player. In case of a tie, play again to determine the winner. ) | |
( Puppy is an unimplemented point-free, concatentative, stack-based language ) | |
( with quotations. ) |