Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
32
Task/Ordered-words/EasyLang/ordered-words.easy
Normal file
32
Task/Ordered-words/EasyLang/ordered-words.easy
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
func isordered w$ .
|
||||
for c$ in strchars w$
|
||||
if strcode c$ < prev
|
||||
return 0
|
||||
.
|
||||
prev = strcode c$
|
||||
.
|
||||
return 1
|
||||
.
|
||||
repeat
|
||||
w$ = input
|
||||
until w$ = ""
|
||||
if len w$ >= max and isordered w$ = 1
|
||||
max = len w$
|
||||
words$[] &= w$
|
||||
.
|
||||
.
|
||||
for w$ in words$[]
|
||||
if len w$ = max
|
||||
write w$ & " "
|
||||
.
|
||||
.
|
||||
#
|
||||
# the content of unixdict.txt
|
||||
input_data
|
||||
10th
|
||||
abacus
|
||||
abbot
|
||||
abbott
|
||||
accent
|
||||
floppy
|
||||
flora
|
||||
8
Task/Ordered-words/Nu/ordered-words.nu
Normal file
8
Task/Ordered-words/Nu/ordered-words.nu
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
def 'str is-ordered' [] {
|
||||
split chars | window 2 | all { $in.0 <= $in.1 }
|
||||
}
|
||||
|
||||
open 'unixdict.txt' | lines
|
||||
| group-by { str length } | sort -n -r
|
||||
| values | each { filter { str is-ordered } }
|
||||
| skip while { is-empty } | first
|
||||
19
Task/Ordered-words/PascalABC.NET/ordered-words.pas
Normal file
19
Task/Ordered-words/PascalABC.NET/ordered-words.pas
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
uses System.Net;
|
||||
|
||||
function IsOrderedWord(w: string): boolean;
|
||||
begin
|
||||
result := true;
|
||||
for var i := 2 to w.Length do
|
||||
begin
|
||||
if w[i] < w[i - 1] then result := false
|
||||
end;
|
||||
end;
|
||||
|
||||
begin
|
||||
var client := new WebClient();
|
||||
var text := client.DownloadString('http://wiki.puzzlers.org/pub/wordlists/unixdict.txt');
|
||||
var words: sequence of string := text.ToWords(|#10, #13|);
|
||||
words := words.Where(x -> IsOrderedWord(x));
|
||||
var maxlen := words.Max(x -> x.Length);
|
||||
words.Where(x -> x.length = maxlen).Println;
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue