on master help sign in
Merge branch 'master' of https://github.com/urbit/docs
2b5a5cfRobert
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
46 :_ shuffled
46 :_ shuffled
47 (snag 0 unshuffled)
47 (snag 0 unshuffled)
48 =^ index random (rads:random remaining)
48 =^ index random (rads:random remaining)
49− %^ $
49+ %= $
50− shuffled (snag index unshuffled)^shuffled
50+ shuffled (snag index unshuffled)^shuffled
51− remaining (dec remaining)
51+ remaining (dec remaining)
52− unshuffled (oust [index 1] unshuffled)
52+ unshuffled (oust [index 1] unshuffled)
53+ ==
53++ draw
54++ draw
54 |= [n=@ud d=deck]
55 |= [n=@ud d=deck]
55 ^- [hand=deck rest=deck]
56 ^- [hand=deck rest=deck]
@@ -136,10 +137,11 @@ The `?+` rune is the rune to switch against a value with a default. The default
136 :_ shuffled
137 :_ shuffled
137 (snag 0 unshuffled)
138 (snag 0 unshuffled)
138 =^ index random (rads:random remaining)
139 =^ index random (rads:random remaining)
139− %^ $
140+ %= $
140− shuffled (snag index unshuffled)^shuffled
141+ shuffled (snag index unshuffled)^shuffled
141− remaining (dec remaining)
142+ remaining (dec remaining)
142− unshuffled (oust [index 1] unshuffled)
143+ unshuffled (oust [index 1] unshuffled)
144+ ==
143```
145```
144
146
145Finally, 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`.
147Finally, 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.
376**Examples:**
376**Examples:**
377
377
378```
378```
379−~your-urbit:dojo> /+ react
379+~your-urbit:dojo> /+ number-to-words
380+```
380−~your-urbit:dojo> :: now we can use arms from lib/react.hoon
381+Now we can use arms from lib/number-to-words.hoon
381−~your-urbit:dojo> (react-vale:react %div)
382+```
383+~your-urbit:dojo> (to-words:eng-us:number-to-words 123.456)
382```
384```
383
385
384##### sur
386##### sur
@@ -390,7 +392,9 @@ with `/-`. Read / write.
390
392
391```
393```
392~your-urbit:dojo> /- sole
394~your-urbit:dojo> /- sole
395+```
393−~your-urbit:dojo> :: now we can use arms in sur/sole.hoon
396+Now we can use arms in sur/sole.hoon.
397+```
394~your-urbit:dojo> `sole-effect:sole`[%bel ~]
398~your-urbit:dojo> `sole-effect:sole`[%bel ~]
395```
399```
396
400
@@ -402,7 +406,6 @@ The current (128-bit `@da`) time. Read-only.
402
406
403```
407```
404~your-urbit:dojo> now
408~your-urbit:dojo> now
405−:: produces
406~2016.3.21..21.10.57..429a
409~2016.3.21..21.10.57..429a
407```
410```
408
411
@@ -414,7 +417,6 @@ The current urbit ship. Read-only.
414
417
415```
418```
416~your-urbit:dojo> our
419~your-urbit:dojo> our
417−:: produces
418~your-urbit
420~your-urbit
419```
421```
420
422
@@ -426,7 +428,6 @@ The current urbit ship. Read-only.
426
428
427```
429```
428~your-urbit:dojo> eny
430~your-urbit:dojo> eny
429−:: produces
430\/0vnt.d474o.gpahj.jcf3o.448fh.2lamb.82ljm.8ol8u.b02vi.mrvvp.b7et2.knb7m.l8he\/
431\/0vnt.d474o.gpahj.jcf3o.448fh.2lamb.82ljm.8ol8u.b02vi.mrvvp.b7et2.knb7m.l8he\/
431 8.8qb9s.drm36.77n9b.a0qst.30g03.l5lb5.nvsbc.v39tn
432 8.8qb9s.drm36.77n9b.a0qst.30g03.l5lb5.nvsbc.v39tn
432\/
433\/