diff --git a/chess.sql b/chess.sql index 53c9dee..fc4da03 100644 --- a/chess.sql +++ b/chess.sql @@ -88,8 +88,8 @@ CREATE TABLE public.context ( id integer DEFAULT nextval('public.context_seq_id'::regclass), bid integer, wid integer, - bprio real, - wprio real + Blackprio real, + Whiteprio real ); ALTER TABLE public.context @@ -150,9 +150,9 @@ ALTER TABLE public.black ALTER TABLE public.black OWNER TO postgres; CREATE TABLE public.sessions ( - session text, - bid integer, - wid integer + session text NOT NULL, + bid integer NOT NULL, + wid integer NOT NULL ); ALTER TABLE public.sessions diff --git a/chess_gui/lib/chess_gui.pm b/chess_gui/lib/chess_gui.pm index a1c27ba..ed28fbb 100644 --- a/chess_gui/lib/chess_gui.pm +++ b/chess_gui/lib/chess_gui.pm @@ -44,7 +44,7 @@ my $dbh = DBI->connect("dbi:Pg:dbname=$dbname", $username, '', {PrintError => 1, #my $sth1 = $dbh->prepare(q/SELECT bw_id, prio FROM black, context WHERE black.b0 = ? and black.b1 = ? and black.k0 = ? and black.n0 = ? and black.n1 = ? and black.p0 = ? and black.p1 = ? and black.p2 = ? and black.p3 = ? and black.p4 = ? and black.p5 = ? and black.p6 = ? and black.p7 = ? and black.q0 = ? and black.r0 = ? and black.r1 = ? and black.b0 = ? and context.b1 = ? and context.k0 = ? and context.n0 = ? and context.n1 = ? and context.p0 = ? and context.p1 = ? and context.p2 = ? and context.p3 = ? and context.p4 = ? and context.p5 = ? and context.p6 = ? and context.p7 = ? and context.q0 = ? and context.r0 = ? and context.r1 = ?/); #my $sth1 = $dbh->prepare(q/SELECT black.id, white.id, bprio, wprio FROM black, white, context WHERE black.id = bid and white.id = wid and white.b0 = ? and white.b1 = ? and white.k0 = ? and white.n0 = ? and white.n1 = ? and white.p0 = ? and white.p1 = ? and white.p2 = ? and white.p3 = ? and white.p4 = ? and white.p5 = ? and white.p6 = ? and white.p7 = ? and white.q0 = ? and white.r0 = ? and white.r1 = ? and black.b0 = ? and black.b1 = ? and black.k0 = ? and black.n0 = ? and black.n1 = ? and black.p0 = ? and black.p1 = ? and black.p2 = ? and black.p3 = ? and black.p4 = ? and black.p5 = ? and black.p6 = ? and black.p7 = ? and black.q0 = ? and black.r0 = ? and black.r1 = ?/); #TODO: There should be a better way to do this... #my $sth1 = $dbh->prepare(q/SELECT black.id, white.id FROM black, white WHERE (black.id, white.id) IN (SELECT bid, wid FROM context) and white.b0 = ? and white.b1 = ? and white.k0 = ? and white.n0 = ? and white.n1 = ? and white.p0 = ? and white.p1 = ? and white.p2 = ? and white.p3 = ? and white.p4 = ? and white.p5 = ? and white.p6 = ? and white.p7 = ? and white.q0 = ? and white.r0 = ? and white.r1 = ? and black.b0 = ? and black.b1 = ? and black.k0 = ? and black.n0 = ? and black.n1 = ? and black.p0 = ? and black.p1 = ? and black.p2 = ? and black.p3 = ? and black.p4 = ? and black.p5 = ? and black.p6 = ? and black.p7 = ? and black.q0 = ? and black.r0 = ? and black.r1 = ?/); -my $sth1 = $dbh->prepare(q/SELECT bid, wid, bprio, wprio FROM context WHERE (bid, wid) IN (SELECT black.id, white.id FROM black, white WHERE white.b0 = ? and white.b1 = ? and white.k0 = ? and white.n0 = ? and white.n1 = ? and white.p0 = ? and white.p1 = ? and white.p2 = ? and white.p3 = ? and white.p4 = ? and white.p5 = ? and white.p6 = ? and white.p7 = ? and white.q0 = ? and white.r0 = ? and white.r1 = ? and black.b0 = ? and black.b1 = ? and black.k0 = ? and black.n0 = ? and black.n1 = ? and black.p0 = ? and black.p1 = ? and black.p2 = ? and black.p3 = ? and black.p4 = ? and black.p5 = ? and black.p6 = ? and black.p7 = ? and black.q0 = ? and black.r0 = ? and black.r1 = ?)/); +my $sth1 = $dbh->prepare(q/SELECT bid, wid, Blackprio, Whiteprio FROM context WHERE (bid, wid) IN (SELECT black.id, white.id FROM black, white WHERE white.b0 = ? and white.b1 = ? and white.k0 = ? and white.n0 = ? and white.n1 = ? and white.p0 = ? and white.p1 = ? and white.p2 = ? and white.p3 = ? and white.p4 = ? and white.p5 = ? and white.p6 = ? and white.p7 = ? and white.q0 = ? and white.r0 = ? and white.r1 = ? and black.b0 = ? and black.b1 = ? and black.k0 = ? and black.n0 = ? and black.n1 = ? and black.p0 = ? and black.p1 = ? and black.p2 = ? and black.p3 = ? and black.p4 = ? and black.p5 = ? and black.p6 = ? and black.p7 = ? and black.q0 = ? and black.r0 = ? and black.r1 = ?)/); #my $sth2 = $dbh->prepare(q/INSERT INTO white (b0, b1, k0, n0, n1, p0, p1, p2, p3, p4, p5, p6, p7, q0, r0, r1, prio) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)/); #my $sth3 = $dbh->prepare(q/INSERT INTO black (b0, b1, k0, n0, n1, p0, p1, p2, p3, p4, p5, p6, p7, q0, r0, r1, prio) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)/); #my $sth2 = $dbh->prepare(q/INSERT INTO white (b0, b1, k0, n0, n1, p0, p1, p2, p3, p4, p5, p6, p7, q0, r0, r1) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)/); @@ -52,7 +52,7 @@ my $sth1 = $dbh->prepare(q/SELECT bid, wid, bprio, wprio FROM context WHERE (bid #my $sth4 = $dbh->prepare(q/INSERT INTO context (b0, b1, k0, n0, n1, p0, p1, p2, p3, p4, p5, p6, p7, q0, r0, r1, prio) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)/); my $sth2 = $dbh->prepare(q/INSERT INTO white (b0, b1, k0, n0, n1, p0, p1, p2, p3, p4, p5, p6, p7, q0, r0, r1) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)/); my $sth3 = $dbh->prepare(q/INSERT INTO black (b0, b1, k0, n0, n1, p0, p1, p2, p3, p4, p5, p6, p7, q0, r0, r1) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)/); -my $sth5 = $dbh->prepare(q/INSERT INTO context (bid, wid, bprio, wprio) VALUES (?, ?, ?, ?)/); +my $sth5 = $dbh->prepare(q/INSERT INTO context (bid, wid, Blackprio, Whiteprio) VALUES (?, ?, ?, ?)/); my $sth6 = $dbh->prepare(q/SELECT id FROM white WHERE b0 = ? and b1 = ? and k0 = ? and n0 = ? and n1 = ? and p0 = ? and p1 = ? and p2 = ? and p3 = ? and p4 = ? and p5 = ? and p6 = ? and p7 = ? and q0 = ? and r0 = ? and r1 = ?/); my $sth7 = $dbh->prepare(q/SELECT id FROM black WHERE b0 = ? and b1 = ? and k0 = ? and n0 = ? and n1 = ? and p0 = ? and p1 = ? and p2 = ? and p3 = ? and p4 = ? and p5 = ? and p6 = ? and p7 = ? and q0 = ? and r0 = ? and r1 = ?/); #my $sth8 = $dbh->prepare(q/SELECT black.b0, black.b1, black.k0, black.n0, black.n1, black.p0, black.p1, black.p2, black.p3, black.p4, black.p5, black.p6, black.p7, black.q0, black.r0, black.r1, white.b0, white.b1, white.k0, white.n0, white.n1, white.p0, white.p1, white.p2, white.p3, white.p4, white.p5, white.p6, white.p7, white.q0, white.r0, white.r1 FROM black, white WHERE (black.id, white.id) IN (SELECT bid, wid FROM sessions WHERE session = ?)/); @@ -62,8 +62,13 @@ my $sth10 = $dbh->prepare(q/INSERT INTO sessions (session, bid, wid) VALUES ($1, my $sth11 = $dbh->prepare(q/SELECT bid, wid FROM sessions WHERE session = ?/); my (@tree, @what_i_did, %prop, @keys, @pplayer, %tmpalg, %tmpalg2, %tmpalg3, %tmpalg4, $players, @not_player, $smaleer, %pval); @not_player[0, 1] = (1, 0); +my @px = ('A'..'H'); +my %pxr; +@pxr{'A'..'H'} = (0..7); +my %ppiece; +@ppiece{qw/b k n p q r/} = qw/bishop king knight pawn queen rook/; my @player = reverse @not_player; -@pplayer[0, 1] = qw/w b/; +@pplayer[0, 1] = qw/White Black/; my @pseudoinfinite_loop_check; my $user_mode; my $player; @@ -73,6 +78,7 @@ my $action_limit = 100; my $loop_limit = 6; my @direction = qw/1 1 1 -1 -1 -1 -1 1 0 1 0 -1 1 0 -1 0 0.5 2 0.5 -2 -0.5 -2 -0.5 2/; # Diagonal direction modifiers: $direction[0..7]. Straight direction modifiers: $direction[8..15]. Knight direction modifiers: $direction[0..7,16..23]. my @default_iboard; +#my %default_iboard; my @session_iboard; sub INTERRUPT { $sth1->finish(); @@ -133,7 +139,8 @@ if ($#_ != -1) { } elsif ($y > 5) { # Black, hereafter called player 1. $player = 1; } else { - $default_iboard[$y][$x] = $_; +# $default_iboard[$y][$x] = $_; + $default_iboard[$y][$x]{'pco'} = join '', $px[$x], ($y+1); next; } if ($y*2 % 10 == 2) { # Pawn. @@ -155,8 +162,10 @@ if ($#_ != -1) { push @{$prop{$_}}, ($player, 'b', $x % 2); $pval{join '', @{$prop{$_}}} = 0.01; } - if (exists($prop{$_})) {$default_iboard[$y][$x] = join '', @{$prop{$_}}} - +# if (exists($prop{$_})) {$default_iboard[$y][$x] = join '', @{$prop{$_}}} +# if (exists($prop{$_})) {$default_iboard[$y][$x]{'isPiece'} = 1; $default_iboard[$y][$x]{'value'} = join '', @{$prop{$_}}; $default_iboard[$y][$x]{'prettyName'} = join ' ', $pplayer[$prop{$_}[0]], $ppiece{$prop{$_}[1]}} else {$default_iboard[$y][$x]{'isPiece'} = 0; $default_iboard[$y][$x]{'value'} = undef}; # HoA for Template Toolkit. + $default_iboard[$y][$x]{'isPiece'} = 1; $default_iboard[$y][$x]{'id'} = join '', @{$prop{$_}}; $default_iboard[$y][$x]{'img'} = join '', @{$prop{$_}}[0..1]; $default_iboard[$y][$x]{'prettyName'} = join ' ', $pplayer[$prop{$_}[0]], $ppiece{$prop{$_}[1]}; # HoA for Template Toolkit. + $default_iboard[$y][$x]{'pco'} = join '', $px[$x], ($y+1); } else { # Restore a previous state (from a session). $session_iboard[$y][$x] = $h1{$_} // $h0{$_} // $_; } @@ -184,7 +193,8 @@ sub MOVEMENT_TREE { # Assume relative movement to support abritrary depth (0 < $ if ($#ditet != -1 and defined($ditet[2/($player+1)+1])) { my $tmpkey = join ',', @keys; {no warnings; $tmpalg{$tmpkey} = $ditet[2/($player+1)+1]}; - if ($player == $user_mode) {if (defined($prop{$asrc}) and (join '', @{$prop{$asrc}}) eq $_[7] and ($_[8] eq $tree[$i]{$asrc}[$c] or (defined($prop{$tree[$i]{$asrc}[$c]}) and $_[8] eq (join '', @{$prop{$tree[$i]{$asrc}[$c]}})))) {$tmpalg{$tmpkey} = 'Inf'; $sth10->execute($_[9], $ditet[0], $ditet[1])}} #else { +# if ($player == $user_mode) {if (defined($prop{$asrc}) and (join '', @{$prop{$asrc}}) eq $_[7] and ($_[8] eq $tree[$i]{$asrc}[$c] or (defined($prop{$tree[$i]{$asrc}[$c]}) and $_[8] eq (join '', @{$prop{$tree[$i]{$asrc}[$c]}})))) {$tmpalg{$tmpkey} = 'Inf'; $sth10->execute($_[9], $ditet[0], $ditet[1])}} #else { + if ($player == $user_mode) {if ($asrc eq $_[7] and $_[8] eq $tree[$i]{$asrc}[$c]) {$tmpalg{$tmpkey} = 'Inf'; $sth10->execute($_[9], $ditet[0], $ditet[1])}} my $val = $tmpalg{$tmpkey}; push @{$key_list_by_value{$val}}, ($tmpkey, @ditet[0, 1]); unless (defined($prio)) { @@ -460,7 +470,8 @@ $sth5->execute($bid, $wid, $tmpalg{$selection}, undef); } # if ($player == $user_mode and (join '', @asrc) eq $_[7] and ($_[8] eq $adest or $_[8] eq (join '', @adest))) {$tmpalg{$selection} = 'Inf'; $sth9->execute($_[9], $bid, $wid)} - if ($player == $user_mode) {if ($#asrc != -1 and (join '', @asrc) eq $_[7] and ($_[8] eq $adest or $_[8] eq (join '', @adest))) {$tmpalg{$selection} = 'Inf'; $sth10->execute($_[9], $bid, $wid)}} #else { +# if ($player == $user_mode) {if ($#asrc != -1 and (join '', @asrc) eq $_[7] and ($_[8] eq $adest or $_[8] eq (join '', @adest))) {$tmpalg{$selection} = 'Inf'; $sth10->execute($_[9], $bid, $wid)}} #else { + if ($player == $user_mode) {if ($asrc eq $_[7] and $_[8] eq $adest) {$tmpalg{$selection} = 'Inf'; $sth10->execute($_[9], $bid, $wid)}} #else { my $val = $tmpalg{$selection}; push @{$key_list_by_value{$val}}, ($selection, $bid, $wid); unless (defined($prio)) { @@ -480,7 +491,7 @@ $sth5->execute($bid, $wid, $tmpalg{$selection}, undef); push @selection, $key_list_by_value{$prio}[$ii]; } $ice = int(rand($#selection+1)); - return ($prio, $key_list_by_value{$prio}[$ice*3+1], $key_list_by_value{$prio}[$ice*3+2], $selection[$ice], $ice, $#selection); + return ($prio, $key_list_by_value{$prio}[$ice*3+1], $key_list_by_value{$prio}[$ice*3+2], $selection[$ice], $ice, ($#selection+1)); } sub QUEEN { @@ -671,18 +682,18 @@ my ($pval, $called_player, $reason) = @_; # Arguments: (Value of all pieces of $ } else { $mpval = $pval; } - } elsif ($reason == 1) { + } elsif ($reason == 1) { # Won: add king value; Lost: detract king value. if ($current_player == 0) { if ($called_player == 0) { - $mpval = $pval; + $mpval = $pval + $pval{'0k0'}; } else { - $mpval = $pval * -1; + $mpval = $pval * -1 - $pval{'0k0'}; } } else { if ($called_player == 1) { - $mpval = $pval; + $mpval = $pval + $pval{'1k0'}; } else { - $mpval = $pval * -1; + $mpval = $pval * -1 - $pval{'1k0'}; } } } @@ -731,6 +742,11 @@ $user_mode = 0; my ($dpval, $i_al) = (0, 0); if ($player == $user_mode) { # If the player is human-controlled, we needn't more than $depth 1 (for input validation). $depth = 1; + my ($xrc, $yrc) = split //, $_[0]; + $_[0] = join '.', $pxr{$xrc}, ($yrc-1); + ($xrc, $yrc) = split //, $_[1]; + $_[1] = join '.', $pxr{$xrc}, ($yrc-1); + print $_[0], ' ', $_[1], "\n"; ($prio, @id[0, 1], $selection, $ice, $n_o_selections) = &MOVEMENT_TREE($player, $depth, undef, undef, undef, undef, undef, $_[0], $_[1], $sessid); print 'w ', $id[0], ' ', $id[1], "\n"; } else { @@ -757,11 +773,15 @@ print 'b ', $id[0], ' ', $id[1], "\n"; $player_turn--; # push @{$diff{$player}{'warn'}} = 'Reverting an invalid set.'; undef $diff{$pplayer[$not_player[$player]]}; - push @{$diff{$pplayer[$player]}{'status'}}, 0; + push @{$diff{$pplayer[$player]}{'status'}}, -1; # redo TURN; return %diff; - } + } else {push @{$diff{$pplayer[$player]}{'status'}}, 0} + push @{$diff{$pplayer[$player]}{'status'}}, $prio; + push @{$diff{$pplayer[$player]}{'status'}}, ($ice+1); + push @{$diff{$pplayer[$player]}{'status'}}, $n_o_selections; + # if (scalar keys %key_list_by_value > 0) { # for (my $ii = 0; $#{$key_list_by_value{$prio}} >= $ii; $ii++) { # $selection[$ii] = $key_list_by_value{$prio}[$ii]; @@ -839,8 +859,8 @@ print 'b ', $id[0], ' ', $id[1], "\n"; } push @pseudoinfinite_loop_check, $selection; - push @{$diff{$pplayer[$player]}{'prio'}}, $prio; - push @{$diff{$pplayer[$player]}{'moveno'}}, ($ice+1) . '/' . $n_o_selections; +# push @{$diff{$pplayer[$player]}{'prio'}}, $prio; +# push @{$diff{$pplayer[$player]}{'moveno'}}, ($ice+1) . '/' . $n_o_selections; # @{$diff{'msg'}{'verbose'}}[$player] = $selection[$ice]; $what_i_did[$player]{$selection} = $prio; @@ -855,9 +875,11 @@ print 'b ', $id[0], ' ', $id[1], "\n"; } my $asrc = $keys[$c]; my $piece = $prop{$asrc}; - push @{$diff{$pplayer[$player]}{'src'}}, $asrc; + my ($sxc, $syc) = split /\./, $asrc; + push @{$diff{$pplayer[$player]}{'src'}}, join '', $px[$sxc], ($syc+1); + my ($dxc, $dyc) = split /\./, $adest; + push @{$diff{$pplayer[$player]}{'dst'}}, join '', $px[$dxc], ($dyc+1); push @{$diff{$pplayer[$player]}{'src'}}, join '', @{$piece}; - push @{$diff{$pplayer[$player]}{'dst'}}, $adest; # @{$diff{$player}{'move'}}[$player*2] = (join '', @{$piece}) . ' moves from ' . $asrc . ' to ' . $adest; if (defined($prop{$adest})) { push @{$diff{$pplayer[$player]}{'dst'}}, (join '', @{$prop{$adest}}); diff --git a/chess_gui/llll b/chess_gui/llll deleted file mode 100644 index 26b82ee..0000000 --- a/chess_gui/llll +++ /dev/null @@ -1,24 +0,0 @@ - 42 | 2.7 | 5.7 | 5.6 | 2.5 | 6.7 | 0.6 | 1.6 | 2.6 | 3.6 | 4.6 | 5.4 | 6.6 | | 3.7 | 0.7 | 7.7 - 43 | 2.7 | 5.7 | 4.7 | 0.4 | 6.7 | 0.6 | 1.6 | 2.6 | 3.6 | 4.6 | 5.4 | 6.6 | | 3.7 | 0.7 | 7.7 - 44 | 2.7 | 5.7 | 4.7 | 4.4 | 6.7 | 0.6 | 1.6 | 2.6 | 3.6 | 4.6 | 5.4 | 6.6 | | 3.7 | 0.7 | 7.7 - 45 | 2.7 | 5.7 | 4.7 | 1.3 | 6.7 | 0.6 | 1.6 | 2.6 | 3.6 | 4.6 | 5.4 | 6.6 | | 3.7 | 0.7 | 7.7 - 46 | 2.7 | 5.7 | 4.7 | 1.7 | 6.7 | 0.6 | 1.6 | 2.6 | 3.6 | 4.6 | 5.4 | 6.6 | | 3.7 | 0.7 | 7.7 - 47 | 2.7 | 5.7 | 4.7 | 3.3 | 6.7 | 0.6 | 1.6 | 2.6 | 3.6 | 4.6 | 5.4 | 6.6 | | 3.7 | 0.7 | 7.7 - 48 | 2.7 | 5.7 | 4.7 | 2.5 | 5.5 | 0.6 | 1.6 | 2.6 | 3.6 | 4.6 | 5.4 | 6.6 | | 3.7 | 0.7 | 7.7 - 49 | 2.7 | 5.7 | 4.7 | 2.5 | 7.5 | 0.6 | 1.6 | 2.6 | 3.6 | 4.6 | 5.4 | 6.6 | | 3.7 | 0.7 | 7.7 - 50 | 2.7 | 5.7 | 4.7 | 2.5 | 6.7 | 0.5 | 1.6 | 2.6 | 3.6 | 4.6 | 5.4 | 6.6 | | 3.7 | 0.7 | 7.7 - 51 | 2.7 | 5.7 | 4.7 | 2.5 | 6.7 | 0.4 | 1.6 | 2.6 | 3.6 | 4.6 | 5.4 | 6.6 | | 3.7 | 0.7 | 7.7 - 52 | 2.7 | 5.7 | 4.7 | 2.5 | 6.7 | 0.6 | 1.5 | 2.6 | 3.6 | 4.6 | 5.4 | 6.6 | | 3.7 | 0.7 | 7.7 - 53 | 2.7 | 5.7 | 4.7 | 2.5 | 6.7 | 0.6 | 1.4 | 2.6 | 3.6 | 4.6 | 5.4 | 6.6 | | 3.7 | 0.7 | 7.7 - 54 | 2.7 | 5.7 | 4.7 | 2.5 | 6.7 | 0.6 | 1.6 | 2.6 | 3.5 | 4.6 | 5.4 | 6.6 | | 3.7 | 0.7 | 7.7 - 55 | 2.7 | 5.7 | 4.7 | 2.5 | 6.7 | 0.6 | 1.6 | 2.6 | 3.4 | 4.6 | 5.4 | 6.6 | | 3.7 | 0.7 | 7.7 - 56 | 2.7 | 5.7 | 4.7 | 2.5 | 6.7 | 0.6 | 1.6 | 2.6 | 3.6 | 4.5 | 5.4 | 6.6 | | 3.7 | 0.7 | 7.7 - 57 | 2.7 | 5.7 | 4.7 | 2.5 | 6.7 | 0.6 | 1.6 | 2.6 | 3.6 | 4.4 | 5.4 | 6.6 | | 3.7 | 0.7 | 7.7 - 58 | 2.7 | 5.7 | 4.7 | 2.5 | 6.7 | 0.6 | 1.6 | 2.6 | 3.6 | 4.6 | 5.3 | 6.6 | | 3.7 | 0.7 | 7.7 - 59 | 2.7 | 5.7 | 4.7 | 2.5 | 6.7 | 0.6 | 1.6 | 2.6 | 3.6 | 4.6 | 5.4 | 6.5 | | 3.7 | 0.7 | 7.7 - 60 | 2.7 | 5.7 | 4.7 | 2.5 | 6.7 | 0.6 | 1.6 | 2.6 | 3.6 | 4.6 | 5.4 | 6.4 | | 3.7 | 0.7 | 7.7 - 61 | 2.7 | 5.7 | 4.7 | 2.5 | 6.7 | 0.6 | 1.6 | 2.6 | 3.6 | 4.6 | 5.4 | 6.6 | | 3.7 | 1.7 | 7.7 - 62 | 2.7 | 5.7 | 4.7 | 2.5 | 6.7 | 0.6 | 1.6 | 2.6 | 3.6 | 4.6 | 5.4 | 6.6 | | 3.7 | 0.7 | 7.6 - 2.7, 5.7, 4.7, 2.5, 6.7, 0.6, 1.6, 2.6, 3.6, 4.6, 5.4, 6.6, , 3.7, 0.7, 7.6 - 2.0 | 5.0 | 4.0 | 1.0 | 7.6 | 0.1 | 1.1 | 2.1 | 3.1 | 4.1 | 5.1 | 6.1 | 7.1 | 3.0 | 0.0 | 7.0 - 2.0, 5.0, 4.0, 1.0, 7.6, 0.1, 1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 3.0, 0.0, 7.0, diff --git a/chess_gui/public/css/index.css b/chess_gui/public/css/index.css index 746ac6b..261662f 100644 --- a/chess_gui/public/css/index.css +++ b/chess_gui/public/css/index.css @@ -9,6 +9,7 @@ a { ol > li li { display: inline-block; width: 32px; + height: 32px; } #y-co { @@ -61,7 +62,7 @@ h3 > ul:hover .key { img { position: relative; border: 2.5px; - height: 30px; + height: 32px; border-color: #884b10; border-color: #592b07; } diff --git a/chess_gui/public/i/0.0.png b/chess_gui/public/i/0.0.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/0.0.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/0.1.png b/chess_gui/public/i/0.1.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/0.1.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/0.2.png b/chess_gui/public/i/0.2.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/0.2.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/0.3.png b/chess_gui/public/i/0.3.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/0.3.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/0.4.png b/chess_gui/public/i/0.4.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/0.4.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/0.5.png b/chess_gui/public/i/0.5.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/0.5.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/0.6.png b/chess_gui/public/i/0.6.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/0.6.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/0.7.png b/chess_gui/public/i/0.7.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/0.7.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/0b0.png b/chess_gui/public/i/0b.png similarity index 100% rename from chess_gui/public/i/0b0.png rename to chess_gui/public/i/0b.png diff --git a/chess_gui/public/i/0b1.png b/chess_gui/public/i/0b1.png deleted file mode 120000 index 59edee4..0000000 --- a/chess_gui/public/i/0b1.png +++ /dev/null @@ -1 +0,0 @@ -w/bishop.png \ No newline at end of file diff --git a/chess_gui/public/i/0k0.png b/chess_gui/public/i/0k.png similarity index 100% rename from chess_gui/public/i/0k0.png rename to chess_gui/public/i/0k.png diff --git a/chess_gui/public/i/0n0.png b/chess_gui/public/i/0n.png similarity index 100% rename from chess_gui/public/i/0n0.png rename to chess_gui/public/i/0n.png diff --git a/chess_gui/public/i/0n1.png b/chess_gui/public/i/0n1.png deleted file mode 120000 index dc299fe..0000000 --- a/chess_gui/public/i/0n1.png +++ /dev/null @@ -1 +0,0 @@ -w/knight.png \ No newline at end of file diff --git a/chess_gui/public/i/0p0.png b/chess_gui/public/i/0p.png similarity index 100% rename from chess_gui/public/i/0p0.png rename to chess_gui/public/i/0p.png diff --git a/chess_gui/public/i/0p1.png b/chess_gui/public/i/0p1.png deleted file mode 120000 index 380a247..0000000 --- a/chess_gui/public/i/0p1.png +++ /dev/null @@ -1 +0,0 @@ -w/pawn.png \ No newline at end of file diff --git a/chess_gui/public/i/0p2.png b/chess_gui/public/i/0p2.png deleted file mode 120000 index 380a247..0000000 --- a/chess_gui/public/i/0p2.png +++ /dev/null @@ -1 +0,0 @@ -w/pawn.png \ No newline at end of file diff --git a/chess_gui/public/i/0p3.png b/chess_gui/public/i/0p3.png deleted file mode 120000 index 380a247..0000000 --- a/chess_gui/public/i/0p3.png +++ /dev/null @@ -1 +0,0 @@ -w/pawn.png \ No newline at end of file diff --git a/chess_gui/public/i/0p4.png b/chess_gui/public/i/0p4.png deleted file mode 120000 index 380a247..0000000 --- a/chess_gui/public/i/0p4.png +++ /dev/null @@ -1 +0,0 @@ -w/pawn.png \ No newline at end of file diff --git a/chess_gui/public/i/0p5.png b/chess_gui/public/i/0p5.png deleted file mode 120000 index 380a247..0000000 --- a/chess_gui/public/i/0p5.png +++ /dev/null @@ -1 +0,0 @@ -w/pawn.png \ No newline at end of file diff --git a/chess_gui/public/i/0p6.png b/chess_gui/public/i/0p6.png deleted file mode 120000 index 380a247..0000000 --- a/chess_gui/public/i/0p6.png +++ /dev/null @@ -1 +0,0 @@ -w/pawn.png \ No newline at end of file diff --git a/chess_gui/public/i/0p7.png b/chess_gui/public/i/0p7.png deleted file mode 120000 index 380a247..0000000 --- a/chess_gui/public/i/0p7.png +++ /dev/null @@ -1 +0,0 @@ -w/pawn.png \ No newline at end of file diff --git a/chess_gui/public/i/0q0.png b/chess_gui/public/i/0q.png similarity index 100% rename from chess_gui/public/i/0q0.png rename to chess_gui/public/i/0q.png diff --git a/chess_gui/public/i/0r0.png b/chess_gui/public/i/0r.png similarity index 100% rename from chess_gui/public/i/0r0.png rename to chess_gui/public/i/0r.png diff --git a/chess_gui/public/i/0r1.png b/chess_gui/public/i/0r1.png deleted file mode 120000 index 1c34e6a..0000000 --- a/chess_gui/public/i/0r1.png +++ /dev/null @@ -1 +0,0 @@ -w/rook.png \ No newline at end of file diff --git a/chess_gui/public/i/1.0.png b/chess_gui/public/i/1.0.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/1.0.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/1.1.png b/chess_gui/public/i/1.1.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/1.1.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/1.2.png b/chess_gui/public/i/1.2.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/1.2.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/1.3.png b/chess_gui/public/i/1.3.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/1.3.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/1.4.png b/chess_gui/public/i/1.4.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/1.4.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/1.5.png b/chess_gui/public/i/1.5.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/1.5.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/1.6.png b/chess_gui/public/i/1.6.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/1.6.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/1.7.png b/chess_gui/public/i/1.7.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/1.7.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/1b0.png b/chess_gui/public/i/1b.png similarity index 100% rename from chess_gui/public/i/1b0.png rename to chess_gui/public/i/1b.png diff --git a/chess_gui/public/i/1b1.png b/chess_gui/public/i/1b1.png deleted file mode 120000 index 2b98e6e..0000000 --- a/chess_gui/public/i/1b1.png +++ /dev/null @@ -1 +0,0 @@ -b/bishop.png \ No newline at end of file diff --git a/chess_gui/public/i/1k0.png b/chess_gui/public/i/1k.png similarity index 100% rename from chess_gui/public/i/1k0.png rename to chess_gui/public/i/1k.png diff --git a/chess_gui/public/i/1n0.png b/chess_gui/public/i/1n.png similarity index 100% rename from chess_gui/public/i/1n0.png rename to chess_gui/public/i/1n.png diff --git a/chess_gui/public/i/1n1.png b/chess_gui/public/i/1n1.png deleted file mode 120000 index 4846c1d..0000000 --- a/chess_gui/public/i/1n1.png +++ /dev/null @@ -1 +0,0 @@ -b/knight.png \ No newline at end of file diff --git a/chess_gui/public/i/1p0.png b/chess_gui/public/i/1p.png similarity index 100% rename from chess_gui/public/i/1p0.png rename to chess_gui/public/i/1p.png diff --git a/chess_gui/public/i/1p1.png b/chess_gui/public/i/1p1.png deleted file mode 120000 index d543143..0000000 --- a/chess_gui/public/i/1p1.png +++ /dev/null @@ -1 +0,0 @@ -b/pawn.png \ No newline at end of file diff --git a/chess_gui/public/i/1p2.png b/chess_gui/public/i/1p2.png deleted file mode 120000 index d543143..0000000 --- a/chess_gui/public/i/1p2.png +++ /dev/null @@ -1 +0,0 @@ -b/pawn.png \ No newline at end of file diff --git a/chess_gui/public/i/1p3.png b/chess_gui/public/i/1p3.png deleted file mode 120000 index d543143..0000000 --- a/chess_gui/public/i/1p3.png +++ /dev/null @@ -1 +0,0 @@ -b/pawn.png \ No newline at end of file diff --git a/chess_gui/public/i/1p4.png b/chess_gui/public/i/1p4.png deleted file mode 120000 index d543143..0000000 --- a/chess_gui/public/i/1p4.png +++ /dev/null @@ -1 +0,0 @@ -b/pawn.png \ No newline at end of file diff --git a/chess_gui/public/i/1p5.png b/chess_gui/public/i/1p5.png deleted file mode 120000 index d543143..0000000 --- a/chess_gui/public/i/1p5.png +++ /dev/null @@ -1 +0,0 @@ -b/pawn.png \ No newline at end of file diff --git a/chess_gui/public/i/1p6.png b/chess_gui/public/i/1p6.png deleted file mode 120000 index d543143..0000000 --- a/chess_gui/public/i/1p6.png +++ /dev/null @@ -1 +0,0 @@ -b/pawn.png \ No newline at end of file diff --git a/chess_gui/public/i/1p7.png b/chess_gui/public/i/1p7.png deleted file mode 120000 index d543143..0000000 --- a/chess_gui/public/i/1p7.png +++ /dev/null @@ -1 +0,0 @@ -b/pawn.png \ No newline at end of file diff --git a/chess_gui/public/i/1q0.png b/chess_gui/public/i/1q.png similarity index 100% rename from chess_gui/public/i/1q0.png rename to chess_gui/public/i/1q.png diff --git a/chess_gui/public/i/1r0.png b/chess_gui/public/i/1r.png similarity index 100% rename from chess_gui/public/i/1r0.png rename to chess_gui/public/i/1r.png diff --git a/chess_gui/public/i/1r1.png b/chess_gui/public/i/1r1.png deleted file mode 120000 index 4a478e4..0000000 --- a/chess_gui/public/i/1r1.png +++ /dev/null @@ -1 +0,0 @@ -b/rook.png \ No newline at end of file diff --git a/chess_gui/public/i/2.0.png b/chess_gui/public/i/2.0.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/2.0.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/2.1.png b/chess_gui/public/i/2.1.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/2.1.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/2.2.png b/chess_gui/public/i/2.2.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/2.2.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/2.3.png b/chess_gui/public/i/2.3.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/2.3.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/2.4.png b/chess_gui/public/i/2.4.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/2.4.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/2.5.png b/chess_gui/public/i/2.5.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/2.5.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/2.6.png b/chess_gui/public/i/2.6.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/2.6.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/2.7.png b/chess_gui/public/i/2.7.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/2.7.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/3.0.png b/chess_gui/public/i/3.0.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/3.0.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/3.1.png b/chess_gui/public/i/3.1.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/3.1.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/3.2.png b/chess_gui/public/i/3.2.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/3.2.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/3.3.png b/chess_gui/public/i/3.3.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/3.3.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/3.4.png b/chess_gui/public/i/3.4.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/3.4.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/3.5.png b/chess_gui/public/i/3.5.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/3.5.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/3.6.png b/chess_gui/public/i/3.6.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/3.6.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/3.7.png b/chess_gui/public/i/3.7.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/3.7.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/4.0.png b/chess_gui/public/i/4.0.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/4.0.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/4.1.png b/chess_gui/public/i/4.1.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/4.1.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/4.2.png b/chess_gui/public/i/4.2.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/4.2.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/4.3.png b/chess_gui/public/i/4.3.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/4.3.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/4.4.png b/chess_gui/public/i/4.4.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/4.4.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/4.5.png b/chess_gui/public/i/4.5.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/4.5.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/4.6.png b/chess_gui/public/i/4.6.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/4.6.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/4.7.png b/chess_gui/public/i/4.7.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/4.7.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/5.0.png b/chess_gui/public/i/5.0.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/5.0.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/5.1.png b/chess_gui/public/i/5.1.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/5.1.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/5.2.png b/chess_gui/public/i/5.2.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/5.2.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/5.3.png b/chess_gui/public/i/5.3.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/5.3.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/5.4.png b/chess_gui/public/i/5.4.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/5.4.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/5.5.png b/chess_gui/public/i/5.5.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/5.5.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/5.6.png b/chess_gui/public/i/5.6.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/5.6.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/5.7.png b/chess_gui/public/i/5.7.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/5.7.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/6.0.png b/chess_gui/public/i/6.0.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/6.0.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/6.1.png b/chess_gui/public/i/6.1.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/6.1.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/6.2.png b/chess_gui/public/i/6.2.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/6.2.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/6.3.png b/chess_gui/public/i/6.3.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/6.3.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/6.4.png b/chess_gui/public/i/6.4.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/6.4.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/6.5.png b/chess_gui/public/i/6.5.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/6.5.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/6.6.png b/chess_gui/public/i/6.6.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/6.6.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/6.7.png b/chess_gui/public/i/6.7.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/6.7.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/7.0.png b/chess_gui/public/i/7.0.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/7.0.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/7.1.png b/chess_gui/public/i/7.1.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/7.1.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/7.2.png b/chess_gui/public/i/7.2.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/7.2.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/7.3.png b/chess_gui/public/i/7.3.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/7.3.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/7.4.png b/chess_gui/public/i/7.4.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/7.4.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/7.5.png b/chess_gui/public/i/7.5.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/7.5.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/7.6.png b/chess_gui/public/i/7.6.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/7.6.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/i/7.7.png b/chess_gui/public/i/7.7.png deleted file mode 120000 index d8fd813..0000000 --- a/chess_gui/public/i/7.7.png +++ /dev/null @@ -1 +0,0 @@ -dummy.gif \ No newline at end of file diff --git a/chess_gui/public/js/dand.js b/chess_gui/public/js/dand.js index 943bf4d..8560f1b 100644 --- a/chess_gui/public/js/dand.js +++ b/chess_gui/public/js/dand.js @@ -1,48 +1,123 @@ +var d; var drag; var drop; var xhr = new XMLHttpRequest(); -//xhr.open('GET', 'data/move.json', true); +//var e = document.createElement('li'); +//var f = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']; +var d = document.createElement('dl'); for (b=0; C('coord').length > b; b++) {C('coord')[b].onmousedown = function () { event.preventDefault(); -//drop = null; drag = this.id; }} -for (b=0; C('coord').length > b; b++) {C('coord')[b].onmouseup = function () { +for (c=0; C('coord').length > c; c++) {C('coord')[c].onmouseup = function () { drop = this.id; -//if (drop !== undefined && drag !== undefined) {console.log(drag + ' -> ' + drop)} -//if (drop !== undefined && drop !== null && drag !== undefined && drag !== null) { //console.log(this); -if (drop.length === 3 && drag.length === 3) { //console.log(this); +console.log(this.id); +if (drag.length === 2 && drop.length === 2) { // Shouldn't rely on legal input here. xhr.open('GET', 'move/' + drag + '/' + drop , true); -//xhr.send(drag + ',' + drop); xhr.send(null); xhr.onload = function () { if (xhr.status === 200) { responseObject = JSON.parse(xhr.responseText); -if (responseObject.w.status.length === 1 || responseObject.w.status[1] !== 0) { -I(drag).setAttribute('src', 'i/' + responseObject.w.src[0] + '.png'); -I(drop).setAttribute('src', 'i/' + responseObject.w.src[1] + '.png'); -I(drag).id = responseObject.w.src[0]; -I(drop).id = responseObject.w.src[1]; +//if (responseObject.White.status.length === 2 && responseObject.Black.status.length === 2) {} +if (responseObject.White.status[1] === 0 && responseObject.Black.status[1] === 0) { // Legal move(s)? +//if (responseObject.White.status[5] === 1) { // Won? +//} +//I(drag).setAttribute('src', 'i/' + responseObject.White.src[0] + '.png'); +//I(drop).setAttribute('src', 'i/' + responseObject.White.src[1] + '.png'); +//I(drag).id = responseObject.White.src[0]; +//I(drop).id = responseObject.White.src[1]; +//I(responseObject.White.src[1]).setAttribute('src', 'i/' + responseObject.White.src[0] + '.png'); +//I(responseObject.White.dst[responseObject.White.dst.length-1]).setAttribute('src', 'i/' + responseObject.White.src[1] + '.png'); +//I(responseObject.White.src[1]).id = responseObject.White.src[0]; +//I(responseObject.White.dst[responseObject.White.dst.length-1]).id = responseObject.White.src[1]; + +var salt = I(responseObject.White.src[1]).getAttribute('alt'); +salt = salt.substring(0, salt.length-2) + responseObject.White.dst[0]; +I(responseObject.White.src[1]).setAttribute('alt', salt); +var srci = I(responseObject.White.src[0]).innerHTML; // Duplicate. +I(responseObject.White.src[0]).innerHTML = ''; // Remove. +I(responseObject.White.dst[0]).innerHTML = srci; // Add. + +//I(responseObject.Black.src[1]).setAttribute('src', 'i/' + responseObject.Black.src[0] + '.png'); +//I(responseObject.Black.dst[responseObject.Black.dst.length-1]).setAttribute('src', 'i/' + responseObject.Black.src[1] + '.png'); +//I(responseObject.Black.src[1]).id = responseObject.Black.src[0]; +//I(responseObject.Black.dst[responseObject.Black.dst.length-1]).id = responseObject.Black.src[1]; + +var salt = I(responseObject.Black.src[1]).getAttribute('alt'); +salt = salt.substring(0, salt.length-2) + responseObject.Black.dst[0]; +I(responseObject.Black.src[1]).setAttribute('alt', salt); +var srci = I(responseObject.Black.src[0]).innerHTML; // Duplicate. +I(responseObject.Black.src[0]).innerHTML = ''; // Remove. +I(responseObject.Black.dst[0]).innerHTML = srci; // Add. + +if (responseObject.White.status[0] === 1) { // black.status[0] should be 1, too. +var section = document.createElement('section'); +section.setAttribute('id', 'log'); +document.body.insertBefore(section, T('script')[1]); +//d = document.createElement('ol'); +section.appendChild(d); +} +var li = document.createElement('li'); +var dt = document.createElement('dt'); +var figure = document.createElement('figure'); +var i = document.createElement('img'); +var figcaption = document.createElement('figcaption'); +var dd = document.createElement('dd'); +d.appendChild(li); +li.appendChild(figure); +i.setAttribute('src', 'i/' + responseObject.White.src[1].substring(0, 2) + '.png'); +figure.appendChild(i); +figure.appendChild(dt); +//e.setAttribute('class', 'movement'); +//d = document.createElement('img'); +//d.setAttribute('class', 'ooc'); + +//i.setAttribute('alt', f[Math.floor(responseObject.White.dst[0])] + ((responseObject.White.dst[0]) * 10 + 1 - Math.floor(responseObject.White.dst[0]) * 10)); +//figcaption.appendChild(document.createTextNode(f[Math.floor(responseObject.White.src[0])] + ((responseObject.White.src[0]) * 10 + 1 - Math.floor(responseObject.White.src[0]) * 10))); +figcaption.appendChild(document.createTextNode(responseObject.White.src[0])); +dt.appendChild(figcaption); +//dd.setAttribute('class', 'old'); +//li.appendChild(dd); +//dd.appendChild(document.createTextNode(f[Math.floor(responseObject.White.src[0])] + ((responseObject.White.src[0]) * 10 + 1 - Math.floor(responseObject.White.src[0]) * 10))); // Convert x-coordinate to the chess' counterpart (while avoiding (inaccurate) floats). +//var dd2 = document.createElement('dd'); +//dd.setAttribute('class', 'new'); +figure.appendChild(dd); +//dd.appendChild(document.createTextNode(f[responseObject.White.dst[0])] + ((responseObject.White.dst[0]) * 10 + 1 - Math.floor(responseObject.White.dst[0]) * 10))); +dd.appendChild(document.createTextNode(responseObject.White.dst[0])); +d.appendChild(li); + +var dt = document.createElement('dt'); +var figure = document.createElement('figure'); +var i = document.createElement('img'); +var figcaption = document.createElement('figcaption'); +var dd = document.createElement('dd'); + +li.appendChild(figure); +i.setAttribute('src', 'i/' + responseObject.Black.src[1].substring(0, 2) + '.png'); +figure.appendChild(i); +figure.appendChild(dt); +//figcaption.appendChild(document.createTextNode(f[Math.floor(responseObject.Black.src[0])] + ((responseObject.Black.src[0]) * 10 + 1 - Math.floor(responseObject.Black.src[0]) * 10))); +figcaption.appendChild(document.createTextNode(responseObject.Black.src[0])); +dt.appendChild(figcaption); +figure.appendChild(dd); +//dd.appendChild(document.createTextNode(f[Math.floor(responseObject.Black.dst[0])] + ((responseObject.Black.dst[0]) * 10 + 1 - Math.floor(responseObject.Black.dst[0]) * 10))); +dd.appendChild(document.createTextNode(responseObject.Black.dst[0])); +d.appendChild(li); +} // TODO: Display status and/or sleep. -I('title').innerHTML = responseObject.b.src[1] + ' moves from ' + responseObject.b.src[0] + ' to ' + responseObject.b.dst[0]; -if (responseObject.b.dst.length === 2) {I('title').innerHTML += ' and takes ' + responseObject.b.dst[1]} -I('description').innerHTML = 'Turn ' + responseObject.w.status.length + ' of white.'; -//I('title').innerHTML = responseObject.b.status[0]; -//I('description').innerHTML = responseObject.b.status[1]; - -I(responseObject.b.src[1]).setAttribute('src', 'i/' + responseObject.b.src[0] + '.png'); -I(responseObject.b.dst[responseObject.b.dst.length-1]).setAttribute('src', 'i/' + responseObject.b.src[1] + '.png'); -I(responseObject.b.src[1]).id = responseObject.b.src[0]; -I(responseObject.b.dst[responseObject.b.dst.length-1]).id = responseObject.b.src[1]; +//I('title').innerHTML = responseObject.Black.src[1] + ' moves from ' + responseObject.Black.src[0] + ' to ' + responseObject.Black.dst[0]; +//if (responseObject.Black.dst.length === 2) {I('title').innerHTML += ' and takes ' + responseObject.Black.dst[1]} +//I('description').innerHTML = 'Turn ' + responseObject.White.status.length + ' of white.'; +//I('title').innerHTML = responseObject.Black.status[0]; +//I('description').innerHTML = responseObject.Black.status[1]; } } }; } -//drag = null; -}} +} //for (b=0; C('coord').length > b; b++) {C('coord')[b].onmousemove = function () { //if (drag !== null && drag !== undefined) {console.log(this.x + '.' + this.y)} diff --git a/chess_gui/public/js/head.js b/chess_gui/public/js/head.js index aa42426..4ac12eb 100644 --- a/chess_gui/public/js/head.js +++ b/chess_gui/public/js/head.js @@ -1,6 +1,18 @@ function I(a) { return document.getElementById(a); } + function C(a) { return document.getElementsByClassName(a); } + +function T(a) { + return document.getElementsByTagName(a); +} + +if (window.localStorage) { +var m = C('coord'); +if (m.length === 64) { + +} +} diff --git a/chess_gui/public/lllll b/chess_gui/public/lllll new file mode 100644 index 0000000..220c60c --- /dev/null +++ b/chess_gui/public/lllll @@ -0,0 +1,10 @@ +use warnings; +use strict; +my @pages; +@pages = { url => 'http://foo.org', + title => 'The Foo Organisation' + }, + { url => 'http://bar.org', + title => 'The Bar Organisation' + }; +print $pages[0]{'url'}; diff --git a/chess_gui/views/index.tt b/chess_gui/views/index.tt index 7f84aa6..5fba479 100644 --- a/chess_gui/views/index.tt +++ b/chess_gui/views/index.tt @@ -10,13 +10,8 @@ Game of chess -
-

-

-
-
-
    1. A
    2. B
    3. C
    4. D
    5. E
    6. F
    7. G
    8. H
    [% FOREACH row IN board %]
    1. [% FOREACH item IN row %]
    2. [% END %]
  1. [% END %] - +
    +
      1. A
      2. B
      3. C
      4. D
      5. E
      6. F
      7. G
      8. H
      [% FOREACH row IN board %]
      1. [% FOREACH object IN row %][% IF object.isPiece %]
      2. [% GET object.prettyName %] on [% GET object.pco %]
      3. [% ELSE %]
      4. [% END %][% END %]
    1. [% END %]

      • Options