1
0
Fork 0

Renamed Anagram Mastermind to Anagram Bagels to use generic, non-trademarked name.

feature/save-game
Daniel Perelman 5 years ago
parent 114bf1aa2e
commit 3b216000f9

@ -25,7 +25,7 @@ class LetterInfo {
this.knownNotHere = new Set();
}
}
class Mastermind {
class Bagels {
constructor(word, availableLetters) {
this.word = word;
this.numLetters = word.length;
@ -86,7 +86,7 @@ class Mastermind {
if (!availableLettersValid && iters++ > maxIters) return null;
} while (!availableLettersValid);
return new Mastermind(word, availableLetters);
return new Bagels(word, availableLetters);
}
static fromFragment(fragment) {
@ -103,7 +103,7 @@ class Mastermind {
if (!isValidWord(word)) return null;
if (word.length < 2) return null;
return new Mastermind(word, availableLetters);
return new Bagels(word, availableLetters);
}
catch(e) {
return null;

@ -1,10 +1,10 @@
CACHE MANIFEST
# Last updated: 2019-02-13 20:06 PST
# Last updated: 2019-02-27 19:57 PST
CACHE:
index.html
main.css
mastermind.js
bagels.js
../main.css
../random.js
../scramblestring.js

@ -3,17 +3,17 @@
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<title>Anagram Mastermind</title>
<title>Anagram Bagels</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<link rel="stylesheet" type="text/css" href="main.css" />
<script src="../random.js"></script>
<script src="../scramblestring.js"></script>
<script type="text/javascript" src="../wordlist/typo.js"></script>
<script src="../wordlist/wordlist.js"></script>
<script src="./mastermind.js"></script>
<script src="./bagels.js"></script>
<script src="../entryui.js"></script>
<script >
class MastermindUI extends AnagramEntryUI {
class BagelsUI extends AnagramEntryUI {
recolorAvailableLetters() {
let idx = this.focusedTextbox;
document.querySelectorAll('#available_letters button').forEach(b => {
@ -118,7 +118,7 @@
let game;
do {
game = Mastermind.generateRandom(settings);
game = Bagels.generateRandom(settings);
} while (game === null && window.confirm('Unable to generate puzzle with the given difficulty settings. Try again?'));
if (game !== null) this.initialize(game);
}
@ -134,7 +134,7 @@
return default_settings;
}
get settingsKey() {
return 'anagram-mastermind-settings';
return 'anagram-bagels-settings';
}
constructor(game) {
@ -209,10 +209,10 @@
let fragment = window.location.hash.substring(1);
return unscrambleString(fragment).then(unscrambled => {
history.pushState("", document.title, window.location.pathname + window.location.search);
return Mastermind.fromFragment(unscrambled);
return Bagels.fromFragment(unscrambled);
});
})
.then(game => new MastermindUI(game)));
.then(game => new BagelsUI(game)));
}
</script>
<template id="letter_entry">
@ -259,9 +259,11 @@
<h1>How to Play</h1>
<h2>Gameplay</h2>
<p>
Anagram Mastermind is a variant of the classic game
Anagram Bagels is a variant of the classic game Bagels (also
known as <a href="https://en.wikipedia.org/wiki/Bulls_and_Cows"
>Bulls and Cows</a> or
<a href="https://en.wikipedia.org/wiki/Mastermind_(board_game)"
>Mastermind</a> where the secret clue and guesses must all be
>Mastermind</a>) where the secret clue and guesses must all be
English words. The computer randomly selects a word and a set
of letters that may be used in guesses and tells you how many
letters are in the word. In response to each guess, the computer

@ -3,9 +3,9 @@
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<meta http-equiv="refresh" content="0; url=mastermind/" />
<meta http-equiv="refresh" content="0; url=bagels/" />
</head>
<body>
Redirecting to <a href="mastermind/">mastermind/</a>&hellip;
Redirecting to <a href="bagels/">bagels/</a>&hellip;
</body>
</html>

Loading…
Cancel
Save