tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
29
Task/Pangram-checker/NetRexx/pangram-checker.netrexx
Normal file
29
Task/Pangram-checker/NetRexx/pangram-checker.netrexx
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/* NetRexx */
|
||||
options replace format comments java crossref savelog symbols nobinary
|
||||
|
||||
A2Z = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
||||
|
||||
pangrams = create_samples
|
||||
|
||||
loop p_ = 1 to pangrams[0]
|
||||
pangram = pangrams[p_]
|
||||
q_ = A2Z.verify(pangram.upper) -- <= it basically all happens in this function call!
|
||||
say pangram.left(64)'\-'
|
||||
if q_ == 0 then -
|
||||
say ' [OK, a pangram]'
|
||||
else -
|
||||
say ' [Not a pangram. Missing:' A2Z.substr(q_, 1)']'
|
||||
end p_
|
||||
|
||||
method create_samples public static returns Rexx
|
||||
|
||||
pangrams = ''
|
||||
|
||||
x_ = 0
|
||||
x_ = x_ + 1; pangrams[0] = x_; pangrams[x_] = 'The quick brown fox jumps over a lazy dog.' -- best/shortest pangram
|
||||
x_ = x_ + 1; pangrams[0] = x_; pangrams[x_] = 'The quick brown fox jumps over the lazy dog.' -- not as short but at least it's still a pangram
|
||||
x_ = x_ + 1; pangrams[0] = x_; pangrams[x_] = 'The quick brown fox jumped over the lazy dog.' -- common misquote; not a pangram
|
||||
x_ = x_ + 1; pangrams[0] = x_; pangrams[x_] = 'The quick onyx goblin jumps over the lazy dwarf.'
|
||||
x_ = x_ + 1; pangrams[0] = x_; pangrams[x_] = 'Bored? Craving a pub quiz fix? Why, just come to the Royal Oak!' -- (Used to advertise a pub quiz in Bowness-on-Windermere)
|
||||
|
||||
return pangrams
|
||||
Loading…
Add table
Add a link
Reference in a new issue