Teacup rim text: Difference between revisions

Content deleted Content added
m Fixed output
m Minor edit
Line 1,458: Line 1,458:


fn find_teacup_words(dict : &BTreeSet<String>) {
fn find_teacup_words(dict : &BTreeSet<String>) {
let mut teacup_words : BTreeSet<String> = BTreeSet::new();
let mut teacup_words : Vec<String> = Vec::new();
let mut found : HashSet<String> = HashSet::new();
let mut found : HashSet<String> = HashSet::new();
for word in dict {
for word in dict {
Line 1,476: Line 1,476:
break;
break;
}
}
if !w.eq(word) {
if !w.eq(word) && !teacup_words.contains(&w) {
teacup_words.insert(w);
teacup_words.push(w);
}
}
},
},
Line 1,516: Line 1,516:
<pre>
<pre>
apt pta tap
apt pta tap
arc car rca
arc rca car
ate eat tea
ate tea eat
</pre>
</pre>
With wordlist.10000:
With wordlist.10000:
<pre>
<pre>
aim ima mai
aim ima mai
arc car rca
arc rca car
asp pas spa
asp spa pas
ate eat tea
ate tea eat
ips psi sip
ips psi sip
</pre>
</pre>