&unotifies)
{
string error;
VARVAL notify_var;
notify_var.var = VAR_NOTIFY;
setactivity();
if (strcmp(var,"print")==0){
string lines;
unsigned dim = sp.width < sp.height ? sp.width : sp.height;
unsigned width = dim - dim % 4;
//unsigned height = win_height - win_height % 3;
unsigned w3 = width/4;
unsigned h3 = w3;
unsigned grid_width = w3*3;
unsigned grid_height = grid_width;
lines += "\n";
lines += string_f("\n");
documentd_button_start(lines,gameid);
documentd_button_label(lines,MSG_R(I_NEWGAME));
documentd_button (lines,0,MSG_U(I_RESTART,"Restart"),false);
documentd_button_end(lines);
lines += "
\n";
lines += string_f("\n",val);
lines += string_f("
\n";
lines += " ";
lines += string_f("
\n";
lines += "
\n";
lines += "\n";
VARVAL v;
v.var = VAR_CONTENT;
v.val = lines;
res.push_back(v);
}else if (ctx.maywrite){
if (strcmp(var,"place")==0){
bool ok = false;
unsigned x=atoi(val);
const char *pt = str_skipdig(val);
const char *msg = "Invalid syntax";
if (*pt == ','){
pt++;
unsigned y=atoi(pt);
pt = str_skipdig(pt);
if (*pt == '\0'){
msg = "Invalid values";
if (x < 3 && y < 3){
unsigned char &g = grid[y][x];
if (g == 0){
g = x_is_player ? 1 : 2;
js_find_loop_start_class(notify_var.val,"gamegrid","x_o");
notify_var.val += "\t\tfor (var i=0; i 0) res.emplace_back(notify_var);
if (error.size() > 0){
update_msg(false,error,"red",res);
}else{
update_msg(false,"","white",res);
}
}