diff --git a/arvo/test.hoon b/arvo/test.hoon index b81e36679..ab7bd592d 100644 --- a/arvo/test.hoon +++ b/arvo/test.hoon @@ -1,165 +1,24 @@ -!::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::: -:::::: :::::: Preface :::::: -:::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::: -?> ?=(@ .) :: atom subject -%. . :: fun with subject -|= cud=@ :: call it cud -=- (mul:all 2 cud) :: multiply by 2 -^= all :: assemble engine - =~ :: volume stack -%164 :: version constant -:::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::: -:::::: :::::: volume 0, version stub :::::: -:::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::: -~% %k.164 ~ ~ :: -|% :: -++ stub 164 :: version stub --- :: -:::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::: -:::::: :::::: volume 1, Hoon models :::::: -:::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::: -~% %mood - + - ~ -|% :: -++ axis ,@ :: tree address --- :: -:::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::: -:::::: :::::: volume 2, Hoon libraries and compiler :::::: -:::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::: -~% %hoon - + - == - %dec dec - == +?> ?=([@ @] .) +%. . +|= [x=@ y=@] +=- (add:all x y) +^= all +=> %164 +~% %k164 ~ ~ |% - ::::::::::::::::::::::::::::::::::::::::::::::::::::: :: -:::: chapter 2a, basic unsigned math :::: -:: :::::::::::::::::::::::::::::::::::::::::::::::::::::: -++ add :: add +++ add ~/ %add |= [a=@ b=@] ^- @ - ?: =(0 a) - b + ?: =(0 a) b $(a (dec a), b +(b)) :: -++ cap :: tree head - ~/ %cap - |= a=@ - ^- ?(%2 %3) - ?- a - %2 %2 - %3 %3 - ?(%0 %1) !! - * $(a (div a 2)) - == -:: -++ dec :: decrement +++ dec ~/ %dec |= a=@ ?< =(0 a) =+ b=0 |- ^- @ - ?: =(a +(b)) - b + ?: =(a +(b)) b $(b +(b)) -:: -++ div :: divide - ~/ %div - |= [a=@ b=@] - ^- @ - ?< =(0 b) - =+ c=0 - |- - ?: (lth a b) - c - $(a (sub a b), c +(c)) -:: -++ gte :: greater-equal - ~/ %gte - |= [a=@ b=@] - ^- ? - !(lth a b) -:: -++ gth :: greater-than - ~/ %gth - |= [a=@ b=@] - ^- ? - !(lte a b) -:: -++ lte :: less-equal - ~/ %lte - |= [a=@ b=@] - |(=(a b) (lth a b)) -:: -++ lth :: less-than - ~/ %lth - |= [a=@ b=@] - ^- ? - &(!=(a b) |-(|(=(0 a) &(!=(0 b) $(a (dec a), b (dec b)))))) -:: -++ mas :: tree body - ~/ %mas - |= a=@ - ^- @ - ?- a - 1 !! - 2 1 - 3 1 - * (add (mod a 2) (mul $(a (div a 2)) 2)) - == -:: -++ max :: maximum - ~/ %max - |= [a=@ b=@] - ^- @ - ?: (gth a b) - a - b -:: -++ min :: minimum - ~/ %min - |= [a=@ b=@] - ^- @ - ?: (lth a b) - a - b -:: -++ mod :: remainder - ~/ %mod - |= [a=@ b=@] - ^- @ - ?< =(0 b) - (sub a (mul b (div a b))) -:: -++ mul :: multiply - ~/ %mul - |= [a=@ b=@] - ^- @ - =+ c=0 - |- - ?: =(0 a) - c - $(a (dec a), c (add b c)) -:: -++ peg :: tree connect - ~/ %peg - |= [a=@ b=@] - ^- @ - ?- b - 1 a - 2 (mul a 2) - 3 +((mul a 2)) - * (add (mod b 2) (mul $(b (div b 2)) 2)) - == -:: -++ sub :: subtract - ~/ %sub - |= [a=@ b=@] - ^- @ - ?: =(0 b) - a - $(a (dec a), b (dec b)) -- -. == diff --git a/main/bin/easy0.hoon b/main/bin/easy0.hoon deleted file mode 100644 index ed7ef4cac..000000000 --- a/main/bin/easy0.hoon +++ /dev/null @@ -1,27 +0,0 @@ -!: -:: /=main=/bin/solid/hoon -:: -=> .(- `[who=@p how=path]`-) -|= [est=time eny=@uw] -|= arg=~ -=+ ^= cor - =< |= [x=@ y=@] - (add x y) - => %164 - |% - ++ add - |= [a=@ b=@] - ^- @ - ?: =(0 a) b - $(a (dec a), b +(b)) - :: - ++ dec - |= a=@ - ?< =(0 a) - =+ b=0 - |- ^- @ - ?: =(a +(b)) b - $(b +(b)) - -- -:_ ~ :_ ~ -[%xx %sage [%easy0 %pill ~] cor] diff --git a/main/bin/easy1.hoon b/main/bin/easy1.hoon deleted file mode 100644 index 3f08eb7b2..000000000 --- a/main/bin/easy1.hoon +++ /dev/null @@ -1,31 +0,0 @@ -!: -:: /=main=/bin/solid/hoon -:: -=> .(- `[who=@p how=path]`-) -|= [est=time eny=@uw] -|= arg=~ -=+ ^= cor - =< |= [x=@ y=@] - (add x y) - => %164 - ~% %k164 ~ ~ - |% - ++ add - ~/ %add - |= [a=@ b=@] - ^- @ - ?: =(0 a) b - $(a (dec a), b +(b)) - :: - ++ dec - ~/ %dec - |= a=@ - ~| %decrement-underflow - ?< =(0 a) - =+ b=0 - |- ^- @ - ?: =(a +(b)) b - $(b +(b)) - -- -:_ ~ :_ ~ -[%xx %sage [%easy1 %pill ~] cor]