Source of “index.php”.
75 lines, 2.8 KBytes.   Last modified 12:02 am, 18th September 2016 PDT.
1 <?php // Emacs settings: -*- mode: Fundamental; tab-width: 4; -*- 2 3 //////////////////////////////////////////////////////////////////////////// 4 // // 5 // Minesweeper, implemented in JavaScript // 6 // // 7 // Copyright 1998-2007, Andrew D. Birrell // 8 // // 9 // PHP for main page // 10 // // 11 //////////////////////////////////////////////////////////////////////////// 12 13 $cols = 8; 14 $rows = 8; 15 $mines = 10; 16 17 header("Content-Type: text/html; charset=UTF-8"); 18 19 ?> 20 <!DOCTYPE HTML> 21 <HTML manifest="manifest.php"> 22 <HEAD> 23 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> 24 <META NAME="Description" CONTENT="The classic Minesweeper game, with 25 three difficulty levels, running entirely in your web browser. Works 26 when you are offline. No ads."> 27 <meta name="viewport" content="width=440"> 28 <SCRIPT TYPE="text/javascript" SRC="minesweeper.js"></SCRIPT> 29 <LINK HREF="minesweeper.css" REL=stylesheet> 30 <style type="text/css"> 31 #sqTable { 32 float: right; 33 margin-left: 1em; 34 } 35 </style> 36 <TITLE>Minesweeper in Javascript</TITLE> 37 </HEAD> 38 <BODY onload="init(<?php echo "$cols, " . ($cols*$rows) . ", $mines" ?>)"> 39 <DIV CLASS="main limited"> 40 <?php require("minesweeper.php") ?> 41 <DIV CLASS=title> 42 <IMG SRC="../titles/minesweeper.png" ALT="Minesweeper"> 43 </DIV> 44 Clear the mines! 45 Expose squares one at a time by clicking on them. 46 If the square you click on is vacant, you'll get to see how many of its 47 neighbors have mines in them (0 through 8); 48 but if the square has a mine in it, all the mines will explode. 49 <P> 50 Shift-click (or right-click) on a square to flag it as a suspected mine. 51 Do it again to mark it as questionable, and again to clear the mark. 52 When you've exposed all the vacant squares, you win. 53 If a mine explodes, you lose. 54 Click on the face to start a new game. 55 <P> 56 The left-hand counter shows the number of mines less the number of squares 57 that you've flagged (correctly or not). 58 <P> 59 The version on this page is 8 by 8 with 10 mines. 60 See also the <A HREF="intermediate.php">intermediate</A> 61 (16 by 16 with 40 mines) and <A HREF="expert.php">expert</A> 62 (30 by 16 with 99 mines) versions. 63 <!-- There's also an <A HREF="java.html">older version</A>, 64 which was written in Java. --> 65 </P> 66 This program is written in Javascript, by 67 <A HREF="../me/">Andrew Birrell</A>. 68 You are welcome to read its <A HREF="source.php">source code</A>. 69 Use at your own risk! 70 <HR CLASS=decoration> 71 <?php require("../parts/goHome-php.txt") ?> 72 &nbsp; 73 </DIV> 74 </BODY> 75 </HTML>
End of listing