X-Git-Url: https://git.cworth.org/git?p=lmno.games;a=blobdiff_plain;f=scribe%2Fscribe.jsx;h=3caf03c87d313ab3e582bfc68bb0da020143c6dd;hp=be0de3799acf1f6bedaeb2171de86e9588832c38;hb=89b7f6b2d8cf6f237310dad0a8f1d796fb98862a;hpb=656345d535b978e92cd9da0801a28f4571aaa6f2 diff --git a/scribe/scribe.jsx b/scribe/scribe.jsx index be0de37..3caf03c 100644 --- a/scribe/scribe.jsx +++ b/scribe/scribe.jsx @@ -165,6 +165,50 @@ function PlayerInfo(props) { ); } +function Glyph(props) { + + const glyph_dots = []; + + let last_square = 0; + for (let i = 0; i < 9; i++) { + if (props.squares[i]) + last_square = i; + } + + const height = Math.floor(20 * (Math.floor(last_square / 3) + 1)); + + const viewbox=`0 0 60 ${height}`; + + for (let row = 0; row < 3; row++) { + for (let col = 0; col < 3; col++) { + if (props.squares[3 * row + col]) { + let cy = 10 + 20 * row; + let cx = 10 + 20 * col; + glyph_dots.push( + + ); + } + } + } + + return (
+ {props.name} +
+ + + {glyph_dots} + + +
+
+ ); +} + function Square(props) { let className = "square"; @@ -268,7 +312,7 @@ class Game extends React.Component { game_info: {}, player_info: {}, other_players: [], - squares: Array(9).fill(null).map(() => Array(9).fill(null)), + squares: [...Array(9)].map(() => Array(9).fill(null)), moves: 0, next_to_play: "+" }; @@ -415,6 +459,122 @@ class Game extends React.Component { onClick={(i,j) => this.handle_click(i, j, first_move)} /> + , +
+ + + + + + + + + + + + + + + + + + +
]; }