Skip to content

Commit

Permalink
compue latest minesweeper solve automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
cesque committed Feb 6, 2024
1 parent 1c56e16 commit 4ea62d4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
22 changes: 22 additions & 0 deletions data/minesweeperPB.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import solves from '@/data/minesweeperSolves.json'
import { DateTime } from 'luxon'

let pb = Infinity
let latest = '1970-01-01'

for (let solve of solves) {
if (solve.duration < pb) {
pb = solve.duration / 1000
}

if (solve.finishedAt.localeCompare(latest) > 0) {
latest = solve.finishedAt
}
}

const latestDate = DateTime.fromISO(latest).toISODate()

export {
pb,
latestDate
}
5 changes: 3 additions & 2 deletions posts/minesweeper.mdx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import MinesweeperGraph from '@/components/MinesweeperGraph/MinesweeperGraph'
import { pb, latestDate } from '@/data/minesweeperPB'

export const meta = {
title: 'Minesweeper',
tags: ['games'],
}

I started playing Minesweeper on an online site in April 2023, primarily on Expert difficulty (30×16 grid, 99 mines). My current PB time is **91.109**s.
I started playing Minesweeper on an online site in April 2023, primarily on Expert difficulty (30×16 grid, 99 mines). My current PB time is <b>{ pb }</b>s.

This is a graph of my completed Expert solves since then, as of 2024-02-06:
This is a graph of my completed Expert solves since then, as of { latestDate }:

<MinesweeperGraph />

Expand Down

0 comments on commit 4ea62d4

Please sign in to comment.