My omnium-gatherom of scripts and source code.
1#!/usr/bin/env bash
2# dependencies: gum
3set -e
4
5
6dec="$(printf "%d\n" "$(head -c 1 /dev/random | od -A n -t u1)")"
7hex="$(printf "%x\n" "$dec")"
8
9val="$(gum input --header="What is 0x$hex in decimal?")"
10while [ "$val" -ne "$dec" ]
11do
12 gum log -l "error" "Try again."
13 val="$(gum input --header="What is 0x$hex in decimal?")"
14done