Skip to content
This repository has been archived by the owner on Aug 14, 2019. It is now read-only.

Commit

Permalink
Merge pull request #1069 from urbit/next
Browse files Browse the repository at this point in the history
Merge next into master
  • Loading branch information
ixv authored Feb 14, 2019
2 parents 70c771f + 043b965 commit b50928a
Show file tree
Hide file tree
Showing 8 changed files with 312 additions and 92 deletions.
2 changes: 1 addition & 1 deletion .travis/pin-vere-commit.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
315634d99b0a0d7760267eacc0b32465e03ea981
2d571aa1681506e85aa66a3715d0f1bc0298aeba
10 changes: 0 additions & 10 deletions .travis/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,6 @@ function barMass(urb) {
}

Promise.resolve(urbit)
// XX temporary
// send ctrl-x to select dojo
//
.then(function(){
return urbit.expect(/talk\[\] /)
.then(function() {
return urbit.pty.write("\x18")
})
.then(function() { return urbit })
})
.then(actions.safeBoot)
.then(function(){
return barMass(urbit);
Expand Down
16 changes: 9 additions & 7 deletions lib/hood/drum.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@
^- part
:* %drum
%2
~ :: sys
(deft-fish our) :: eel
(deft-apes our) :: ray
~ :: fur
~ :: bin
== ::
sys=~
eel=(deft-fish our)
ray=(deft-apes our)
fur=~
bin=~
==
::
::
++ en-gill :: gill to wire
Expand Down Expand Up @@ -245,7 +245,9 @@
::
++ se-adit :: update servers
^+ .
%+ roll ~(tap in ray)
:: ensure dojo connects after talk
=* dojo-on-top aor
%+ roll (sort ~(tap in ray) dojo-on-top)
=< .(con +>)
|: $:{wel/well:gall con/_..se-adit} ^+ con
=. +>.$ con
Expand Down
150 changes: 150 additions & 0 deletions lib/number-to-words.hoon
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
:: |number-to-words: conversion of unsigned integers to a tape
::
:: returns a unit because not all numbers can always be represented
::
|%
++ numbers
|%
++ ten 10
++ one-hundred 100
++ one-thousand (pow 10 3)
++ one-million (pow 10 6)
++ one-billion (pow 10 9)
++ one-trillion (pow 10 12)
++ one-quadrillion (pow 10 15)
++ one-quintillion (pow 10 18)
++ one-sextillion (pow 10 21)
++ one-septillion (pow 10 24)
++ one-octillion (pow 10 27)
++ one-nonillion (pow 10 30)
++ one-decillion (pow 10 33)
++ one-undecillion (pow 10 36)
++ one-duodecillion (pow 10 39)
++ one-tredecillion (pow 10 42)
++ one-quattuordecillion (pow 10 45)
++ one-quindecillion (pow 10 48)
++ one-sexdecillion (pow 10 51)
++ one-septendecillion (pow 10 54)
++ one-octodecillion (pow 10 57)
++ one-novemdecillion (pow 10 60)
++ one-vigintillion (pow 10 63)
++ max (pow 10 66)
--
++ eng-us
|%
++ to-words
|= num=@u
^- (unit tape)
=+ numbers
?: (gte num max)
~
:- ~
|-
^- tape
:: 0-19
?: =(num 0) "zero"
?: =(num 1) "one"
?: =(num 2) "two"
?: =(num 3) "three"
?: =(num 4) "four"
?: =(num 5) "five"
?: =(num 6) "six"
?: =(num 7) "seven"
?: =(num 8) "eight"
?: =(num 9) "nine"
?: =(num 10) "ten"
?: =(num 11) "eleven"
?: =(num 12) "twelve"
?: =(num 13) "thirteen"
?: =(num 14) "fourteen"
?: =(num 15) "fifteen"
?: =(num 16) "sixteen"
?: =(num 17) "seventeen"
?: =(num 18) "eighteen"
?: =(num 19) "nineteen"
:: 20-99
::
:: tpl: tens place
:: rem: ones place
:: sfx: suffix
::
=/ tpl (div num ten)
=/ rem (mod num ten)
=/ sfx
?: |(=(rem 0) (gte tpl 10))
~
['-' $(num rem)]
?: =(tpl 2) (weld "twenty" sfx)
?: =(tpl 3) (weld "thirty" sfx)
?: =(tpl 4) (weld "forty" sfx)
?: =(tpl 5) (weld "fifty" sfx)
?: =(tpl 6) (weld "sixty" sfx)
?: =(tpl 7) (weld "seventy" sfx)
?: =(tpl 8) (weld "eighty" sfx)
?: =(tpl 9) (weld "ninety" sfx)
:: 100-max
::
:: num-break: repeated pattern from 100 on
::
=/ num-break
::
:: min: minimum to qualify for this break
:: str: english word for this break
::
|= [min=@u str=tape]
=/ rem (mod num min)
;: weld
^$(num (div num min))
[' ' str]
?: =(rem 0)
~
%+ weld
?:((lth rem one-hundred) " and " ", ")
^$(num rem)
==
::
?: (lth num one-thousand)
(num-break one-hundred "hundred")
?: (lth num one-million)
(num-break one-thousand "thousand")
?: (lth num one-billion)
(num-break one-million "million")
?: (lth num one-trillion)
(num-break one-billion "billion")
?: (lth num one-quadrillion)
(num-break one-trillion "trillion")
?: (lth num one-quintillion)
(num-break one-quadrillion "quadrillion")
?: (lth num one-sextillion)
(num-break one-quintillion "quintillion")
?: (lth num one-septillion)
(num-break one-sextillion "sextillion")
?: (lth num one-octillion)
(num-break one-septillion "septillion")
?: (lth num one-nonillion)
(num-break one-octillion "octillion")
?: (lth num one-decillion)
(num-break one-nonillion "nonillion")
?: (lth num one-undecillion)
(num-break one-decillion "decillion")
?: (lth num one-duodecillion)
(num-break one-undecillion "undecillion")
?: (lth num one-tredecillion)
(num-break one-duodecillion "duodecillion")
?: (lth num one-quattuordecillion)
(num-break one-tredecillion "tredecillion")
?: (lth num one-quindecillion)
(num-break one-quattuordecillion "quattuordecillion")
?: (lth num one-sexdecillion)
(num-break one-quindecillion "quindecillion")
?: (lth num one-septendecillion)
(num-break one-sexdecillion "sexdecillion")
?: (lth num one-octodecillion)
(num-break one-septendecillion "septendecillion")
?: (lth num one-novemdecillion)
(num-break one-octodecillion "octodecillion")
?: (lth num one-vigintillion)
(num-break one-novemdecillion "novemdecillion")
(num-break one-vigintillion "vigintillion")
--
--
18 changes: 13 additions & 5 deletions sys/arvo.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -770,11 +770,20 @@
=. q.q.ovo
:- %userspace
:- %|
:~ hoon+`pit
zuse+`bud
:: hoon-cache+`p.niz
:~ hoon+&+pit
zuse+&+bud
:+ %caches %|
%+ turn
%+ sort vanes
|=([a=[lab=@tas *] b=[lab=@tas *]] (aor lab.a lab.b))
|=([label=@tas =vane] [(cat 3 %vane- label) %& worm.vane])
q.q.ovo
dot+`.
:+ %vases %|
%+ turn
%+ sort vanes
|=([a=[lab=@tas *] b=[lab=@tas *]] (aor lab.a lab.b))
|=([label=@tas =vane] [(cat 3 %vane- label) %& vase.vane])
dot+&+.
==
[[~ ovo] +>.$]
:: add entropy
Expand Down Expand Up @@ -908,4 +917,3 @@
|= txt/@
q:(slap bud (ream txt))
--

26 changes: 23 additions & 3 deletions sys/vane/ames.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
=, ames
:: this number needs to be below 8
::
=+ protocol-version=0
=+ protocol-version=1
|%
+= move [p=duct q=(wind note:able gift:able)] :: local move
:: |pact: internal packet structures
Expand Down Expand Up @@ -1508,7 +1508,14 @@
[[%wine who " has sunk"]~ fox]
::
%vega
[~ fox]
:: re-initialize our cryptosuite B cores
::
=/ =wund
%+ turn
val.ton.fox
|= [=life =ring *]
[life ring (nol:nu:crub:crypto ring)]
[~ fox(val.ton wund)]
::
%wake
(~(wake am [our now fox ski]) hen)
Expand Down Expand Up @@ -1541,6 +1548,19 @@
++ wegh
^- mass
:+ %ames %|
:~ dot+&+fox
:~ :+ %town %|
=> ton.fox
:~ wund+&+val
deed+&+law
fast+&+seh
them+&+hoc
==
:+ %corn %|
=> zac.fox
:~ incoming+&+nys
complete+&+olz
neighbor+&+wab
==
dot+&+fox
==
--
Loading

0 comments on commit b50928a

Please sign in to comment.