shrub/main/app/begin/core.hook

445 lines
13 KiB
Plaintext
Raw Normal View History

2014-10-30 02:07:13 +03:00
|%
++ sign
$% $: %g
$% [%init p=@p]
[%nice ~]
2014-10-30 02:07:13 +03:00
[%mean p=ares]
2014-11-01 03:53:11 +03:00
[%rush %txt p=cord]
2014-10-30 02:07:13 +03:00
== == ==
2014-11-01 03:53:11 +03:00
++ form ,[his=@p tic=@p eny=@t ges=gens]
++ state
$? %begin %his %tic %eny %lag
%name %form %psect %pname %year
%govt %sect %fname %mname %nname
%lname %done
==
2014-11-19 23:46:35 +03:00
++ tepe ,[(unit ,[cord prom cord]) (list cord)]
2014-10-30 02:07:13 +03:00
--
::
!:
2014-11-01 03:53:11 +03:00
|_ [hid=hide sat=state form]
++ done
|= ost=bone
:_ +>.$
2014-11-19 03:25:11 +03:00
:* :* ost %pass /to-gan %g %mess [our.hid /began] our.hid
2014-11-01 03:53:11 +03:00
%began-args !>([his tic eny ges])
==
2014-11-19 04:17:11 +03:00
(spam %rush %prompt "[waiting...]" %text '')
2014-11-01 03:53:11 +03:00
==
::
++ loon
%+ cook
|= all=(list ,@t)
|- ^- @t
?~ all %$
?~ t.all i.all
(cat 3 i.all (cat 3 ' ' $(all t.all)))
(most ace (cook |=(a=(list ,@) (rap 3 a)) (plus prn)))
::
++ next
|= txt=cord
2014-11-19 23:46:35 +03:00
^- [tepe _+>.$]
2014-11-01 03:53:11 +03:00
?- sat
2014-11-05 22:39:00 +03:00
%begin
:_ +>.$(sat %his)
2014-11-19 23:46:35 +03:00
:- `['Your ship: ~' %text '']
2014-11-05 22:39:00 +03:00
%- lore %- crip
"""
Do you have a ship and a ticket? If not, please ask
urbit@urbit.org for one.
"""
2014-11-01 03:53:11 +03:00
%his
2014-11-19 23:46:35 +03:00
=+ a=(rush txt fed:ag)
?~ a [[~ 'invalid input' ~] +>.$]
=> .(-.q.ges (clan u.a))
2014-11-01 03:53:11 +03:00
=+ ^= cow
|- ^- @ud
?- -.q.ges
%czar 256
%king (mul 255 $(-.q.ges %czar))
%duke (mul 65.535 $(-.q.ges %king))
%earl (mul (dec (bex 32)) $(-.q.ges %duke))
%pawn (sub (bex 128) $(-.q.ges %earl))
==
=+ ^= ves ^- tape
?- -.q.ges
%czar "carriers"
%king "cruisers"
%duke "destroyers"
%earl "yachts"
%pawn "submarines"
==
2014-11-19 23:46:35 +03:00
:_ ^+ +>.$ +>.$(his u.a, sat %tic)
:- `['Your ticket: ~' %text '']
2014-11-01 03:53:11 +03:00
%- lore %- crip
"""
2014-11-19 23:46:35 +03:00
Launching {(scow %p u.a)}, one of {<cow>} Urbit {ves}...
2014-11-01 03:53:11 +03:00
If I did not build for myself
for whom should I build?
-- Bunting, _Chomei at Toyama_
Let's configure your identity. Warning - it's nontrivial to
change this data once you've sent it to the server. If you enter
something wrong, hit ^D to cancel, then run the program again.
"""
::
%tic
2014-11-19 23:46:35 +03:00
=+ a=(rush txt fed:ag)
?~ a [[~ 'invalid input' ~] +>.$]
:_ +>.$(tic u.a, sat %eny)
:- `['Entropy: ' %pass '']
2014-11-01 03:53:11 +03:00
%- lore %- crip
"""
Enter a passphrase or other unusual text. You (or your enemies)
can regenerate your ship from this entropy.
"""
::
%eny
2014-11-19 23:46:35 +03:00
=+ a=(rush txt (boss 256 (more gon qit)))
?~ a [[~ 'invalid input' ~] +>.$]
2014-11-21 01:47:14 +03:00
=. u.a (shax u.a)
2014-11-19 23:46:35 +03:00
:_ +>.$(eny u.a, sat %lag)
:- `['Language: ' %text 'en']
2014-11-01 03:53:11 +03:00
%- lore %- crip
"""
2014-11-21 01:47:14 +03:00
Entropy check: {<`@p`(mug u.a)>}
2014-11-01 03:53:11 +03:00
What language would your ship rather speak? Enter it as a
two-letter (ISO 639-1) code, like "en" for English. Whatever
language you pick, it'll all be English now, but in future
we'll be more sensitive to your needs.
"""
::
%lag
=+ ^= par
%+ sear
|= [a=@ b=@]
^- (unit ,@ta)
=+ c=(cat 3 a b)
=+(d=(glon c) ?~(d ~ [~ c]))
;~(plug low low)
2014-11-19 23:46:35 +03:00
=+ a=(rush txt par)
?~ a [[~ 'invalid input' ~] +>.$]
2014-11-01 03:53:11 +03:00
?. ?=(%duke -.q.ges)
2014-11-19 23:46:35 +03:00
:_ +>.$(p.ges u.a, sat %name)
[`['Name: ' %text ''] ~]
:_ +>.$(p.ges u.a, sat %form)
:- `['Form: %' %text 'lady']
2014-11-01 03:53:11 +03:00
%- lore %- crip
"""
Please select one of the pre-chosen forms:
%lady female-identified individual
%lord male-identified individual
%punk opaque handle
%anon totally anonymous
"""
::
%name
?> ?=(?(%earl %king) -.q.ges)
2014-11-19 23:46:35 +03:00
=+ a=(rush txt (boss 256 (more gon qit)))
?~ a [[~ 'invalid input' ~] +>.$]
=+ gos=?-(-.q.ges %earl [%earl u.a], %king [%king u.a])
2014-11-01 03:53:11 +03:00
:_ +>.$(q.ges gos, sat %done)
2014-11-19 23:46:35 +03:00
[`['' %text ''] ~]
2014-11-01 03:53:11 +03:00
::
%form
=+ ^= par
;~ pose
(jest %anon)
(jest %lady)
(jest %lord)
(jest %punk)
==
2014-11-19 23:46:35 +03:00
=+ a=(rush txt par)
?~ a [[~ 'invalid input' ~] +>.$]
?+ u.a !!
%anon [[`['' %text ''] ~] +>.$(q.ges [%duke %anon ~], sat %done)]
2014-11-01 03:53:11 +03:00
%punk
:_ +>.$(q.ges [%duke %punk *sect ''], sat %pname)
2014-11-19 23:46:35 +03:00
[`['Handle: ' %text ''] ~]
2014-11-01 03:53:11 +03:00
?(%lady %lord)
2014-11-19 23:46:35 +03:00
=+ wat=?-(u.a %lady [%lady *whom], %lord [%lord *whom])
2014-11-01 03:53:11 +03:00
:_ +>.$(q.ges `gcos`[%duke wat], sat %year)
2014-11-19 23:46:35 +03:00
:- `['Year you were born: ' %text '19']
2014-11-01 03:53:11 +03:00
%- lore %- crip
"""
You've selected a personal identity. For a %lord or a %lady,
please use your real name only. If you'd prefer a fictitious
handle, you can hit ^D and start over as a %punk. Or you can
use %anon and go by your ship name alone.
As a real person, we're going to ask you for a little bit of
personal information - not enough to compromise your privacy,
just enough to make everyone on Urbit feel like a neighbor.
What we're going to ask you for is information that's (a)
public (would be obvious, or at least easy to guess, for
someone who met you in person); (b) durable (doesn't change
often); and (c) relevant (helps you connect with friends).
For example, we'll ask for the year (not day) you were born,
because your age is easy to guess in person, doesn't change,
and has a big effect on how people perceive you.
"""
==
::
%pname
2014-11-19 23:46:35 +03:00
=+ a=(rush txt loon)
?~ a [[~ 'invalid input' ~] +>.$]
:_ +>.$(q.ges [%duke %punk *sect u.a], sat %psect)
:- `['Banner: %' %text 'white']
2014-11-01 03:53:11 +03:00
%- lore %- crip
"""
One basic human instinct is the urge to form political tribes.
In a network that fights this need, these tribes form anyway and
they form badly. Urbit designs them into the infrastructure.
Inspired by the Qing Dynasty, you'll align yourself with one of
five colored "banners" - %red, %blue, %orange, %black or %white.
Political discourse across tribal boundaries is almost always an
antisocial act - less communication, than symbolic violence. In
Urbit, messages marked political stay within your own banner;
your friends in other banners simply won't see them. Between
banners, politics doesn't erode apolitical relationships; inside
each banner, political discourse is harmonious and productive.
Pick a banner by the adjective you feel best describes you:
%red far left: radical, anarchist
%blue center-left: moderate, liberal
%orange center-right: conservative, libertarian
%black far right: traditionalist, reactionary
Or if digital agitation isn't your cup of tea, choose %white, and
your Urbit experience will remain politics-free.
"""
::
%psect
?> ?=(%duke -.q.ges)
?> ?=(%punk -.p.q.ges)
=+ ^= par
;~ pose
(jest %white)
(jest %blue)
(jest %red)
(jest %black)
(jest %orange)
==
2014-11-19 23:46:35 +03:00
=+ a=(rush txt par)
?~ a [[~ 'invalid input' ~] +>.$]
:- [`['' %text ''] ~]
2014-11-01 03:53:11 +03:00
%= +>.$
2014-11-19 23:46:35 +03:00
q.ges [%duke %punk ((hard sect) u.a) q.p.q.ges]
2014-11-01 03:53:11 +03:00
sat %done
==
::
%year
?> ?=(%duke -.q.ges)
?> ?=(?(%lord %lady) -.p.q.ges)
2014-11-19 23:46:35 +03:00
=+ a=(rush txt dim:ag)
?~ a [[~ 'invalid input' ~] +>.$]
=+ woh=`whom`[u.a *govt *sect *name]
2014-11-01 03:53:11 +03:00
=+ wat=`what`?-(-.p.q.ges %lord [%lord woh], %lady [%lady woh])
:_ +>.$(q.ges [%duke wat], sat %govt)
2014-11-19 23:46:35 +03:00
:- `['Location ' %text 'us/94103']
2014-11-01 03:53:11 +03:00
%- lore %- crip
"""
Where are you? This is totally optional, but we'd like to
know your vague general location. You can enter nothing at
all, just a country code, or country and postal code.
"""
::
%govt
?> ?=(%duke -.q.ges)
?> ?=(?(%lord %lady) -.p.q.ges)
=+ ^= par
;~ 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 ~)
==
==
2014-11-19 23:46:35 +03:00
=+ a=(rush txt par)
?~ a [[~ 'invalid input' ~] +>.$]
=+ woh=`whom`[p.p.p.q.ges u.a *sect *name]
2014-11-01 03:53:11 +03:00
=+ wat=`what`?-(-.p.q.ges %lord [%lord woh], %lady [%lady woh])
:_ +>.$(q.ges [%duke wat], sat %sect)
2014-11-19 23:46:35 +03:00
:- `['Banner: %' %text 'white']
2014-11-01 03:53:11 +03:00
%- lore %- crip
"""
One basic human instinct is the urge to form political tribes.
In a network that fights this need, these tribes form anyway and
they form badly. Urbit designs them into the infrastructure.
Inspired by the Qing Dynasty, you'll align yourself with one of
five colored "banners" - %red, %blue, %orange, %black or %white.
Political discourse across tribal boundaries is almost always an
antisocial act - less communication, than symbolic violence. In
Urbit, messages marked political stay within your own banner;
your friends in other banners simply won't see them. Between
banners, politics doesn't erode apolitical relationships; inside
each banner, political discourse is harmonious and productive.
Pick a banner by the adjective you feel best describes you:
%red far left: radical, anarchist
%blue center-left: moderate, liberal
%orange center-right: conservative, libertarian
%black far right: traditionalist, reactionary
Or if digital agitation isn't your cup of tea, choose %white, and
your Urbit experience will remain politics-free.
"""
::
%sect
?> ?=(%duke -.q.ges)
?> ?=(?(%lord %lady) -.p.q.ges)
=+ ^= par
;~ pose
(jest %white)
(jest %blue)
(jest %red)
(jest %black)
(jest %orange)
==
2014-11-19 23:46:35 +03:00
=+ a=(rush txt par)
?~ a [[~ 'invalid input' ~] +>.$]
=+ woh=`whom`[p.p.p.q.ges q.p.p.q.ges (sect u.a) *name]
2014-11-01 03:53:11 +03:00
=+ wat=`what`?-(-.p.q.ges %lord [%lord woh], %lady [%lady woh])
:_ +>.$(q.ges [%duke wat], sat %fname)
2014-11-19 23:46:35 +03:00
[`['First name: ' %text ''] ~]
2014-11-01 03:53:11 +03:00
::
%fname
?> ?=(%duke -.q.ges)
?> ?=(?(%lord %lady) -.p.q.ges)
2014-11-19 23:46:35 +03:00
=+ a=(rush txt loon)
?~ a [[~ 'invalid input' ~] +>.$]
=+ nam=[u.a *(unit ,@t) *(unit ,@t) *@t]
2014-11-01 03:53:11 +03:00
=+ woh=`whom`[p.p.p.q.ges q.p.p.q.ges r.p.p.q.ges nam]
=+ wat=`what`?-(-.p.q.ges %lord [%lord woh], %lady [%lady woh])
:_ +>.$(q.ges [%duke wat], sat %mname)
2014-11-19 23:46:35 +03:00
[`['Middle name (or blank): ' %text ''] ~]
2014-11-01 03:53:11 +03:00
::
%mname
?> ?=(%duke -.q.ges)
?> ?=(?(%lord %lady) -.p.q.ges)
2014-11-19 23:46:35 +03:00
=+ a=(rush txt ;~(pose (stag ~ loon) (easy ~)))
?~ a [[~ 'invalid input' ~] +>.$]
=+ nam=[p.s.p.p.q.ges u.a *(unit ,@t) *@t]
2014-11-01 03:53:11 +03:00
=+ woh=`whom`[p.p.p.q.ges q.p.p.q.ges r.p.p.q.ges nam]
=+ wat=`what`?-(-.p.q.ges %lord [%lord woh], %lady [%lady woh])
:_ +>.$(q.ges [%duke wat], sat %nname)
2014-11-19 23:46:35 +03:00
[`['Nickname/handle (or blank): ' %text ''] ~]
2014-11-01 03:53:11 +03:00
::
%nname
?> ?=(%duke -.q.ges)
?> ?=(?(%lord %lady) -.p.q.ges)
2014-11-19 23:46:35 +03:00
=+ a=(rush txt ;~(pose (stag ~ loon) (easy ~)))
?~ a [[~ 'invalid input' ~] +>.$]
=+ nam=[p.s.p.p.q.ges q.s.p.p.q.ges u.a *@t]
2014-11-01 03:53:11 +03:00
=+ woh=`whom`[p.p.p.q.ges q.p.p.q.ges r.p.p.q.ges nam]
=+ wat=`what`?-(-.p.q.ges %lord [%lord woh], %lady [%lady woh])
:_ +>.$(q.ges [%duke wat], sat %lname)
2014-11-19 23:46:35 +03:00
[`['Last name: ' %text ''] ~]
2014-11-01 03:53:11 +03:00
::
%lname
?> ?=(%duke -.q.ges)
?> ?=(?(%lord %lady) -.p.q.ges)
2014-11-19 23:46:35 +03:00
=+ a=(rush txt loon)
?~ a [[~ 'invalid input' ~] +>.$]
=+ nam=[p.s.p.p.q.ges q.s.p.p.q.ges r.s.p.p.q.ges u.a]
2014-11-01 03:53:11 +03:00
=+ woh=`whom`[p.p.p.q.ges q.p.p.q.ges r.p.p.q.ges nam]
=+ wat=`what`?-(-.p.q.ges %lord [%lord woh], %lady [%lady woh])
:_ +>.$(q.ges [%duke wat], sat %done)
2014-11-19 23:46:35 +03:00
[`['' %text ''] ~]
2014-11-01 03:53:11 +03:00
::
2014-11-25 00:15:04 +03:00
%done !! :: can't actually complete event because vere commits suicide
::[[`['[waiting...]' %text ''] ~] +>.$]
2014-11-01 03:53:11 +03:00
==
::
2014-10-30 02:07:13 +03:00
++ poke-begin-args
2014-11-24 22:53:31 +03:00
|= [ost=bone you=ship arg=?(~ [his=ship ~])]
=+ sot=?~(arg %begin %his)
2014-11-06 01:40:18 +03:00
=^ res +>.$
2014-11-19 23:46:35 +03:00
^- [[pot=(unit ,[cord prom cord]) tak=(list cord)] _+>.$]
2014-11-24 22:53:31 +03:00
?~ arg
(next(sat %begin) '')
(next(sat %his) (rsh 3 1 (scot %p his.arg)))
2014-10-30 02:07:13 +03:00
:_ +>.$
2014-11-01 03:53:11 +03:00
%+ welp
:~ [ost %pass /in %g %show [our.hid +.imp.hid] you /in/[-.imp.hid]]
[ost %give %nice ~]
==
%+ welp
2014-11-19 23:46:35 +03:00
?~(pot.res ~ (spam %rush %prompt u.pot.res))
2014-11-01 03:53:11 +03:00
%- zing
2014-11-05 22:39:00 +03:00
(turn (flop tak.res) |=(a=cord (spam %rush %txt a)))
2014-10-30 02:07:13 +03:00
::
++ pour
|= [ost=bone pax=path sih=*]
=+ sih=((hard sign) sih)
?: ?=(%init +<.sih)
[[ost %give +.sih]~ +>.$]
2014-11-01 03:53:11 +03:00
?: ?=([%in ~] pax)
?. ?=(%rush +<.sih) `+>.$
2014-11-06 01:40:18 +03:00
=^ res +>.$
2014-11-19 23:46:35 +03:00
^- [[pot=(unit ,[cord prom cord]) tak=(list cord)] _+>.$]
2014-11-06 01:40:18 +03:00
(next p.sih)
2014-11-01 03:53:11 +03:00
?: ?=(%done sat)
(done ost)
:_ +>.$
2014-11-19 23:46:35 +03:00
%+ welp
?~(pot.res ~ (spam %rush %prompt u.pot.res))
2014-11-01 03:53:11 +03:00
%- zing
2014-11-05 22:39:00 +03:00
(turn (flop tak.res) |=(a=cord (spam %rush %txt a)))
2014-11-21 05:17:05 +03:00
:_ +>.$
:- [ost %give +.sih]
?+ +<.sih ~
%nice
%+ turn (~(tap by sup.hid))
|= [ost=bone *]
:^ ost %give %rush
:- %tang :_ ~
[%leaf "begin successful"]
%mean
%+ turn (~(tap by sup.hid))
|= [ost=bone *]
:^ ost %give %rush
:- %tang :_ ~
[%leaf "begin failed"]
==
2014-10-30 02:07:13 +03:00
++ peer
|=
*
`+>
2014-11-01 03:53:11 +03:00
::
++ spam
|* git=*
%+ turn
(~(tap in (~(get ju pus.hid) /out)))
|=(a=bone [a %give git])
2014-10-30 02:07:13 +03:00
--