Teacup rim text: Difference between revisions
Content added Content deleted
m (added highlighting, whitespace, related tasks.) |
No edit summary |
||
Line 1,270: | Line 1,270: | ||
("ips" "sip" "psi") |
("ips" "sip" "psi") |
||
</pre> |
</pre> |
||
=={{header|PureBasic}}== |
|||
<lang PureBasic>DataSection |
|||
dname: |
|||
Data.s "./Data/unixdict.txt" |
|||
Data.s "./Data/wordlist.10000.txt" |
|||
Data.s "" |
|||
EndDataSection |
|||
EnableExplicit |
|||
Dim c.s{1}(2) |
|||
Define.s txt, bset, res, dn |
|||
Define.i i,q, cw |
|||
Restore dname : Read.s dn |
|||
While OpenConsole() And ReadFile(0,dn) |
|||
While Not Eof(0) |
|||
cw+1 |
|||
txt=ReadString(0) |
|||
If Len(txt)=3 : bset+txt+";" : EndIf |
|||
Wend |
|||
CloseFile(0) |
|||
For i=1 To CountString(bset,";") |
|||
PokeS(c(),StringField(bset,i,";")) |
|||
If FindString(res,c(0)+c(1)+c(2)) : Continue : EndIf |
|||
If c(0)=c(1) Or c(1)=c(2) Or c(0)=c(2) : Continue : EndIf |
|||
If FindString(bset,c(1)+c(2)+c(0)) And FindString(bset,c(2)+c(0)+c(1)) |
|||
res+c(0)+c(1)+c(2)+~"\t"+c(1)+c(2)+c(0)+~"\t"+c(2)+c(0)+c(1)+~"\n" |
|||
EndIf |
|||
Next |
|||
PrintN(res+Str(cw)+" words, "+Str(CountString(res,~"\n"))+" circular") : Input() |
|||
bset="" : res="" : cw=0 |
|||
Read.s dn |
|||
Wend</lang> |
|||
{{out}} |
|||
<pre>apt pta tap |
|||
arc rca car |
|||
ate tea eat |
|||
25104 words, 3 circular |
|||
aim ima mai |
|||
arc rca car |
|||
asp spa pas |
|||
ate tea eat |
|||
ips psi sip |
|||
10000 words, 5 circular</pre> |
|||
=={{header|Python}}== |
=={{header|Python}}== |