Skip to content

Instantly share code, notes, and snippets.

/* Base styles and content styles */
:root {
/* Browser default font-size is 16px, this way 1 rem = 10px */
margin: 0;
padding: 0;
font-size: 62.5%; color-scheme: var(--color-scheme); }
html { margin: 0;
padding: 0; font-family: "Open Sans", sans-serif; color: var(--fg);
background-color: var(--bg); text-size-adjust: none;
@fabienhinault
fabienhinault / general.css
Created May 8, 2025 12:59
mdbook style for mobile phone
/* Base styles and content styles */
:root {
/* Browser default font-size is 16px, this way 1 rem = 10px */ margin: 0;
padding: 0; font-size: 62.5%; color-scheme: var(--color-scheme); }
html { margin: 0;
padding: 0;
font-family: "Open Sans", sans-serif;
color: var(--fg); background-color: var(--bg);
text-size-adjust: none;
const r = 'r';
const w = 'w';
const g = 'g';
const b = 'b';
const o = 'o';
const j = 'j';
const colors = new Map([['r', '31'], ['w', '37'], ['g', '32'], ['b', '34'], ['o', '35'], ['j', '33']]);
const pc = (c) => `\x1b[${colors.get(c)}m${c}\x1b[0m`;
@fabienhinault
fabienhinault / m12.js
Last active March 20, 2025 12:01
M12
move_m = ([a,b,c,d,e,f,g,h,i,j,k,l]) => [a,l,b,k,c,j,d,i,e,h,f,g];
move_i = ([a,b,c,d,e,f,g,h,i,j,k,l]) => [l,k,j,i,h,g,f,e,d,c,b,a];
mm = (count, a) => {if (count === 0) return a; else return move_m(mm(count -1, a));};
jouer = (ms, d) => to12(ms.reduce((acc, v) => mm(v, move_i(acc)), move_i(d)));
d = [1,2,3,4,5,6,7,8,9,10,11,12];
sol = (ms) => ms.map(m => (11 - m) % 11).reverse();
sols = new Map();
next = (jeu) => {
let lastIndex = jeu.findLastIndex((i) => i < 10);
@fabienhinault
fabienhinault / forte_keywords.md
Last active June 17, 2024 17:01
keywords in forte
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title> Script in head section </title>
</head>
<body>
<div>
<!-- Generated by graphviz version 2.43.0 (0)
-->
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
graph {
47 -- 94 [class = "47 94"]
94 -- 2 [class = "94 2"]
43 -- 86 [class = "43 86"]
86 -- 2 [class = "86 2"]
41 -- 82 [class = "41 82"]
82 -- 2 [class = "82 2"]
37 -- 74 [class = "37 74"]
74 -- 2 [class = "74 2"]
#!/bin/bash
readarray N < <(seq 0 100)
N[0]='_'
N[1]='_'
for ((prime=2; prime<=100; prime++))
do
if [[ N[$prime] != '_' ]]
then
import random
ts = [list(reversed(sorted([random.randint(1,6) for x in range(n)]))) for n in [3,2]]
js = ["attaquant", "défenseur"]
for t, j in zip(ts, js):
print("tirage " + j + ": " + str(t))
r = [a>d for a,d in zip(ts[0][0:2], ts[1])]
djs = [-sum(_ == v for _ in r) for v in [False, True]]
for dj, j in zip(djs, js):
print("domage " + j + ": " + str(dj))