Skip to content

Instantly share code, notes, and snippets.

@comboy
Last active August 29, 2015 14:11

Revisions

  1. comboy revised this gist Dec 23, 2014. 1 changed file with 18 additions and 0 deletions.
    18 changes: 18 additions & 0 deletions 8.xmas
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    :: draw a christmas tree
    !:
    |_ [hid=hide ~]
    ++ poke-xmas-args
    |= [ost=bone sip=ship *]
    :_ +>
    =+ w=11
    =+ a=w
    |-
    ?: (lth a 1) ~
    :_ $(a (dec a))
    =- [ost %pass / %d %flog %text -]
    ?: =(a w) (weld (reap (dec w) ' ') "| |")
    %+ weld
    %+ reap +((sub w a)) ' '
    ?: =(a 1) "*"
    %+ reap (dec (mul a 2)) '^'
    --
  2. comboy revised this gist Dec 22, 2014. 1 changed file with 34 additions and 0 deletions.
    34 changes: 34 additions & 0 deletions 7.bomb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,34 @@
    :: display some texts with time intervals between them
    :: :bomb
    |%
    ++ axle
    $% [%0 tic=@ud wait=@dr]
    ==
    --
    ::
    !:
    |_ [hid=hide vat=axle]
    ++ poke-bomb-args
    |= [ost=bone sip=ship *]
    =. tic.vat 10
    =. wait.vat ~s5
    :_ +>.$
    :- [ost %give %nice ~]
    :- [ost %pass / %d %flog %text "[suspicious box appears out of nowhere]"]
    :- [0 %pass /time %t %wait (add wait.vat lat.hid)]
    ~
    ::
    ++ pour
    |= [ost=bone pax=path x=*]
    =. tic.vat (dec tic.vat)
    =. wait.vat ^-(@dr (div `@ud`wait.vat 2))
    :_ +>.$
    ?: (lte tic.vat 1)
    :- [ost %pass / %d %flog %text "How did you do that Nock?!"]
    :- [ost %pass / %g %cide %$] ~
    :- [ost %pass / %d %flog %text ?:(=((mod tic.vat 2) 1) "tik" "tok")]
    :- [0 %pass /time %t %wait (add wait.vat lat.hid)] ~
    ::
    ++ peer
    |= * `+>
    --
  3. comboy revised this gist Dec 22, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions 6.fibo
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    :: failed attempt at fib sequence where new numbers would be displayed as soon
    :: as they are computed :-( I know I could just use ~& but that's cheating
    :: :fibo 25
    |%
    ++ sign
    $% $: %g
  4. comboy revised this gist Dec 22, 2014. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions 6.fibo
    Original file line number Diff line number Diff line change
    @@ -36,8 +36,11 @@
    (add $(a (sub a 1)) $(a (sub a 2)))
    ::
    ++ pour
    |= * `+>
    |= [ost=bone *]
    :_ +>.$
    :- [ost %pass / %g %cide %$]
    ~
    ::
    ++ peer
    |= * `+>
    --
    --
  5. comboy revised this gist Dec 22, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 6.fibo
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    :: failed attempt at fib sequence where new numbers would be displayed as soon
    :: as they are computed :-(
    :: as they are computed :-( I know I could just use ~& but that's cheating
    |%
    ++ sign
    $% $: %g
  6. comboy revised this gist Dec 22, 2014. 1 changed file with 43 additions and 0 deletions.
    43 changes: 43 additions & 0 deletions 6.fibo
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,43 @@
    :: failed attempt at fib sequence where new numbers would be displayed as soon
    :: as they are computed :-(
    |%
    ++ sign
    $% $: %g
    $% [%nice ~]
    [%mean p=ares]
    [%mean p=@ud]
    == == ==
    --
    ::
    !:
    |_ [hid=hide ~]
    ++ poke-fibo-args
    |= [ost=bone sip=ship upto=@ud *]
    :_ +>.$
    :- [ost %give %nice ~]
    :: XX couldnt flop it, probably type issue, tried (list move) but without luck
    =+ a=upto
    |-
    ?: (lte a 0) ~
    :_ $(a (dec a))
    [ost %pass / %g %mess [sip /fibo] sip %foo !>(a)]
    ::
    ++ poke-foo
    |= [ost=bone sip=ship a=@ud]
    :_ +>.$
    :- [ost %pass / %d %flog %text (scow %ud (fib a))]
    :- [ost %give %nice ~]
    ~
    ::
    ++ fib
    |= a=@ud
    |-
    ?: (lte a 2) 1
    (add $(a (sub a 1)) $(a (sub a 2)))
    ::
    ++ pour
    |= * `+>
    ::
    ++ peer
    |= * `+>
    --
  7. comboy revised this gist Dec 21, 2014. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion 5.hell
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,5 @@
    :: lazy hello mars, is it bad? if so then why?
    |_ [hid=hide ~]
    !:
    ++ poke-hell-args
    |= [ost=bone *]
    :_ +>.$
  8. comboy revised this gist Dec 21, 2014. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions 5.hell
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    :: lazy hello mars, is it bad? if so then why?
    |_ [hid=hide ~]
    !:
    ++ poke-hell-args
    |= [ost=bone *]
    :_ +>.$
    :- [ost %pass / %g %cide %$]
    :- [ost %pass / %d %flog %text "mars is weird sometimes"]
    ~
    --
  9. comboy revised this gist Dec 21, 2014. 1 changed file with 28 additions and 0 deletions.
    28 changes: 28 additions & 0 deletions 4.fib
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    :: display fib sequence up to arg with steps
    :: painfully suboptimal but that's irrelevant
    :: :fib 10
    !:
    |_ [hid=hide ~]
    ++ poke-fib-args
    |= [ost=bone you=ship upto=@ud *]
    :_ +>.$
    :- [ost %pass ~ %g %cide ~]
    :* [ost %give %nice ~]
    %+ turn (~(tap by sup.hid))
    |= [ost=bone *]
    =- [ost %give %rush %tang -]
    %- flop ^- (list tank) %- limo
    =+ a=1
    |-
    ?: (gth a upto) ~
    :_ $(a +(a))
    leaf/(scow %ud (fib a))
    ==
    ++ fib
    |= a=@ud
    |-
    ?: (lte a 2) 1
    (add $(a (sub a 1)) $(a (sub a 2)))
    ++ peer
    |=(* `+>)
    --
  10. comboy revised this gist Dec 21, 2014. 3 changed files with 0 additions and 0 deletions.
    File renamed without changes.
    File renamed without changes.
    File renamed without changes.
  11. comboy renamed this gist Dec 21, 2014. 1 changed file with 9 additions and 6 deletions.
    15 changes: 9 additions & 6 deletions gistfile1.txt → boom
    Original file line number Diff line number Diff line change
    @@ -1,19 +1,22 @@
    :: counts douwn and boom!
    !:
    |_ [hid=hide ~]
    ++ poke-foo-args
    ++ poke-boom-args
    |= [ost=bone you=ship *]
    :_ +>.$
    :- [ost %pass / %g %cide %$]
    :* [ost %give %nice ~]
    %+ turn (~(tap by sup.hid))
    |= [ost=bone *]
    =- [ost %give %rush %tang -]
    =+ a=0
    %- flop ^- (list tank) %- limo
    =+ a=10
    |-
    ?: =(a 10)
    ~[leaf/"BOOM! {(scow %ud a)}"]
    :_ $(a +(a))
    leaf/"bam #{(scow %ud a)}"
    ?: =(a 0)
    ~[leaf/"BOOM!!!"]
    :_ $(a (dec a))
    leaf/"{(trip ?:(=((mod a 2) 0) 'tick' 'tock'))} - {(scow %ud a)}"
    ==
    ++ peer
    |=(* `+>)
    --
  12. comboy revised this gist Dec 19, 2014. 1 changed file with 19 additions and 0 deletions.
    19 changes: 19 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    !:
    |_ [hid=hide ~]
    ++ poke-foo-args
    |= [ost=bone you=ship *]
    :_ +>.$
    :- [ost %pass / %g %cide %$]
    :* [ost %give %nice ~]
    %+ turn (~(tap by sup.hid))
    |= [ost=bone *]
    =- [ost %give %rush %tang -]
    =+ a=0
    |-
    ?: =(a 10)
    ~[leaf/"BOOM! {(scow %ud a)}"]
    :_ $(a +(a))
    leaf/"bam #{(scow %ud a)}"
    ==
    ++ peer
    |=(* `+>)
  13. comboy revised this gist Dec 18, 2014. 1 changed file with 17 additions and 0 deletions.
    17 changes: 17 additions & 0 deletions planet
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    :: display "hello $ARG!"
    :: :planet "foo"
    !:
    |_ [hid=hide ~]
    ++ poke-planet-args
    |= [ost=bone you=ship planet=tape *]
    :_ +>.$
    :- [ost %pass / %g %cide %$]
    :- [ost %give %nice ~]
    %+ turn (~(tap by sup.hid))
    |= [ost=bone *]
    =- [ost %give %rush %tang -]
    ~[leaf/"hello {planet}!"]
    ++ peer
    |=(* `+>)
    --
    ~
  14. comboy created this gist Dec 18, 2014.
    14 changes: 14 additions & 0 deletions mars
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    !:
    |_ [hid=hide ~]
    ++ poke-mars-args
    |= [ost=bone you=ship *]
    :_ +>.$
    :- [ost %pass / %g %cide %$]
    :- [ost %give %nice ~]
    %+ turn (~(tap by sup.hid))
    |= [ost=bone *]
    =- [ost %give %rush %tang -]
    ~[leaf/"hello mars!"]
    ++ peer
    |=(* `+>)
    --