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
| -- Viennese Maze Simulator, based on | |
| -- http://zulko.github.io/blog/2014/04/27/viennese-mazes-what-they-are/ | |
| import Keyboard | |
| import Window | |
| import Graphics.Input as Input | |
| ------------- | |
| -- Helpers -- | |
| ------------- |
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
| require "ipaddr" | |
| class IPAddr | |
| # Returns the ipaddr representing the smallest CIDR block that includes both | |
| # ipaddrs. | |
| def union(other) | |
| addr = @addr | |
| coerced = coerce_other(other).to_i | |
| prefixlen = self.ipv4? ? 32 : 128 | |
| while addr != coerced |
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
| -- Spinner by Max Goldstein | |
| import Mouse | |
| import Window | |
| import Dict (Dict, empty, toList, insert, findWithDefault) | |
| import Automaton (Automaton, state, run) | |
| import Graphics.Input (button) | |
| -- MODEL |
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
| -- Bitmap Draw by Max Goldstein | |
| -- Change the cursor mode with the keyboard: | |
| -- t Toggle (default) | |
| -- b Black | |
| -- w White | |
| -- c Clear (automatically resets to Toggle afterwards) | |
| import Mouse | |
| import Keyboard |
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
| -- Sploosh Ball by Max Goldstein | |
| import Window | |
| import Mouse | |
| -- Model | |
| type Spoke = ((Float,Float), Color) | |
| -- Update | |
| curColor : Signal Color |
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
| -- Gyrations by Max Goldstein | |
| import Window | |
| main = scene <~ foldp (+) 0 (fps 40) ~ Window.dimensions | |
| scene t (w,h) = | |
| let minr = 14 | |
| maxr = 40 | |
| time = inSeconds t |
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
| /* hexBright.c - visualize hex data with brightness | |
| * Max Goldstein | |
| * | |
| * example usage: | |
| * $ head /dev/urandom | hexdump -e '16/1 "%02x " "\n"' | ./hexBright | |
| */ | |
| #include <stdio.h> | |
| int main(){ |
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
| /* octBright.c - visualize octal data with brightness | |
| * Max Goldstein | |
| * | |
| * example usage: | |
| * $ od -o < /dev/random | sed 's/^[0-9]* +//' | tr -d ' ' | ./octBright | |
| */ | |
| #include <stdio.h> | |
| int main(){ |
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
| DEPTH = 6 | |
| LENGTH = 12 | |
| #Change me! | |
| def f(i): | |
| return i | |
| #also try: | |
| #return i**2 | |
| #return 2**i |
NewerOlder