Commit b31dd065 authored by Alexander Shabarshin's avatar Alexander Shabarshin

optimized version + extended fonts

parent f703da67
......@@ -13,11 +13,6 @@ dec parse : strings -> string # string # string # string;
sure_num(pairs_get(l,"sym"))
);
dec head2 : list(strings) -> string;
--- head2(nil) <= "";
--- head2(nil::xs) <= "";
--- head2(x::xs) <= head(x);
dec commaconcat : strings -> string;
--- commaconcat(x::nil) <= x;
--- commaconcat(x::xs) <= x<>","<>commaconcat(xs);
......@@ -31,12 +26,12 @@ dec action : strings # string -> strings;
let (i,c,r,s)==parse(l)
in if equal(i,"0")
then mapconcat(sql("/sqlite3/pcb0.db",
"select sid%100 as x,sid/100 as y,sym,lid from pcb_screen where y<75 and sym!=16"))
"select pcb1.col,pcb1.row,pcb1.sym,pcb1.id from pcb_action as pcb1, "<>
"(select col,row,id from pcb_action where flag=0 group by col,row) as pcb2 "<>
"where pcb1.col=pcb2.col and pcb1.row=pcb2.row and pcb1.id=pcb2.id and pcb1.sym!=0"))
else mapconcat(sql("/sqlite3/pcb0.db",
"insert into pcb_action (col,row,sym) values ("<>c<>","<>r<>","<>s<>");"<>
"update pcb_screen set lid=(select max(id) from pcb_action),sym="<>s<>",adr="<>quote(a)<>" where sid="<>num2str(str2num(r)*100+str2num(c))<>";"<>
"insert into pcb_action (col,row,sym,adr,utime) values ("<>c<>","<>r<>","<>s<>","<>quote(a)<>",strftime("<>quote("%s")<>","<>quote("now")<>"));"<>
"select col,row,sym,id from pcb_action where id>"<>i));
write "Content-type: text/plain\n\n";
write action(explode(pairs_get(env,"QUERY_STRING"),'&'),pairs_get(env,"REMOTE_ADDR"));
#!/usr/local/bin/hopeless -f
uses db_sqlite,string,system,lists,range;
dec head2 : list(strings) -> string;
--- head2(nil) <= "";
--- head2(nil::xs) <= "";
--- head2(x::xs) <= head(x);
dec doit : list(num) -> strings;
--- doit(nil) <= nil;
--- doit(x::xs) <= head2(sql("/sqlite3/pcb0.db","insert into pcb_screen (sid,sym,lid,adr) values (" <>
num2str(x) <> ",16,0,NULL)")) :: doit(xs);
write "Content-type: text/plain\n\n";
write sql("/sqlite3/pcb0.db","create table pcb_action ( id integer primary key autoincrement, " <>
"col integer not null, row integer not null, sym integer not null )");
write sql("/sqlite3/pcb0.db","create table pcb_screen ( sid integer primary key, sym integer not null, "<>
"lid integer not null, adr text )");
write doit(0..9999);
uses db_sqlite,string,system,lists;
write sql("/sqlite3/pcb0.db","CREATE TABLE pcb_action (id integer primary key autoincrement, " <>
"col integer not null, row integer not null, sym integer not null, " <>
"flag integer not null default 0, utime integer not null default 0, " <>
"adr text not null default "<>quote("127.0.0.1")<>")");
write sql("/sqlite3/pcb0.db","CREATE INDEX pcbi_au ON pcb_action(adr,utime)");
write sql("/sqlite3/pcb0.db","CREATE INDEX pcbi_crf ON pcb_action(col,row,flag)");
www/pcb/0000.gif

46 Bytes | W: | H:

www/pcb/0000.gif

46 Bytes | W: | H:

www/pcb/0000.gif
www/pcb/0000.gif
www/pcb/0000.gif
www/pcb/0000.gif
  • 2-up
  • Swipe
  • Onion skin
www/pcb/0010.gif

46 Bytes | W: | H:

www/pcb/0010.gif

46 Bytes | W: | H:

www/pcb/0010.gif
www/pcb/0010.gif
www/pcb/0010.gif
www/pcb/0010.gif
  • 2-up
  • Swipe
  • Onion skin
www/pcb/00b2.gif

46 Bytes | W: | H:

www/pcb/00b2.gif

45 Bytes | W: | H:

www/pcb/00b2.gif
www/pcb/00b2.gif
www/pcb/00b2.gif
www/pcb/00b2.gif
  • 2-up
  • Swipe
  • Onion skin
www/pcb/01b2.gif

46 Bytes | W: | H:

www/pcb/01b2.gif

45 Bytes | W: | H:

www/pcb/01b2.gif
www/pcb/01b2.gif
www/pcb/01b2.gif
www/pcb/01b2.gif
  • 2-up
  • Swipe
  • Onion skin
......@@ -23,6 +23,8 @@ Check out our <a href="http://www.nedopc.org/forum/viewforum.php?f=46">Russian f
<script type="text/javascript">
var online = 0; // set to -1 for local use
function rob_set(x,y,n) {
var h = n.toString(16);
if(h.length==1) h="0"+h;
......@@ -86,8 +88,8 @@ function tab_act(x,y) {
var c = ((chy-3)<<4)|(chx-1);
if(c>=0 && c<256)
{
rob_set(x,y,c);
$__(function(s){
if(online > 0) {
$__(function(s){
$map(s.split("\n"),function(s){
if(s!=""){
var c=s.split(",");
......@@ -96,6 +98,9 @@ function tab_act(x,y) {
}
});
},"/cgi-bin/pcb0.hop?id="+id+"&col="+x+"&row="+y+"&sym="+c);
} else {
rob_set(x,y,c);
}
}
}
}
......@@ -103,7 +108,7 @@ function tab_act(x,y) {
window.setInterval(function(){tab_blink()},500);
if($W.table('tut',75,100,'tab','<img src=/pcb/0010.gif>')>0) {
if($W.table('tut',75,100,'tab','<img src=/pcb/0000.gif>')>0) {
var i,j,k=0;
......@@ -143,7 +148,8 @@ $map($$('tab.*.*'),function(e){
e.onclick = function(){tab_act(parseInt(a[2]),parseInt(a[1]))};
});
$__(function(s){
if(online==0) {
$__(function(s){
var si = "0";
$map(s.split("\n"),function(s){
var c=s.split(",");
......@@ -160,8 +166,10 @@ $__(function(s){
}
});
rob_id(si);
online++;
tab_act(99,74);
},"/cgi-bin/pcb0.hop?id=0");
}
}
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment