Skip to content

Instantly share code, notes, and snippets.

@Svehla
Last active February 22, 2020 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Svehla/1981312718b55d169038b1ad8d78e591 to your computer and use it in GitHub Desktop.
Save Svehla/1981312718b55d169038b1ad8d78e591 to your computer and use it in GitHub Desktop.
with open("czech.txt", "r") as f:
print("\n".join([f"{x} {int(x.replace('o', '0'), 16)}" for x in f.read().splitlines() if set(x).issubset(set("abcdefo"))]))
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)
.filter(word => word.split('').every(letter => letters.includes(letter)))
.map(word => `${word} ${parseInt(word.replace(/o/g, '0'), 16)}`)
fs.writeFileSync('./output.txt', filteredWords.join('\n'), 'utf-8')
console.log('done')
require('fs').readFileSync('czech.txt','utf-8')
.split('\n')
.map(w=>{w=w.trim();w&&w.split('').every(l=>'abcdefo'.includes(l))
&&console.log(`${w} ${parseInt(w.replace(/o/g,'0'),16)}`)})
a 10
abeced 11267309
abeceda 180276954
abecede 180276958
ac 172
ad 173
baba 47802
babe 47806
beda 48858
bob 2827
bod 2829
bode 45278
cad 3245
cadca 830922
cca 3274
co 192
da 218
dba 3514
dece 57038
ded 3565
deda 57050
dede 57054
dedo 57040
do 208
dob 3339
doba 53434
dobe 53438
doc 3340
doda 53466
ec 236
fa 250
fac 4012
facce 1027278
o 0
obce 3022
obdoba 774330
obe 190
obec 3052
obed 3053
obeda 48858
od 13
oda 218
odboc 56076
odd 221
ode 222
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment