on master help sign in
Merge branch 'master' of https://github.com/urbit/docs
commit2b5a5cf06d930ab1ceac7f59799cdaf421bf5a3e authorRobert <robert@tlon.io> dateMon 15 Jul 2019, 11:36 (7 years ago) parent0c3bdb0a4fefda
2 files changed+18−15
learn/hoon/hoon-tutorial/libraries.md+10−8 using/shell.md+8−7
learn/hoon/hoon-tutorial/libraries.md+10−8
@@ -46,10 +46,11 @@ In Hoon, like in other languages, it's often useful to create a library for othe
4646 :_ shuffled
4747 (snag 0 unshuffled)
4848 =^ index random (rads:random remaining)
49− %^ $
50− shuffled (snag index unshuffled)^shuffled
51− remaining (dec remaining)
52− unshuffled (oust [index 1] unshuffled)
49+ %= $
50+ shuffled (snag index unshuffled)^shuffled
51+ remaining (dec remaining)
52+ unshuffled (oust [index 1] unshuffled)
53+ ==
5354++ draw
5455 |= [n=@ud d=deck]
5556 ^- [hand=deck rest=deck]
@@ -136,10 +137,11 @@ The `?+` rune is the rune to switch against a value with a default. The default
136137 :_ shuffled
137138 (snag 0 unshuffled)
138139 =^ index random (rads:random remaining)
139− %^ $
140− shuffled (snag index unshuffled)^shuffled
141− remaining (dec remaining)
142− unshuffled (oust [index 1] unshuffled)
140+ %= $
141+ shuffled (snag index unshuffled)^shuffled
142+ remaining (dec remaining)
143+ unshuffled (oust [index 1] unshuffled)
144+ ==
143145```
144146
145147Finally, in the code above, we come to `shuffle-deck`. This gate takes two arguments: a `deck`, and a `@` as a bit of `entropy` to seed the `og` core. It's going to produce a `deck`.
using/shell.md+8−7
@@ -376,9 +376,11 @@ with `/+`. Read / write.
376376**Examples:**
377377
378378```
379−~your-urbit:dojo> /+ react
380−~your-urbit:dojo> :: now we can use arms from lib/react.hoon
381−~your-urbit:dojo> (react-vale:react %div)
379+~your-urbit:dojo> /+ number-to-words
380+```
381+Now we can use arms from lib/number-to-words.hoon
382+```
383+~your-urbit:dojo> (to-words:eng-us:number-to-words 123.456)
382384```
383385
384386##### sur
@@ -390,7 +392,9 @@ with `/-`. Read / write.
390392
391393```
392394~your-urbit:dojo> /- sole
393−~your-urbit:dojo> :: now we can use arms in sur/sole.hoon
395+```
396+Now we can use arms in sur/sole.hoon.
397+```
394398~your-urbit:dojo> `sole-effect:sole`[%bel ~]
395399```
396400
@@ -402,7 +406,6 @@ The current (128-bit `@da`) time. Read-only.
402406
403407```
404408~your-urbit:dojo> now
405−:: produces
406409~2016.3.21..21.10.57..429a
407410```
408411
@@ -414,7 +417,6 @@ The current urbit ship. Read-only.
414417
415418```
416419~your-urbit:dojo> our
417−:: produces
418420~your-urbit
419421```
420422
@@ -426,7 +428,6 @@ The current urbit ship. Read-only.
426428
427429```
428430~your-urbit:dojo> eny
429−:: produces
430431\/0vnt.d474o.gpahj.jcf3o.448fh.2lamb.82ljm.8ol8u.b02vi.mrvvp.b7et2.knb7m.l8he\/
431432 8.8qb9s.drm36.77n9b.a0qst.30g03.l5lb5.nvsbc.v39tn
432433\/