mirror of
https://gitlab.com/MisterBiggs/wordle.jl.git
synced 2025-06-15 14:26:38 +00:00
Initial commit
This commit is contained in:
commit
7bc32106c3
11
Manifest.toml
Normal file
11
Manifest.toml
Normal file
@ -0,0 +1,11 @@
|
||||
# This file is machine-generated - editing it directly is not advised
|
||||
|
||||
julia_version = "1.7.1"
|
||||
manifest_format = "2.0"
|
||||
|
||||
[[deps.DelimitedFiles]]
|
||||
deps = ["Mmap"]
|
||||
uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab"
|
||||
|
||||
[[deps.Mmap]]
|
||||
uuid = "a63ad114-7e13-5084-954f-fe012c677804"
|
2
Project.toml
Normal file
2
Project.toml
Normal file
@ -0,0 +1,2 @@
|
||||
[deps]
|
||||
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
|
10000
google-10000-english.txt
Normal file
10000
google-10000-english.txt
Normal file
File diff suppressed because it is too large
Load Diff
55
wordle.jl
Normal file
55
wordle.jl
Normal file
@ -0,0 +1,55 @@
|
||||
using DelimitedFiles
|
||||
|
||||
function check_known(word, knowns)
|
||||
if isempty(knowns)
|
||||
return true
|
||||
end
|
||||
|
||||
for (v, k) in knowns
|
||||
if word[k] == v
|
||||
continue
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
begin
|
||||
words = readdlm("wordle.txt")[:]
|
||||
|
||||
keep = []
|
||||
for (index, word) in enumerate(words)
|
||||
if length(word) == 5
|
||||
push!(keep, index)
|
||||
end
|
||||
end
|
||||
|
||||
words = lowercase.(words[keep])
|
||||
end
|
||||
|
||||
# First Guesses
|
||||
# PENIS
|
||||
# SOARE 3.45
|
||||
# RAISE 3.46
|
||||
# ARISE 3.47
|
||||
# SERAI 3.52
|
||||
|
||||
banned = ["w", "e", "u", "s", "k", "m", "d"]
|
||||
contained = ["a", "l", "b"]
|
||||
knowns = [('a', 2), ('b', 1)]
|
||||
|
||||
for word in words
|
||||
if any(occursin.(banned, word))
|
||||
continue
|
||||
end
|
||||
if all(occursin.(contained, word))
|
||||
if ~isempty(known)
|
||||
if check_known(word, knowns)
|
||||
println(word)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
279498
wordle.txt
Normal file
279498
wordle.txt
Normal file
File diff suppressed because it is too large
Load Diff
69905
wordlist.txt
Normal file
69905
wordlist.txt
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user