Skip to content

Instantly share code, notes, and snippets.

That's all for our `poke-noun` arm. But what about when the timer goes off? Behn will create a `gift` a similar construct to how we created an `effect`, only this time it will end up being dispatched back to us by Gall in the `++wake` arm. Gall looks for an arm named `++wake` when a timer goes off; it is defined this way in the vane's code. Gall will actually check for an arm that also contains the wire name, but this will be covered in a later document. So any app that wants to use a timer trigger needs to have an arm called `++wake`.
!:
|%
+$ suit ?(%hearts %spades %clubs %diamonds)
+$ darc [sut=suit val=@ud]
+$ deck (list darc)
++ make-deck
^- deck
=| mydeck=deck
=/ i 1
|-
/+ playing-cards
:- %say
|= [[* eny=@uv *] *]
:- %noun
(shuffle-deck:playing-cards make-deck:playing-cards eny)
!:
|%
+$ suit ?(%hearts %spades %clubs %diamonds)
+$ darc [sut=suit val=@ud]
+$ deck (list darc)
++ make-deck
^- deck
=| mydeck=deck
=/ i 1
|-
@baudtack
baudtack / playing-cards.hoon
Created May 29, 2019 18:47
updated playing cards
!:
|%
+$ suit ?(%hearts %spades %clubs %diamonds)
+$ darc [sut=suit val=@ud]
+$ deck (list darc)
++ make-deck
^- deck
=| mydeck=deck
=/ i 1
|-
!:
:- %say
|= [* [n=@ud ~] ~]
:- %noun
=| lis=(list @ud)
|-
^- (list @ud)
?: (lte n 0)
lis
%= $
!:
:- %say
|= [* [n=@ud ~] ~]
:- %noun
^- (list @ud)
=+ l=(list @ud)
|-
?: (gth n 0)
=/ d (mod n 10)
%= $
### Keybase proof
I hereby claim:
* I am baudtack on github.
* I am baudtack (https://keybase.io/baudtack) on keybase.
* I have a public key whose fingerprint is ED3F 686A 6C41 2920 7FE5 FA9E E18A 6B54 B44A 26CE
To claim this, I am signing this object: