Skip to content

Instantly share code, notes, and snippets.

View Svehla's full-sized avatar

Jakub Švehla Svehla

  • Czechia
View GitHub Profile
var optSafeId = Array.from({ length: 1300 - 13 + 1 }, (_, i) => i + 13)
var perfectCube = i => Math.round(i**(1/3))**3 === i // float fuckup
var perfectSquare = i => Math.round(i**(1/2))**2 === i // float fuckup
var lg500 = i => i > 500
var secDig1 = i => i.toString().substr(1, 1) == '1'
var truth = (isTruth, val) => isTruth ? val : !val
// combinatorics hacked by bin numbers
var possibleResponses = Array.from({ length: 2 ** 4 })
.map((_, i) => i.toString(2).padStart(4, '0'))
const fs = require('fs')
const wordsInput = fs.readFileSync('./czech.txt', 'utf-8')
const letters = ['a', 'b', 'c', 'd', 'e', 'f', 'o']
const filteredWords = wordsInput
.split('\n')
.map(word => word.trim())
.filter(Boolean)