Skip to content

Instantly share code, notes, and snippets.

@mattmils
Created July 13, 2011 22:57
Show Gist options
  • Save mattmils/1081528 to your computer and use it in GitHub Desktop.
Save mattmils/1081528 to your computer and use it in GitHub Desktop.
Palestra LTS
const NU = 2
const ND = 2
const NV = 2
const UOMO = 0
const DONNA = 1
const VIP = 2
range TYPE = UOMO..VIP
const FALSE = 0
const TRUE = 1
range BOOL = FALSE..TRUE
PERSONA(T=UOMO) = (
richiedi[T] -> entra[T] -> esci[T] -> PERSONA
).
SPOGLIATOIO = S[0][0][FALSE][FALSE],
S[u:0..NU][d:0..ND][request:BOOL][vip:BOOL] = (
// VIP
v[1..NV].richiedi[VIP] -> S[u][d][TRUE][vip] |
when(u == 0 && d == 0 && vip == FALSE) v[1..NV].entra[VIP] -> S[u][d][FALSE][TRUE] |
v[1..NV].esci[VIP] -> S[u][d][request][FALSE] |
// DONNA
when(u == 0 && request == FALSE && vip == FALSE) d[1..ND].entra[DONNA] -> S[u][d+1][FALSE][FALSE] |
d[1..ND].esci[DONNA] -> S[u][d-1][FALSE][FALSE] |
// UOMO
when(d == 0 && request == FALSE && vip == FALSE) u[1..NU].entra[UOMO] -> S[u+1][d][FALSE][FALSE] |
u[1..NU].esci[UOMO] -> S[u-1][d][FALSE][FALSE]
).
||PALESTRA = ( u[1..NU]:PERSONA(UOMO) || d[1..ND]:PERSONA(DONNA) || v[1..NV]:PERSONA(VIP) || SPOGLIATOIO ).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment