shrub/main/bin/autobegin.hoon

128 lines
3.2 KiB
Plaintext
Raw Normal View History

2014-05-13 00:31:14 +04:00
::
:: /=main=/autobegin/hoon
::
=> .(-< `who=@p`-<)
=> .(+ =>(+ ^/===/lib/pony))
|= [est=time sen=@uw]
2014-05-13 00:31:14 +04:00
|= [cod=@t ~]
^- bowl
2014-05-13 00:31:14 +04:00
=+ jos=(rush cod apex:poja)
=< (boss jos)
|%
2014-05-13 00:31:14 +04:00
++ ot :: object type
|= o=(unit jval) ^- (map ,@t jval)
=+ p=(need o)
?+(-.p !! %o p.p)
++ st :: string type
|= v=(unit jval) ^- @t
=+ w=(need v)
?+(-.w !! %s p.w)
++ su :: string unit
|= v=(unit jval) ^- (unit ,@t)
?~ v
~
=+ r=(st v)
?~ r
~
`r
++ pi :: phonetic integer
|= v=(unit jval) ^- @p
=+ t=(fix (st v))
(need (slaw %p t))
++ fix :: correct format
|= t=@t ^- @t
?. =('~' (end 3 1 t))
(rap 3 ~['~' t])
t
++ boss
2014-05-13 07:45:30 +04:00
|= son=(unit jval) ^- bowl
=+ lav=(mule |.((dook son)))
?- -.lav
%.y p.lav
%.n ~[~[[%ho p.lav] [%xy /d `card`[%logo 111]]]]
==
++ dook
2014-05-13 00:31:14 +04:00
|= son=(unit jval) ^- bowl
=+ m=(ot son)
=+ teg=~(get by m)
=+ bud=~|(%bad-ship (pi (teg %ship)))
=+ tic=~|(%bad-ticket (pi (teg %ticket)))
2014-05-13 07:45:30 +04:00
=+ eny=~|(%bad-entropy (st (teg %entr)))
2014-05-13 00:31:14 +04:00
=+ ges=(form bud m)
=+ bos=(sein bud)
?> !=(bos bud)
?> !=(who bud)
(moss est bud tic (shax eny) ges)
++ form
|= [bud=@p m=(map ,@t jval)] ^- gens
~| %bad-form
=+ can=`@tas`(clan bud)
?> =(can %duke) :: XX support others
=+ teg=~(get by m)
=+ poe=(st (teg %pose))
=+ lag=(gins (st (teg %lang)))
=> .(poe (?(%lord %lady %punk %anon ~) poe))
?- poe
~
!!
%anon
`gens`[lag (gcos can `what`[%anon ~])]
?(%lord %lady)
`gens`[lag (gcos can (what poe (mane m)))]
%punk
`gens`[lag (gcos can (mana m))]
==
++ gins
|= l=@ta ^- lang
~| %bad-lang
?~((glon l) !! l)
++ mana
|= m=(map ,@t jval) ^- what
~| %bad-name
=+ teg=~(get by m)
=+ ban=((hard sect) (st (teg %bann)))
=+ nam=(st (teg %hand))
[%punk p=ban q=nam]
++ mane
|= m=(map ,@t jval) ^- whom
~| %bad-name
=+ teg=~(get by m)
=+ fir=(st (teg %fnam))
=+ mid=(su (teg %mnam))
=+ nik=(su (teg %nnam))
=+ las=(st (teg %lnam))
=+ ban=((hard sect) (st (teg %bann)))
=+ yer=(need (rush (st (teg %dobr)) dem))
=+ gov=`path`(need (rush (st (teg %loca)) moon))
(whom yer gov ban `name`[fir mid nik las])
++ moon
;~ pose
;~ plug (cook |=([a=@ b=@] (cat 3 a b)) ;~(plug low low))
;~ pfix fas
%+ cook
|=(a=tape (rap 3 ^-((list ,@) a)))
(star ;~(pose hig hep nud))
==
(easy ~)
==
==
++ moss
2014-05-13 00:31:14 +04:00
|= [now=@da bud=@p tic=@p tey=@ ges=gens]
^- bowl
=+ bur=(shax (mix (jam ges) tey))
=+ loy=(bruw 2.048 bur)
2014-05-13 00:31:14 +04:00
%- (post (sein bud) %ta [bud tic ges pub:ex:loy])
|= [now=@da rup=(unit ,*)]
:_ ~
2014-05-13 07:45:30 +04:00
?~ rup ~[[la/leaf/"request rejected"] [%xy /d `card`[%logo 111]]]
=+ mac=`mace`[[0 sec:ex:loy] ~]
=+ wil=((hard (unit will)) u.rup)
?~ wil
:~ [%la %leaf "request rejected - invalid ticket"]
2014-05-13 07:45:30 +04:00
[%xy /d `card`[%logo 111]]
==
:~ [%la %leaf "request approved"]
[%xy /a `card`[%cash bud mac u.wil]]
==
--