june / Accounting Mocks
0 likes
0 forks
1 files
Last active 21 hours ago
An example of turning pseudocode into a functional model.
| 1 | |# First, we need to import conditional statements. #| |
| 2 | ||'@include' https://gist.nouveau.community/june/72f7794abbf64eb3890e2715d7e7789b/raw/HEAD/conditional.nv |
| 3 | |
| 4 | |# Let's try something. #| |
| 5 | ||:: test the happy path |
| 6 | :: log in as june |
| 7 | :: transfer 100 from 1234 to 5678 |
| 8 | :: log out |
| 9 | |
| 10 | ||:: test the sad path |
june / Conditional Logic
0 likes
0 forks
1 files
Last active 22 hours ago
If/else statements, implemented in Nova.
| 1 | ||:@control.enabled: |
| 2 | |
| 3 | || :@control.if: if |
| 4 | || :@control.then: then |
| 5 | || :@control.end: end |
| 6 | || :@control.else: else |
| 7 | || :@control.fail: fail |
| 8 | | :@control.enabled:? |
| 9 | :@control.fail: $fail? |
| 10 | :@control.then: $then? |
june / Multiple State Machines
0 likes
0 forks
1 files
Last active 2 days ago
An example of turning an isolated state machine into multiple.
| 1 | |# A turnstile, a state machine. #| |
| 2 | |
| 3 | |:state: locked :action: push| :state: locked |
| 4 | |:state: locked :action: coin| :state: un-locked |
| 5 | |
| 6 | |:state: un-locked :action: push| :state: locked |
| 7 | |:state: un-locked :action: coin| :state: un-locked |
| 8 | |
| 9 |
june / Menu System
0 likes
0 forks
1 files
Last active 4 days ago
A small menu system with configurable actions.
| 1 | ||:: set up the menus |
| 2 | :: run the test |
| 3 | |
| 4 | |:: set up the menus| |
| 5 | :: define menu title-screen |
| 6 | :: start -> switch-menu |
| 7 | :: options -> switch-menu |
| 8 | :: quit -> quit-game |
| 9 | :: end menu |
| 10 | :: define menu start |
june / Scoped Propagators
0 likes
0 forks
1 files
Last active 1 week ago
A small modification to the original propagator code that adds scopes.
| 1 | || :@include: lib/rpn.nv |
| 2 | |
| 3 | ||:: ( |
| 4 | a = b + c ; |
| 5 | var c ; |
| 6 | a = 10 ; |
| 7 | b <- 20 ; |
| 8 | c <- 30 ; |
| 9 | { |
| 10 | a = b - c ; |
june / Propagators
0 likes
0 forks
1 files
Last active 1 week ago
An implementation of propagators in Nova.
| 1 | || :@include: lib/rpn.nv |
| 2 | |
| 3 | || :: declare variables :: (a b c d) |
| 4 | :: c = b * a |
| 5 | :: d = c + a |
| 6 | :: a <- 3 |
| 7 | :: b <- 2 |
| 8 | |
| 9 | |:: $x <- $y| |
| 10 | :: set $x to $y |
Newer
Older