Add tasks for all the new languages

This commit is contained in:
Tina Müller 2016-12-05 23:44:36 +01:00
parent 9dc3c2bb62
commit bba7bfd280
13208 changed files with 134745 additions and 0 deletions

View file

@ -0,0 +1,11 @@
IMPORT STD; //Imports the Standard Library
STRING MyBaseString := 'alphaBETA';
UpperCased := STD.str.toUpperCase(MyBaseString);
LowerCased := STD.str.ToLowerCase(MyBaseString);
TitleCased := STD.str.ToTitleCase(MyBaseString);
OUTPUT (UpperCased);
OUTPUT (LowerCased);
OUTPUT (TitleCased);

View file

@ -0,0 +1,10 @@
(string-downcase "alphaBETA")
→ "alphabeta"
(string-upcase "alphaBETA")
→ "ALPHABETA"
(string-titlecase "alphaBETA")
→ "Alphabeta"
(string-randcase "alphaBETA")
→ "alphaBEtA"
(string-randcase "alphaBETA")
→ "AlPHaBeTA"

View file

@ -0,0 +1,6 @@
import String exposing (toLower, toUpper)
s = "alphaBETA"
lower = toLower s
upper = toUpper s

View file

@ -0,0 +1,6 @@
' FB 1.05.0 Win64
Dim s As String = "alphaBETA"
Print UCase(s)
Print LCase(s)
Sleep

View file

@ -0,0 +1,10 @@
include "ConsoleWindow"
dim as Str255 a
a = "alphaBETA"
print a
print ucase$(a)
fn lcase(a)
print a

View file

@ -0,0 +1,12 @@
// Direct string return
'alphaBETA'->uppercase&
'alphaBETA'->lowercase&
// Assignment and manipulation of variables
local(toupper = 'alphaBETA')
#toupper->uppercase
#toupper
local(tolower = 'alphaBETA')
#tolower->lowercase
#tolower

View file

@ -0,0 +1,29 @@
----------------------------------------
-- Lower to upper case (ASCII only)
-- @param {string} str
-- @return {string}
----------------------------------------
on toUpper (str)
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
len = str.length
repeat with i = 1 to len
pos = offset(str.char[i], alphabet)
if pos > 0 then put alphabet.char[pos] into char i of str
end repeat
return str
end
----------------------------------------
-- Upper to lower case (ASCII only)
-- @param {string} str
-- @return {string}
----------------------------------------
on toLower (str)
alphabet = "abcdefghijklmnopqrstuvwxyz"
len = str.length
repeat with i = 1 to len
pos = offset(str.char[i], alphabet)
if pos > 0 then put alphabet.char[pos] into char i of str
end repeat
return str
end

View file

@ -0,0 +1,5 @@
put toUpper("alphaBETA")
-- "ALPHABETA"
put toLower("alphaBETA")
-- "alphabeta"

View file

@ -0,0 +1,2 @@
put upper("alphaBETA") && lower("alphaBETA")
ALPHABETA alphabeta

View file

@ -0,0 +1,7 @@
import strutils
var s: string = "alphaBETA_123"
echo s," as upper case: ", toUpper(s)
echo s," as lower case: ", toLower(s)
echo s," as Capitalized: ", capitalize(s)
echo s," as normal case: ", normalize(s) # remove underscores, toLower

View file

@ -0,0 +1,2 @@
"alphaBETA" toUpper
"alphaBETA" toLower

View file

@ -0,0 +1,5 @@
<@ ENU$$$LSTPSTLITLIT>UPP|
[<@ SAYELTLST>...</@>] <@ SAYHLPELTLST>...</@><@ DEFKEYELTLST>__SuperMacro|...</@>
<@ SAY&&&LIT>alphaBETA</@>
</@>

View file

@ -0,0 +1,5 @@
<# ENUMERATION LAMBDA LIST PEERSET LITERAL LITERAL>UPP|
[<# SAY ELEMENT LIST>...</#>] <# SAY HELP ELEMENT LIST>...</#><# DEFINE KEYWORD ELEMENT LIST>__SuperMacro|...</#>
<# SAY SUPERMACRO LITERAL>alphaBETA</#>
</#>

View file

@ -0,0 +1,3 @@
constant s = "alphaBETA"
?upper(s)
?lower(s)

View file

@ -0,0 +1,25 @@
lowercase = (str) :
low = ("")
str length times (i) :
low append(if (65 <= str(i) ord and str(i) ord <= 90) :
"abcdefghijklmnopqrstuvwxyz"(str(i) ord - 65)
. else :
str(i)
.)
.
low join("")
.
uppercase = (str) :
upp = ("")
str length times (i) :
upp append(if (97 <= str(i) ord and str(i) ord <= 122) :
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"(str(i) ord - 97)
. else :
str(i)
.)
.
upp join("")
.
lowercase("alphaBETA") print
uppercase("alphaBETA") print

View file

@ -0,0 +1,4 @@
string ls_string
ls_string = 'alphaBETA'
ls_string = Upper(ls_string)
ls_string = Lower(ls_string)

View file

@ -0,0 +1,3 @@
aString = "WELCOME TO THE ring programming language"
see lower(aString) + nl
see upper(aString) + nl

View file

@ -0,0 +1,6 @@
say "alphaBETA".lc; #=> alphabeta
say "alphaBETA".uc; #=> ALPHABETA
say "alphaBETA".tc; #=> AlphaBETA
say "alpha BETA".wc; #=> Alpha Beta
say "alpha BETA".tc; #=> Alpha BETA
say "alpha BETA".tclc; #=> Alpha beta

View file

@ -0,0 +1,5 @@
import Foundation
println("alphaBETA".uppercaseString)
println("alphaBETA".lowercaseString)
println("foO BAr".capitalizedString)

View file

@ -0,0 +1,2 @@
out (lower "alphaBETA") endl console
out (upper "alphaBETA") endl console

View file

@ -0,0 +1,7 @@
# like ruby's downcase - only characters A to Z are affected
def ascii_downcase:
explode | map( if 65 <= . and . <= 90 then . + 32 else . end) | implode;
# like ruby's upcase - only characters a to z are affected
def ascii_upcase:
explode | map( if 97 <= . and . <= 122 then . - 32 else . end) | implode;

View file

@ -0,0 +1,5 @@
"alphaBETA" | ascii_upcase
#=> "ALPHABETA"
"alphaBETA" | ascii_downcase
#=> "alphabeta"