Add jekyll-katex plugin

master
Tait Hoyem 4 years ago
parent f3e54a4d54
commit 1e231f784a

@ -1,23 +0,0 @@
---
title: "Minesweeper Bomb Generation And Tile Revealing"
layout: post
---
When I was creating a little Minesweeper game, I got confused at some points.
My bomb generation didn't look quite right, and I for sure didn't quite get the whole cascading tile reveal thing.
With a bit of internet research, I found what I was looking for.
I'll explain it all in one place for my own and others' purposes.
### Bomb Generation
When I started this project I attempted to use a random bomb generator.
By this I mean on each square, before it gets generated, give it a one in 15 change of being a bomb.
Personally, I'm not sure why this never looked right.
Something about the layout of the bombs did not mimic the classic Minesweeper game.
After looking at some open source Minesweeper examples, I found the following algorithms:
* `X = R % W`
* `Y = R // H`
Where % is a [modulo] operator

@ -7,6 +7,7 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem "jekyll"
group :jekyll_plugins do
gem 'jekyll-katex'
gem 'jekyll-sitemap'
gem 'jekyll-feed'
gem 'jekyll-seo-tag'

@ -10,6 +10,7 @@ GEM
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
eventmachine (1.2.7)
execjs (2.7.0)
ffi (1.12.1)
forwardable-extended (2.6.0)
http_parser.rb (0.6.0)
@ -36,6 +37,9 @@ GEM
sinatra-contrib (~> 1.4)
jekyll-feed (0.13.0)
jekyll (>= 3.7, < 5.0)
jekyll-katex (1.0.0)
execjs (~> 2.7)
jekyll (>= 3.6, < 5.0)
jekyll-sass-converter (2.0.1)
sassc (> 2.0.1, < 3.0)
jekyll-seo-tag (2.6.1)
@ -91,6 +95,7 @@ DEPENDENCIES
jekyll
jekyll-admin
jekyll-feed
jekyll-katex
jekyll-seo-tag
jekyll-sitemap

@ -1,2 +1,4 @@
plugins:
- jekyll-katex
highlihger: rouge

@ -1,18 +0,0 @@
---
title: "Math Test"
layout: default
---
<link rel="stylesheet" href="/assets/css/katex.css">
{% katex display %}
\pm\sqrt{a^2 + b^2}
{% endkatex %}
{% katex display %}
a^2 + b^2 = c^2
{% endkatex %}
{% katex display %}
\textcolor{blue} x = \frac{\textcolor{#47a}{-b\pm\sqrt{b^2-4ac}}}{2a}
{% endkatex %}
Loading…
Cancel
Save