Merge branch 'demo' into test

Conflicts:
	urb/urbit.pill
	urb/zod/base/ape/cloud.hoon
	urb/zod/base/arvo/gall.hoon
	urb/zod/base/mar/oct2-move.hoon
	urb/zod/base/mar/oct2-update.hoon
This commit is contained in:
Anton Dyudin 2015-06-04 17:07:28 -07:00
commit e760115f8a
16 changed files with 131 additions and 166 deletions

View File

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

View File

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

View File

@ -77,7 +77,7 @@
++ sawn (hail(eye (~(del by eye) ost)) |) :: console unsubscribe ++ sawn (hail(eye (~(del by eye) ost)) |) :: console unsubscribe
++ seen (hail(eye (~(put by eye) ost *sole-share)) &) :: console subscribe ++ seen (hail(eye (~(put by eye) ost *sole-share)) &) :: console subscribe
++ show prom:(fect %mor rend) :: update console ++ 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 ++ tame (flap |=(_. (fact:+< &/gam)) |=(_. prom:+<)) :: light update
++ wild (flap |=(_. (fact:+< &/gam)) |=(_. show:+<)) :: full update ++ wild (flap |=(_. (fact:+< &/gam)) |=(_. show:+<)) :: full update
++ word |= txt=tape %+ flap :: game message ++ word |= txt=tape %+ flap :: game message

View File

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

View File

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

View File

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

View File

@ -6,6 +6,10 @@
:::: ::::
!: !:
|= $: [now=@da eny=@uvI bec=beak] |= $: [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 :::: :: :: semantics
!: :: :: !: :: ::
|% |% ::
++ icon |=(? ?:(+< 'X' 'O')) :: display at ++ icon |=(? ?:(+< 'X' 'O')) :: display at
++ bo :: per board ++ bo :: per board
|_ bud=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

@ -9,6 +9,7 @@
!: !:
^- manx ^- manx
=+ do=(~(get by qix.gas) %'code') =+ do=(~(get by qix.gas) %'code')
=+ g=(~(get by qix.gas) %'access_token')
;html ;html
;head ;head
@ -20,10 +21,11 @@
;title: DO & GCE Manager ;title: DO & GCE Manager
== ==
;body ;body
;script:""" ;* =+ d=?~(do ~ (trip u.do))
var authcode = \{} =+ g=?~(g ~ (trip u.g))
authcode.do='{?~(do ~ (trip u.do))}' ~& d
""" :_ ~
;script: authcode='{?~(d g d)}'; console.log(authcode)
;div#container; ;div#container;
;script@"/home/pub/cloud/src/main.js"; ;script@"/home/pub/cloud/src/main.js";
== ==

View File

@ -9,18 +9,6 @@ tr = React.DOM.tr
td = React.DOM.td td = React.DOM.td
input = React.DOM.input input = React.DOM.input
function HashToJSON() {
var pairs = window.location.hash.slice(1).split('&');
var result = {};
pairs.forEach(function(pair) {
pair = pair.split('=');
result[pair[0]] = decodeURIComponent(pair[1] || '');
});
return JSON.parse(JSON.stringify(result));
}
DOControls = React.createClass({ DOControls = React.createClass({
createDroplet: function(){ createDroplet: function(){
urb.send({appl: "cloud", urb.send({appl: "cloud",
@ -74,10 +62,10 @@ GCEControls = React.createClass({
urb.send({ urb.send({
appl: 'cloud', appl: 'cloud',
data: {action:'create-gce', data: {action:'create-gce',
// project:$('#project').val(), project:$('#project').val(),
// zone:$('#zone').val(), zone:$('#zone').val(),
// name:$('#gname').val(), name:$('#gname').val(),
// machine_type:$('#machine_type').val() / machine_type:$('#machine_type').val()
}, },
mark: 'json'}) mark: 'json'})
}, },
@ -85,11 +73,10 @@ GCEControls = React.createClass({
createDisk: function(){ createDisk: function(){
urb.send({ urb.send({
appl: 'cloud', appl: 'cloud',
data: {action:'create-gce', data: {action:'create-gce-disk',
snap:$('#gsnap').val(), snap:$('#gsnap').val(),
number:$('#number').val(), number:$('#number').val(),
name:$('#gcpName').val(), name:$('#gcpName').val()},
instance_img:$('#instance_image').val()},
mark: 'json'}) mark: 'json'})
}, },
@ -101,8 +88,7 @@ GCEControls = React.createClass({
b({onClick:this.createDisk}, 'Create Disk From Image'), b({onClick:this.createDisk}, 'Create Disk From Image'),
input({id:'gcpName',placeholder:'Name for GCE Disk and Instance'}), input({id:'gcpName',placeholder:'Name for GCE Disk and Instance'}),
input({id:'number',placeholder:'Number of instances'}), input({id:'number',placeholder:'Number of instances'}),
input({id:'gsnap',placeholder:'Snapshot'}), input({id:'gsnap',placeholder:'Snapshot'})
input({id:'instance_image',placeholder:'Instance Image'})
]), ]),
div({}, [ div({}, [
a({href:ghref},"Get Google Authcode"), a({href:ghref},"Get Google Authcode"),
@ -111,9 +97,16 @@ GCEControls = React.createClass({
div({}, [ div({}, [
input({id:"gappsecret"}, input({id:"gappsecret"},
b({onClick:this.props.sendSecret('gce','#gappsecret')}, "Send Google Secret")) b({onClick:this.props.sendSecret('gce','#gappsecret')}, "Send Google Secret"))
]) ]),
div({}, [
b({onClick:this.createDroplet}, "Create Droplet"),
input({id:"project",placeholder:"project"}),
input({id:"zone",placeholder:"zone"}),
input({id:"gname",placeholder:"Name of droplet"}),
input({id:"machine_type",placeholder:"Machine Type"}),
//input({id:"image",placeholder:"Image"}),
]) ])
) ]))
} }
}) })
@ -121,8 +114,8 @@ Droplet = React.createClass({
dropletAction:function(id, action){ dropletAction:function(id, action){
urb.send({ urb.send({
appl:"cloud", appl:"cloud",
data: {action:action, data: {action: action,
id:id}}) id: id}})
}, },
render: function() { render: function() {
@ -149,11 +142,10 @@ Page = recl({
handleClick: function(platform){ handleClick: function(platform){
return function(){ return function(){
console.log(platform); console.log(platform);
console.log(window.authcode.platform)
if(window.authcode.length !== ''){ if(window.authcode.length !== ''){
urb.send({ urb.send({
appl: "cloud", appl: "cloud",
data: {authcode:authcode[platform], data: {authcode:window.authcode,
platform:platform}, platform:platform},
mark: "cloud-auth"}) mark: "cloud-auth"})
} else { console.log("nocode") } } else { console.log("nocode") }
@ -189,8 +181,6 @@ Page = recl({
} }
}) })
var hash = HashToJSON() //pull out hash of query string for gce authcode
authcode.gce = hash.access_token
mounted = React.render(Page({droplets:[]}), $("#container")[0]) mounted = React.render(Page({droplets:[]}), $("#container")[0])
urb.bind("/", function(err,d) { urb.bind("/", function(err,d) {

View File

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

View File

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

20
base/sur/oct4.hoon 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
== ::
--