Use negative IDs for guess list

main
Pk11 2 years ago
parent 17daeb2f39
commit f0144339cb

File diff suppressed because one or more lines are too long

@ -107,6 +107,14 @@ function add_words($datestamp) {
break; break;
$word = json_decode($content, true); $word = json_decode($content, true);
// The Times' IDs for guess list answers don't seem to have any
// relation to the sorted list, so we're doing our own which is:
// The index in the guess list array, but 1 indexed and negative
require_once('word_lists.php');
if($word['id'] > count(CHOICES)) {
$word['id'] = -(array_search(strtoupper($word['solution']), GUESSES) + 1);
}
// Add word to database // Add word to database
$query = 'INSERT INTO words (id, solution, print_date, days_since_launch, editor) ' . $query = 'INSERT INTO words (id, solution, print_date, days_since_launch, editor) ' .

Loading…
Cancel
Save