Changeset 19 for trunk


Ignore:
Timestamp:
Dec 19, 2005, 6:42:47 AM (14 years ago)
Author:
jtv
Message:

Corrected "you win" logic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ui_web.c

    r13 r19  
    2222  "</head>"
    2323  "<body>\n",
     24youwin[] =
     25  "<h1>You win.  Congratulations!</h1>",
    2426footer[] =
    2527  "</body></html>\n"
     
    185187    if (!mines_togo(F))
    186188    {
    187       puts("<h1>You win.  Congratulations!</h1>");
     189      puts(youwin);
    188190      done=1;
    189191    }
    190     else if (coords_set && !mines_probe(F, atr, atc, 0))
    191     {
    192       puts("<h1>You lose!</h1>");
    193       /* TODO: Actually stop the game here! */
    194       done=1;
     192    else if (coords_set)
     193    {
     194      if (mines_probe(F, atr, atc, 0))
     195      {
     196    puts(youwin);
     197    done=1;
     198      }
     199      else
     200      {
     201        puts("<h1>You lose!</h1>");
     202        /* TODO: Actually stop the game here! */
     203        done=1;
     204      }
    195205    }
    196206
Note: See TracChangeset for help on using the changeset viewer.