From bc169129d93b40e17e94c24da21bd19c68c5d492 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Tue, 24 Sep 2019 21:20:12 +0000
Subject: [PATCH] Moved to xtrn/minesweeper Created sysop documentation (.txt
 file)

If you were a lucky "early adopter" and had rev 1.7 running on your BBS

you probably noticed the following important changes introduced in rev 1.8:
* exec/minesweeper.js was moved to xtrn/minesweeper/minesweeper.js
* text/minesweeper.hlp was moved to xtrn/minesweeper/minesweeper.hlp

* data/minesweeper.json was moved to xtrn/minesweeper/winners.jsonl



If you already had game winners and want to retain them in the list, copy
or rename the data/minesweeper.jsonl to xtrn/minesweeper/winners.jsonl.
If you don't care, the game will run fine and new winners will be added to
the new/correct filename.
---
 xtrn/minesweeper/minesweeper.js |  13 ++--
 xtrn/minesweeper/readme.txt     | 128 ++++++++++++++++++++++++++++++++
 2 files changed, 136 insertions(+), 5 deletions(-)
 create mode 100644 xtrn/minesweeper/readme.txt

diff --git a/xtrn/minesweeper/minesweeper.js b/xtrn/minesweeper/minesweeper.js
index 9df46d6a88..56aa2a7d92 100644
--- a/xtrn/minesweeper/minesweeper.js
+++ b/xtrn/minesweeper/minesweeper.js
@@ -7,6 +7,7 @@
 //
 // Name                       Synchronet Minesweeper
 // Internal Code              MSWEEPER
+// Start-up Directory         ../xtrn/minesweeper
 // Command Line               ?minesweeper
 // Multiple Concurrent Users  Yes
 
@@ -17,20 +18,22 @@
 //
 // Name                       Synchronet Minesweeper Winners
 // Internal Code              MSWINNER
+// Start-up Directory         ../xtrn/minesweeper
 // Command Line               ?minesweeper winners
 // Multiple Concurrent Users  Yes
 // Execute on Event           Logon, Only
 
 // Command-line arguments supported:
 //
-// "winners" - display list of top-X winners and exit
-// "nocls"   - don't clear the screen upon exit
-// <level>   - set the initial game difficulty level (1-5, don't prompt)
+// "winners [num]" 	- display list of top-[num] winners and exit
+// "nocls"   		- don't clear the screen upon exit
+// <level>   		- set the initial game difficulty level (1-5, don't prompt)
 
 // ctrl/modopts.ini [minesweeper] options (with default values):
 // sub = syncdata
 // timelimit = 60
 // winners = 20
+// difficulty = 0 ; 0 = prompt user, 1-5 to set default difficulty (no prompt)
 
 "use strict";
 
@@ -38,8 +41,8 @@ const title = "Synchronet Minesweeper";
 const REVISION = "$Revision$".split(' ')[1];
 const author = "Digital Man";
 const header_height = 4;
-const winners_list = system.data_dir + "minesweeper.jsonl";
-const help_file = system.text_dir + "minesweeper.hlp";
+const winners_list = js.exec_dir + "winners.jsonl";
+const help_file = js.exec_dir + "minesweeper.hlp";
 const max_difficulty = 5;
 const min_mine_density = 0.10;
 const mine_density_multiplier = 0.025;
diff --git a/xtrn/minesweeper/readme.txt b/xtrn/minesweeper/readme.txt
new file mode 100644
index 0000000000..7c6ebb9d10
--- /dev/null
+++ b/xtrn/minesweeper/readme.txt
@@ -0,0 +1,128 @@
+Synchronet Minesweeper - Sysop Documentation
+============================================
+It's the classic game you know and love, written from scratch for Synchronet
+BBS in JavaScript (ES5).
+
+by Digital Man, September 2019
+
+Details
+-------
+The objective was to try to mimic the old Microsoft versions of the game that
+I remember playing in the 1990's, but support more difficulty levels (5) and
+maximize the number of cells usable in terminals, while keeping the game
+playable and easy on the eyes (my daughter, Emma, helped with the color scheme,
+as she is *not* colorblind). There's no mouse support; use the keyboard.
+
+Multiple users can be play the game simultaneously, but there is no inter-user
+interaction of any kind. The normal Synchronet inter-node paging/listing
+controls (Ctrl-P/U) are disabled while running the game.
+
+The game supports ANSI and PETSCII terminals from display widths (columns) of
+40 to 132+ and heights (rows) of 24+.
+
+For more details on game play, see winesweeper.hlp (the "Help" text available
+while running the game).
+
+Winners
+-------
+The game winners are stored in an ever-growing line-delimited JSON file
+(winners.jsonl). If you ever want to reset the list of winners, you can just
+delete that file. The winners are ranked (sorted) first based on difficulty
+level (higher levels are harder) and then by elapsed game time (lower times are
+better). There are fractional difficulty levels (e.g. "3.3") to compensate for
+terminal size limitations (e.g. not all terminals can support a level 5 30x30
+game grid). The mine density (percentage of cells occupied by mines, based on
+selected difficulty level) is retained however, regardless of calculated/used
+game grid size.
+
+If you have a "syncdata" message area setup, your game winners will be
+automatically shared to that message base for visibility on other BBSes and
+when viewing your game winners, those from other Synchronet BBSes will also
+appear in the rankings.
+
+The "top X" value (number of winners) displayed is configurable, but defaults
+to 20. It's quite possible to "win" the game but not appear in the winners
+list depending on what other players have accomplished and the configured
+display threshold.
+
+Requirements
+------------
+Tested with Synchronet v3.17c (in development). Older versions of Synchronet
+(e.g. v3.17b) may work however.
+
+An up-to-date set of exec/load/*.js files (from cvs.synchronet) are needed.
+
+Install
+-------
+Add to SCFG->External Programs->Online Programs(Doors)->Games->
+Available Online Programs...
+
+    Name                       Synchronet Minesweeper       
+    Internal Code              MSWEEPER                     
+    Start-up Directory         ../xtrn/minesweeper          
+    Command Line               ?minesweeper                 
+    Clean-up Command Line                                   
+    Execution Cost             None                         
+    Access Requirements                                     
+    Execution Requirements                                  
+    Multiple Concurrent Users  Yes                          
+    Intercept I/O              No                           
+    Native Executable          No                           
+    Use Shell to Execute       No                           
+    Modify User Data           No                           
+    Execute on Event           No                           
+    Pause After Execution      No                           
+    BBS Drop File Type         None                         
+    Place Drop File In         Node Directory
+    
+Since it is a JavaScript module, most of the settings don't apply and should
+be left default/disabled/No/None.
+
+Optionally, if you want the top-X winners displayed after exiting game, set:
+    Clean-up Command Line      ?minesweeper winners
+
+If you want the top-x winners displayed during logon, create an additional
+program entry:
+
+    Name                       Synchronet Minesweeper Winners
+    Internal Code              MSWINNER
+    Start-up Directory         ../xtrn/minesweeper
+    Command Line               ?minesweeper winners
+    ...
+    Execute on Event           Logon, Only
+
+Configure
+---------
+Command-line arguments supported:
+
+"winners [num]"	- display list of top-[num] winners and exit
+"nocls"   		- don't clear the screen upon exit
+<level>   		- set the initial game difficulty level (1-5, don't prompt)
+
+The ctrl/modopts.ini may contain a [minesweeper] section. The following
+options are supported (with default values):
+    sub = syncdata
+    timelimit = 60
+    winners = 20
+    difficulty = 0
+
+If you do not want the user to be prompted to select a difficulty level when
+running the game, set the difficulty level in the modopts.ini file or on the
+command-line. The user can still change/choose a difficulty level when starting
+a new game.
+
+Upgrade
+-------
+If you were a lucky "early adopter" and had rev 1.7 running on your BBS,
+you probably noticed the following important changes introduced in rev 1.8:
+    
+    * exec/minesweeper.js was moved to xtrn/minesweeper/minesweeper.js
+    * text/minesweeper.hlp was moved to xtrn/minesweeper/minesweeper.hlp
+    * data/minesweeper.json was moved to xtrn/minesweeper/winners.jsonl
+    
+If you already had game winners and want to retain them in the list, copy or
+rename the data/minesweeper.jsonl to xtrn/minesweeper/winners.jsonl. If you
+don't care, the game will run fine and new winners will be added to the
+new/correct filename.
+
+$Id$
-- 
GitLab