Merge branch 'demo' of https://github.com/urbit/urbit into demo

This commit is contained in:
Anton Dyudin 2015-06-04 16:37:01 -07:00
commit 3ce58169c9
15 changed files with 107 additions and 134 deletions

View File

@ -46,11 +46,11 @@ $: cred=(unit ,[app-secret=@t client-id=@t])
++ redirect-uri [hostname `/~~/home/pub/bit/fab ~]
++ hostname ^- hart
?+ (clan our.hid) !!
%czar [| ?+(our.hid !! %~zod `8.443, %~fyr `8.444) `/localhost]
%czar [| ?+(our.hid `8.443 %~fyr `8.444) `/localhost]
%duke [| ~ `/org/urbit/(crip +:<our.hid>)]
==
++ auth-url
%+ weld "https://www.coinbase.com/oauth/authorize"
%+ weld "https://sandbox.coinbase.com/oauth/authorize"
%- tail:earn :~
'response_type'^%code
'client_id'^client-id:(need cred.vat)

View File

@ -231,8 +231,8 @@
;~(pfix lus (stag %ge dp-model-cat))
;~(pfix wut (stag %di dp-model-dog))
;~(pfix buc (stag %va sym))
(stag %ex dp-twig)
;~(pfix pam (stag %ec ;~(plug sym ;~(pfix dot dp-twig))))
(stag %ex dp-twig)
(ifix [sel ser] (stag %tu (most ace dp-source)))
==
::

View File

@ -77,7 +77,7 @@
++ sawn (hail(eye (~(del by eye) ost)) |) :: console unsubscribe
++ seen (hail(eye (~(put by eye) ost *sole-share)) &) :: console subscribe
++ show prom:(fect %mor rend) :: update console
++ soul =(%sole -:q:(~(got by sup) ost)) :: is console
++ soul =+((~(get by sup) ost) ?=([~ * %sole *] -)) :: is console
++ tame (flap |=(_. (fact:+< &/gam)) |=(_. prom:+<)) :: light update
++ wild (flap |=(_. (fact:+< &/gam)) |=(_. show:+<)) :: full update
++ word |= txt=tape %+ flap :: game message

View File

@ -94,7 +94,7 @@
++ seen (hail(eye (~(put by eye) ost *sole-share)) &) :: console subscribe
++ send |=(point (dish poke/(like %oct4-move +<))) :: send move
++ show prom:(fect %mor rend) :: update console
++ soul =(%sole -:q:(~(got by sup) ost)) :: is console
++ soul =+((~(get by sup) ost) ?=([~ * %sole *] -)) :: is console
++ stat (weld ?~(rem ~ "@{(scow p/u.rem)}") voy:here) :: prompt line
++ stop ?~(rem done wild:(dish pull/(like ~))) :: unsubscribe
++ tame (flap |=(_. (fact:+< &/gam)) |=(_. prom:+<)) :: light update

View File

@ -1043,6 +1043,7 @@
::
++ ra-coup-repeat ::
|= [[num=@ud her=@p man=span] saw=(unit tang)]
~& [%ra-coup-repeat +<]
(ra-repeat num [%& her man] saw)
::
++ ra-repeat :: remove from outbox
@ -1662,7 +1663,7 @@
++ poke-talk-command :: accept command
|= [cod=command]
^- [(list move) _+>]
:: ~& [%talk-poke-command src.hid cod]
~& [%talk-poke-command src.hid cod]
ra-abet:(~(ra-apply ra ost.hid ~) src.hid cod)
::
++ poke-sole-action :: accept console
@ -1676,6 +1677,7 @@
::
++ coup-repeat ::
|= [way=wire saw=(unit tang)]
~& [%coup-repeat way saw]
%+ etch-repeat [%repeat way] |= [num=@ud src=@p man=span]
ra-abet:(~(ra-coup-repeat ra ost.hid ~) [num src man] saw)
::

View File

@ -1399,7 +1399,7 @@
==
==
+>.$
(wool [/a hen] /q/pi ~ |)
(wool [/a/ping hen] /q/pi ~ |)
::
++ thaw :: thaw:ho:um:am
^+ . :: wakeup bomb

View File

@ -780,7 +780,7 @@
==
==
::
++ root-beak `beak`[our %home da/now] :: XX
++ root-beak `beak`[our %demo da/now] :: XX
++ emule
|= a=_|?(..emule) ^+ ..emule
=+ mul=(mule a)

View File

@ -66,7 +66,7 @@
tyc=stic :: statistics
ged=gest :: subscribers
hav=vase :: running state
pup=scup :: update control
byk=beak :: update control
zam=scar :: opaque ducts
== ::
++ sofa :: queue for blocked
@ -115,7 +115,7 @@
::
++ mo-conf :: configure
|= [dap=dude lum=culm]
(mo-boot dap ?:((~(has by bum) dap) %old %new) p.lum)
(mo-boot dap ?:((~(has by bum) dap) %old %new) p.p.lum q.p.lum da/now)
::
++ mo-pass :: standard pass
|= [pax=path noh=note-arvo]
@ -133,20 +133,20 @@
(~(nest ut p.u.bol) %| -:!>(*bowl))
::
++ mo-boom :: complete new boot
|= [dap=dude pup=scup dep=@uvH gux=gage]
|= [dap=dude byk=beak dep=@uvH gux=gage]
^+ +>
?- -.gux
%tabl ~|(%made-tabl !!)
%|
=. +> (mo-bold pup dap dep)
=. +> (mo-bold byk dap dep)
=. +> (mo-give %onto %| p.gux)
+>
%&
?> ?=(@ p.p.gux)
?. (mo-okay q.p.gux)
(mo-give %onto %| [%leaf "{<dap>}: bogus core"]~)
=. +> (mo-bold pup dap dep)
=. +> (mo-born dap pup q.p.gux)
=. +> (mo-bold byk dap dep)
=. +> (mo-born dap byk q.p.gux)
=+ old=+>.$
=+ wag=(ap-prop:(ap-abed:ap dap [%high [~ our]]) ~)
?^ -.wag
@ -157,14 +157,14 @@
==
::
++ mo-born :: new seat
|= [dap=dude pup=scup hav=vase]
|= [dap=dude byk=beak hav=vase]
=+ sat=*seat
%_ +>.$
bum
%+ ~(put by bum) dap
%_ sat
mom hen
pup pup
byk byk
hav hav
p.zam 1
q.zam [[[~ ~] 0] ~ ~]
@ -173,12 +173,12 @@
==
::
++ mo-boon :: complete old boot
|= [dap=dude pup=scup dep=@uvH gux=gage]
|= [dap=dude byk=beak dep=@uvH gux=gage]
^+ +>
?. (~(has by bum) dap)
~& [%gall-old-boon dap]
+>
=. +> (mo-bold pup dap dep)
=. +> (mo-bold byk dap dep)
?- -.gux
%tabl ~|(%made-tabl !!)
%| (mo-give %onto %| p.gux)
@ -187,19 +187,18 @@
==
::
++ mo-bold :: wait for dep
|= [pup=scup dap=dude dep=@uvH]
|= [byk=beak dap=dude dep=@uvH]
^+ +>
%+ mo-pass [%sys %dep (scot %p p.pup) q.pup dap ~]
%+ mo-pass [%sys %dep (scot %p p.byk) q.byk dap ~]
[%f %wasp our dep]
::
++ mo-boot :: create ship
|= [dap=dude how=?(%new %old) pup=scup]
|= [dap=dude how=?(%new %old) byk=beak]
^+ +>
:: ~& [%mo-boot dap how pup]
%+ mo-pass [%sys how dap (scot %p p.pup) q.pup ~]
=+ bek=[p.pup q.pup [%da now]]
:: ~& [%mo-boot dap how byk]
%+ mo-pass [%sys how dap (scot %p p.byk) q.byk (scot r.byk) ~]
^- note-arvo
[%f %exec our bek `[%boil %core [bek [dap %ape ~]] ~]]
[%f %exec our byk `[%boil %core [byk [dap %ape ~]] ~]]
::
++ mo-away :: foreign request
|= [him=ship caz=cush] ::
@ -281,32 +280,32 @@
?~ cup ~
[~ `tang`[[%leaf (trip p.u.cup)] q.u.cup]]
::
++ mo-chew :: reverse build path
|= pax=path
^- beak
?> ?=([@ @ @ ~] pax)
[(slav %p i.pax) i.t.pax da/(slav %da i.t.t.pax)]
::
++ mo-cyst :: take in /sys
|= [pax=path sih=sign-arvo]
^+ +>
?+ -.pax !!
%dep :: update
?> ?=([%f %news *] sih)
?. ?=([@ @ @ ~] t.pax) :: XX while old piers
?> ?=([@ ~] t.pax) :: may retain state
=+ sot=(~(get by bum) i.t.pax) :: then delete
?~ sot
~& [%mo-cyst-none i.t.pax]
+>.$
(mo-boot i.t.pax %old pup.u.sot)
?> ?=([@ @ @ ~] t.pax)
%^ mo-boot i.t.t.t.pax
?:((~(has by bum) i.t.t.t.pax) %old %new)
[(slav %p i.t.pax) i.t.t.pax]
[(slav %p i.t.pax) i.t.t.pax [%da now]]
::
%new
?> ?=([%f %made *] sih)
?> ?=([@ @ @ ~] t.pax)
(mo-boom i.t.pax [(slav %p i.t.t.pax) i.t.t.t.pax] +>.sih)
?> ?=([@ @ @ @ ~] t.pax)
(mo-boom i.t.pax (mo-chew t.t.pax) +>.sih)
::
%old :: reload old
?> ?=([%f %made *] sih)
?> ?=([@ @ @ ~] t.pax)
(mo-boon i.t.pax [(slav %p i.t.t.pax) i.t.t.t.pax] +>.sih)
?> ?=([@ @ @ @ ~] t.pax)
(mo-boon i.t.pax (mo-chew t.t.pax) +>.sih)
::
%red :: diff ack
?> ?=([@ @ @ ~] t.pax)
@ -406,15 +405,12 @@
?: =(~ kys.u.suf)
+>.^$(hen neh, wub (~(del by wub) dap))
=^ lep kys.u.suf [p q]:~(get to kys.u.suf)
:: ~& [%mo-claw-play dap r.lep]
$(+>.^$ ap-abet:(ap-club:(ap-abed:ap(hen p.lep) dap q.lep) r.lep))
::
++ mo-beak :: build beak
|= dap=dude
^- beak
:: =+ pup=pup:(~(got by bum) dap)
:: [p.pup q.pup [%da now]] :: XX this is wrong; save the build case
[our %home %da now] :: XX really wrong
byk:(~(got by bum) dap)
::
++ mo-club :: local action
|= [dap=dude pry=prey cub=club]
@ -641,7 +637,7 @@
act=act.tyc :: tick
eny=eny.tyc :: nonce
now=lat.tyc :: time
byk=[p.pup q.pup [%da lat.tyc]] :: source
byk=byk :: source
== == ::
==
::
@ -839,6 +835,7 @@
=+ cug=(ap-find /lame)
?~ cug
=. why (turn why |=(a=tank rose/[~ "! " ~]^[a]~))
~& [%ap-lame dap]
~> %slog.`%*(. >[%ap-lame wut %why]< |2.+> why)
+>.$
=^ cam +>.$

View File

@ -6,6 +6,10 @@
::::
!:
|= $: [now=@da eny=@uvI bec=beak]
[[syd=desk dap=term ~] ~]
[arg=[@ $|(~ [@ ~])] ~]
==
[%hood-start syd dap]
:- %hood-start
?> ((sane %tas) -.arg)
?@ +.arg [%home -.arg]
?> ((sane %tas) +<.arg)
[-.arg +<.arg]

View File

@ -6,7 +6,7 @@
:: :: ::
:::: :: :: semantics
!: :: ::
|%
|% ::
++ icon |=(? ?:(+< 'X' 'O')) :: display at
++ bo :: per board
|_ bud=board ::

View File

@ -1,16 +0,0 @@
::
:::: /hook/door/oct2-move/mar
::
/? 314
!:
::::
::
=+ point=,[x=@ y=@]
|_ point
::
++ grab :: convert from
|%
++ json (corl need (at ni ni ~):jo) :: reparse from %json
++ noun point :: clam from %noun
--
--

View File

@ -1,34 +0,0 @@
:: :: ::
:::: /hook/door/oct2-update/mar :::::: dependencies
:: :: ::
/? 310 :: arvo
/- *oct2 :: structures
/+ oct2 :: libraries
!: :: ::
:::: :: :: protocol
:: :: ::
|_ play :: game
++ grab :: convert from
|%
++ noun play :: from %noun
--
++ grow :: convert to
|%
++ json ^- ^json :: to %json
~! +>-<
?: ?=(| +>-<)
~! +>-<
~! p
s/(crip p)
=+ she=|=(ship s/(scot %p +<))
=+ hes=|=([ship *] (she +<-))
%- jobe
:~ who/s/?:(who.p %x %o)
plx/?~(p.sag.p ~ (she u.p.sag.p))
plo/?~(q.sag.p ~ (she u.q.sag.p))
aud/a/(turn (~(tap by aud.p)) hes)
box/~(jon bo box.p)
boo/~(jon bo boo.p)
==
--
--

View File

@ -1,37 +1,37 @@
#what, #bord, #audi { width: 600px; text-align: center; position: absolute;
left: 50%; margin-left: -300px; }
#what { height: 36px; top: 18px; }
#bord { height: 600px; position: absolute; top: 111px; opacity: .3; }
#audi { top: 760px; }
.turn #bord { opacity: 1; }
#message { position:absolute; left: 0; top: 0; width: 100%; height: 90px;
line-height: 90px; background-color: #000; color: #fff;
text-align: center; }
#message .ship { display: inline; }
#what { font-family: "bau"; }
#what div { display: inline-block; }
.ship { padding: .3rem; font-weight: 400; letter-spacing: 1px;
text-transform: uppercase; line-height:2rem; }
.ship:before { content: "~"; font-weight: 500; font-size: 1rem; }
.waiting.ship:before { content: "Waiting"; color: #ccc; }
#what #x, #what #o { border: 2px solid #fff; }
.x #what #x, .o #what #o { border: 2px solid red; }
#what #ship, #what #user { padding: .6rem; }
#what .as { width: 1.6rem; }
#audi h1,
#vs { margin: 0 1rem; padding: .3rem; color: #fff; background-color: #000; }
#audi h1 { font-size: .9rem; text-transform: uppercase; display:
inline-block; background-color: #ccc; }
#audi h1:after { content: ""; margin: 0; }
#audi .ship { color: #ccc; }
.spac { font-size: 100px; line-height: 200px; }
.spac { width: 198px; height: 198px; border: 1px solid #000;
text-align: center; float: left; cursor: pointer; }
.spac[data-index="0-0"], .spac[data-index="1-0"], .spac[data-index="2-0"]
{ border-left: 0; }
.spac[data-index="0-0"], .spac[data-index="0-1"], .spac[data-index="0-2"]
{ border-top: 0; }
.spac[data-index="2-0"], .spac[data-index="2-1"], .spac[data-index="2-2"]
{ border-bottom: 0; }
.spac[data-index="0-2"], .spac[data-index="1-2"], .spac[data-index="2-2"]
{ border-right: 0; }
#what,#bord,#audi { width:600px; text-align:center; position:absolute;
left:50%; margin-left:-300px; }
#what { height:36px; top:18px; }
#bord { height:600px; position:absolute; top:111px; opacity:.3; }
#audi { top:760px; }
.turn #bord { opacity:1; }
#message { position:absolute; left:0; top:0; width:100%; height:90px;
line-height:90px; background-color:#000; color:#fff;
text-align:center; }
#message .ship { display:inline; }
#what { font-family:"bau"; }
#what div { display:inline-block; }
.ship { padding:.3rem; font-weight:400; letter-spacing:1px;
text-transform:uppercase; line-height:2rem; }
.ship:before { content:"~"; font-weight:500; font-size:1rem; }
.waiting.ship:before { content:"Waiting"; color:#ccc; }
#what #x,#what #o { border:2px solid #fff; }
.x #what #x,.o #what #o { border:2px solid red; }
#what #ship,#what #user { padding:.6rem; }
#what .as { width:1.6rem; }
#audi h1,#vs { margin:0 1rem; padding:.3rem; color:#fff;
background-color:#000; }
#audi h1 { font-size:.9rem; text-transform:uppercase;
display:inline-block; background-color:#ccc; }
#audi h1:after { content:""; margin:0; }
#audi .ship { color:#ccc; }
.spac { font-size:100px; line-height:200px; }
.spac { width:198px; height:198px; border:1px solid #000;
text-align:center; float:left; cursor:pointer; }
.spac[data-index="0-0"],.spac[data-index="1-0"],.spac[data-index="2-0"]
{ border-left:0; }
.spac[data-index="0-0"],.spac[data-index="0-1"],.spac[data-index="0-2"]
{ border-top:0; }
.spac[data-index="2-0"],.spac[data-index="2-1"],.spac[data-index="2-2"]
{ border-bottom:0; }
.spac[data-index="0-2"],.spac[data-index="1-2"],.spac[data-index="2-2"]
{ border-right:0; }

View File

@ -53,9 +53,9 @@ $(function() {
state.plo = ""
if(!state.plx)
state.plx = ""
$('#o .ship').toggleClass('waiting', (state.plo=="")).
$('#o .ship').toggleClass('anyone', (state.plo=="")).
text(state.plo.slice(1))
$('#x .ship').toggleClass('waiting', (state.plx=="")).
$('#x .ship').toggleClass('anyone', (state.plx=="")).
text(state.plx.slice(1))
}

20
base/sur/oct4/core.hook Normal file
View File

@ -0,0 +1,20 @@
:: :: ::
:::: /hook/core/oct4/sur :::::: dependencies
:: :: ::
/? 310 ::
:: :: ::
:::: :::::: semantics
:: :: ::
|% ::
++ board ,@ :: one-player bitfield
++ point ,[x=@ y=@] :: coordinate
++ stage (pair (unit ship) (unit ship)) :: players
++ play (each game tape) :: update
++ game :: game state
$: who=? :: whose turn
sag=stage :: who's playing
aud=(map ship ,@ud) :: who's watching
box=board :: X board
boo=board :: O board
== ::
--