Hi! This page is the official Ajuanca´s sandbox. To know more about what a sandbox is, visit this page.

TASK 1 edit

Great Blue Heron and immature Bald Eagle on the Platte River.jpg

 

imgs

TASK 2 edit

Q1. What keyword marks the start of a function definition? A1. The keyword is function.

Q2. Which letter is conventionally used in Scribunto modules to hold the table of functions? A2. The common letter used is p.

Q3. What keyword marks the end of a function definition? A3. The keyword is end.

Hello, world!

Hello from Lua to my friend Ada.



TASK 3 edit

5 degrees Celsius is 41 degrees Fahrenheit. That's the same as say 278.15 Kelvin. It is cold.

25 degrees Celsius is 77 degrees Fahrenheit. That's the same as say 298.15 Kelvin. It is warm.

0 degrees Celsius is 32 degrees Fahrenheit. That's the same as say 273.15 Kelvin. It is cold.

-8 degrees Celsius is 17.6 degrees Fahrenheit. That's the same as say 265.15 Kelvin. It is cold.

48 degrees Celsius is 118.4 degrees Fahrenheit. That's the same as say 321.15 Kelvin. It is warm.

  • When the temperature is 9, the comparison considers it smaller. I added a specific answer for temperature equals 9:

9 degrees Celsius is 48.2 degrees Fahrenheit. That's the same as say 282.15 Kelvin. It isn't neither warm nor cold.

  • When no value is given to celsius parameter, it considers that it isn't given:

0 degrees Celsius is 32 degrees Fahrenheit. That's the same as say 273.15 Kelvin. It is cold.

  • When the wrong variable type is written, it considers that it isn't given:

0 degrees Celsius is 32 degrees Fahrenheit. That's the same as say 273.15 Kelvin. It is cold.

TASK 4 edit

Tables edit

Extended content

The 4 times table.

When no number is given or no parameter is sended, the default value is used. Instead of 2, the default number is generated randomly between -12 and 12, and in this case is -7.
1 times 4 equals 4
2 times 4 equals 8
3 times 4 equals 12
4 times 4 equals 16
5 times 4 equals 20
6 times 4 equals 24
7 times 4 equals 28
8 times 4 equals 32
9 times 4 equals 36
10 times 4 equals 40
11 times 4 equals 44
12 times 4 equals 48

The -7 times table.

When no number is given or no parameter is sended, the default value is used. Instead of 2, the default number is generated randomly between -12 and 12, and in this case is -7.
1 times -7 equals -7
2 times -7 equals -14
3 times -7 equals -21
4 times -7 equals -28
5 times -7 equals -35
6 times -7 equals -42
7 times -7 equals -49
8 times -7 equals -56
9 times -7 equals -63
10 times -7 equals -70
11 times -7 equals -77
12 times -7 equals -84

The -7 times table.

When no number is given or no parameter is sended, the default value is used. Instead of 2, the default number is generated randomly between -12 and 12, and in this case is -7.
1 times -7 equals -7
2 times -7 equals -14
3 times -7 equals -21
4 times -7 equals -28
5 times -7 equals -35
6 times -7 equals -42
7 times -7 equals -49
8 times -7 equals -56
9 times -7 equals -63
10 times -7 equals -70
11 times -7 equals -77
12 times -7 equals -84

The -7 times table.

When no number is given or no parameter is sended, the default value is used. Instead of 2, the default number is generated randomly between -12 and 12, and in this case is -7.
1 times -7 equals -7
2 times -7 equals -14
3 times -7 equals -21
4 times -7 equals -28
5 times -7 equals -35
6 times -7 equals -42
7 times -7 equals -49
8 times -7 equals -56
9 times -7 equals -63
10 times -7 equals -70
11 times -7 equals -77
12 times -7 equals -84

The -9 times table.

When no number is given or no parameter is sended, the default value is used. Instead of 2, the default number is generated randomly between -12 and 12, and in this case is -7.
1 times -9 equals -9
2 times -9 equals -18
3 times -9 equals -27
4 times -9 equals -36
5 times -9 equals -45
6 times -9 equals -54
7 times -9 equals -63
8 times -9 equals -72
9 times -9 equals -81
10 times -9 equals -90
11 times -9 equals -99
12 times -9 equals -108

People edit

Hello Agnetha
Hello Betty
Hello Carlos
Hello Davinder
Hello Eloise
Hello Martin
Hello Doug
Hello Diego

TASK 5 edit

Sub-strings and case edit

This is simple

Patterns and matching edit

Q1. What does %w+ match in a Lua pattern? A1. As it's written in the documentation, it represents all ASCII alphanumeric characters. In this case, they'll correspond to the month.

Q2. What does %d+ match in a Lua pattern? A2. As it's written in the documentation, it represents all digits. In this case, they'll correspond to the day or year.

Year = 2018
Day = 31
Month = October, that is the tenth month.
Yes, I can figure out how does it works. The input is passed to the function and then saved to the variable dmy. After that, there're declared three variables that will come from casting dmy into three pieces, thanks to the method string.match that, as it's written in the documentation, it compares the first parameter, in this case, dmy, with a given parameter as a second attribute, in this case, numbers characters numbers, that are saved corresponding to the variables d, m and y. Finally, the variables are concatenated with some text and returned.

In order to get the values of the day, month and year in this format, we should modify the line that saves each value in the variable, searching in the first place instead of the day the month, in second place the day and lastly the year. Note that as also a comma (,) is introduced, we also should cast it. I made a function p.unpackUS that applies this changes. I also implemented some lines to get the ordinal position of the month. In the above example, the given value was "mdydate=October 31, 2018"

Year = 2018
Day = 31
Month = October, that is the tenth month.

TASK 6 edit

Languages libraries for MediaWiki edit

WikiMedia possible languages edit

Extended content

oc - occitan
sc - sardu
cpx-hant - 莆仙語(繁體)
ike-latn - inuktitut
ab - аԥсшәа
glk - گیلکی
sli - Schläsch
lb - Lëtzebuergesch
nb - norsk bokmål
xal - хальмг
wal - wolaytta
ast - asturianu
ca - català
ba - башҡортса
aa - Qafár af
ga - Gaeilge
sr-ec - српски (ћирилица)
dag - dagbanli
kus - Kʋsaal
ja - 日本語
mus - Mvskoke
lus - Mizo ţawng
na - Dorerin Naoero
la - Latina
sa - संस्कृतम्
haw - Hawaiʻi
ruq - Vlăheşte
wa - walon
ta - தமிழ்
cpx-hans - 莆仙语(简体)
scn - sicilianu
tly-cyrl - толыши
nan-hant - 閩南語(傳統漢字)
zh-min-nan - Bân-lâm-gú
mnc-latn - manju gisun
pag - Pangasinan
mag - मगही
lij - Ligure
stq - Seeltersk
se-fi - davvisámegiella (Suoma bealde)
rki - ရခိုင်
nah - Nāhuatl
bcc - جهلسری بلوچی
lki - لەکی
crh-cyrl - къырымтатарджа (Кирилл)
aeb - تونسي / Tûnsî
pcm - Naijá
pcd - Picard
tdd - ᥖᥭᥰᥖᥬᥳᥑᥨᥒᥰ
bxr - буряад
ibb - ibibio
ace - Acèh
jbo - la .lojban.
kbd-cyrl - адыгэбзэ
se-no - davvisámegiella (Norgga bealde)
acm - عراقي
chy - Tsetsêhestâhese
cdo - 閩東語 / Mìng-dĕ̤ng-ngṳ̄
kk-arab - قازاقشا (تٴوتە)
kjh - хакас
shy - tacawit
sco - Scots
nan - 閩南語 / Bân-lâm-gú
ban - Basa Bali
gan - 贛語
shi-latn - Taclḥit
kai - Karai-karai
mai - मैथिली
pam - Kapampangan
mad - Madhurâ
nys - Nyunga
aae - Arbërisht
gaa - Ga
sat - ᱥᱟᱱᱛᱟᱲᱤ
kaa - Qaraqalpaqsha
zgh-latn - tamaziɣt tanawayt
bbc - Batak Toba
lez - лезги
kbd - адыгэбзэ
gcf - kréyòl Gwadloup
kab - Taqbaylit
rgn - Rumagnôl
sah - саха тыла
rsk - руски
szl - ślůnski
fiu-vro - võro
kcg - Tyap
sk - slovenčina
ksw - စှီၤ
tk - Türkmençe
ku-latn - kurdî (latînî)
ik - Iñupiatun
dga - Dagaare
mk - македонски
bar - Boarisch
syl - ꠍꠤꠟꠐꠤ
ext - estremeñu
gan-hans - 赣语(简体)
myv - эрзянь
hrx - Hunsrik
fj - Na Vosa Vakaviti
lzh - 文言
kj - Kwanyama
koi - перем коми
krj - Kinaray-a
kea - kabuverdianu
xh - isiXhosa
zh-classical - 文言
zh - 中文
pdc - Deitsch
ti - ትግርኛ
si - සිංහල
kri - Krio
hi - हिन्दी
mnc-mong - ᠮᠠᠨᠵᡠ ᡤᡳᠰᡠᠨ
fi - suomi
mi - Māori
mrj - кырык мары
ki - Gĩkũyũ
tg-latn - tojikī
dtp - Dusun Bundu-liwan
bh - भोजपुरी
ch - Chamoru
shi-tfng - ⵜⴰⵛⵍⵃⵉⵜ
nmz - nawdm
rup - armãneashti
ceb - Cebuano
mui - Baso Palembang
pwn - pinayuanan
sh - srpskohrvatski / српскохрватски
tly - tolışi
tum - chiTumbuka
mh - Ebon
vec - vèneto
sh-latn - srpskohrvatski (latinica)
ko-kp - 조선말
ady-cyrl - адыгабзэ
atj - Atikamekw
pih - Norfuk / Pitkern
bpy - বিষ্ণুপ্রিয়া মণিপুরী
bg - български
lg - Luganda
kg - Kongo
ng - Oshiwambo
mg - Malagasy
ojb - Ojibwemowin
ig - Igbo
tg - тоҷикӣ
sg - Sängö
ug - ئۇيغۇرچە / Uyghurche
pap - Papiamentu
za - Vahcuengh
gcr - kriyòl gwiyannen
shi - Taclḥit
ff - Fulfulde
af - Afrikaans
loz - Silozi
kbp - Kabɩyɛ
pt-br - português do Brasil
rut - мыхаӀбишды
ckb - کوردی
jut - jysk
mnw - ဘာသာမန်
cpx-latn - Pó-sing-gṳ̂ (Báⁿ-uā-ci̍)
vmw - emakhuwa
nyo - Orunyoro
ee - eʋegbe
de - Deutsch
ce - нохчийн
be - беларуская
nds-nl - Nedersaksies
nia - Li Niha
ne - नेपाली
wuu-hans - 吴语(简体)
ie - Interlingue
he - עברית
ryu - うちなーぐち
te - తెలుగు
mwl - Mirandés
tg-cyrl - тоҷикӣ
es-419 - español de América Latina
tzm - ⵜⴰⵎⴰⵣⵉⵖⵜ
nl-informal - Nederlands (informeel)
yue-hant - 粵語(繁體)
skr-arab - سرائیکی
hif-latn - Fiji Hindi
tt-latn - tatarça
abs - bahasa ambon
gd - Gàidhlig
sd - سنڌي
efi - Efịk
sh-cyrl - српскохрватски (ћирилица)
dty - डोटेली
yrl - Nhẽẽgatú
is - íslenska
ks - कॉशुर / کٲشُر
ms - Bahasa Melayu
trv - Seediq
ps - پښتو
ss - SiSwati
sty - себертатар
pnb - پنجابی
ur - اردو
se-se - davvisámegiella (Ruoŧa bealde)
gpe - Ghanaian Pidgin
apc - شامي
mnc - ᠮᠠᠨᠵᡠ ᡤᡳᠰᡠᠨ
as - অসমীয়া
cs - čeština
bs - bosanski
fr - français
hr - hrvatski
kr - kanuri
mr - मराठी
or - ଓଡ଼ିଆ
kk-latn - qazaqşa (latın)
prg - prūsiskan
sr - српски / srpski
tru - Ṫuroyo
crh - qırımtatarca
brh - Bráhuí
smn - anarâškielâ
ar - العربية
hu-formal - magyar (formal)
cr - Nēhiyawēwin / ᓀᐦᐃᔭᐍᐏᐣ
sma - åarjelsaemien
nds - Plattdüütsch
lmo - lombard
sq - shqip
crh-latn - qırımtatarca (Latin)
arz - مصرى
shy-latn - tacawit
en-ca - Canadian English
ary - الدارجة
luz - لئری دوٙمینی
be-tarask - беларуская (тарашкевіца)
fon - fɔ̀ngbè
vep - vepsän kel’
ses - Koyraboro Senni
ts - Xitsonga
rmc - romaňi čhib
bdr - Bajau Sama
krl - karjal
es-formal - español (formal)
bo - བོད་ཡིག
nso - Sesotho sa Leboa
kk-kz - қазақша (Қазақстан)
btm - Batak Mandailing
tok - toki pona
arn - mapudungun
kk-cn - قازاقشا (جۇنگو)
als - Alemannisch
roa-tara - tarandíne
pnt - Ποντιακά
to - lea faka-Tonga
so - Soomaaliga
no - norsk
mo - молдовеняскэ
tpi - Tok Pisin
bto - Iriga Bicolano
io - Ido
lo - ລາວ
ko - 한국어
fo - føroyskt
srn - Sranantongo
map-bms - Basa Banyumasan
alt - алтай тил
bn - বাংলা
sro - sardu campidanesu
lrc - لۊری شومالی
yi - ייִדיש
hsb - hornjoserbsce
ase - American sign language
inh - гӀалгӀай
rn - ikirundi
sn - chiShona
tn - Setswana
mn - монгол
pdt - Plautdietsch
vro - võro
kn - ಕನ್ನಡ
ln - lingála
en - English
gn - Avañe'ẽ
nqo - ߒߞߏ
kk-tr - qazaqşa (Türkïya)
am - አማርኛ
mhr - олык марий
got - 𐌲𐌿𐍄𐌹𐍃𐌺
gom-deva - गोंयची कोंकणी
qug - Runa shimi
sm - Gagana Samoa
rm - rumantsch
nrm - Nouormand
om - Oromoo
nod - ᨣᩤᩴᨾᩮᩬᩥᨦ
km - ភាសាខ្មែរ
arc - ܐܪܡܝܐ
frc - français cadien
mni - ꯃꯤꯇꯩ ꯂꯣꯟ
hsn - 湘语
nov - Novial
crh-ro - tatarşa
ltg - latgaļu
yo - Yorùbá
vo - Volapük
new - नेपाल भाषा
sl - slovenščina
tl - Tagalog
chr - ᏣᎳᎩ
pl - polski
ml - മലയാളം
nl - Nederlands
kl - kalaallisut
vot - Vaďďa
gl - galego
el - Ελληνικά
ku-arab - كوردي (عەرەبی)
igl - Igala
shn - ၽႃႇသႃႇတႆး
egl - Emiliàn
bgn - روچ کپتین بلوچی
en-gb - British English
chn - chinuk wawa
zh-cn - 中文(中国大陆)
mos - moore
uz - oʻzbekcha / ўзбекча
bho - भोजपुरी
cbk-zam - Chavacano de Zamboanga
dz - ཇོང་ཁ
liv - Līvõ kēļ
hz - Otsiherero
cho - Chahta anumpa
zu - isiZulu
az - azərbaycanca
hif - Fiji Hindi
gor - Bahasa Hulontalo
kk - қазақша
zh-tw - 中文(臺灣)
zh-sg - 中文(新加坡)
zh-my - 中文(马来西亚)
zh-mo - 中文(澳門)
ro - română
my - မြန်မာဘာသာ
yue - 粵語
ky - кыргызча
an - aragonés
zh-hans - 中文(简体)
guc - wayuunaiki
zgh - ⵜⴰⵎⴰⵣⵉⵖⵜ ⵜⴰⵏⴰⵡⴰⵢⵜ
lzz - Lazuri
zea - Zeêuws
de-ch - Schweizer Hochdeutsch
cy - Cymraeg
yue-hans - 粵语(简体)
es - español
hy - հայերեն
xsy - saisiyat
fy - Frysk
olo - livvinkarjala
xmf - მარგალური
tet - tetun
nyn - runyankore
ay - Aymar aru
wuu-hant - 吳語(正體)
ann - Obolo
szy - Sakizaya
os - ирон
wuu - 吴语
arq - جازايرية
wo - Wolof
ksh - Ripoarisch
lfn - Lingua Franca Nova
sms - nuõrttsääʹmǩiõll
sdh - کوردی خوارگ
war - Winaray
de-formal - Deutsch (Sie-Form)
vls - West-Vlams
wls - Fakaʻuvea
tw - Twi
bat-smg - žemaitėška
ady - адыгабзэ
vmf - Mainfränkisch
lld - Ladin
hno - ہندکو
vi - Tiếng Việt
pfl - Pälzisch
li - Limburgs
ve - Tshivenda
uz-latn - oʻzbekcha
uz-cyrl - ўзбекча
gom - गोंयची कोंकणी / Gõychi Konknni
uk - українська
ks-deva - कॉशुर
ug-latn - Uyghurche
ug-arab - ئۇيغۇرچە
kum - къумукъ
udm - удмурт
bew - Betawi
gag - Gagauz
be-x-old - беларуская (тарашкевіца)
rue - русиньскый
fa - فارسی
da - dansk
ka - ქართული
ia - interlingua
ha - Hausa
gan-hant - 贛語(繁體)
tyv - тыва дыл
ty - reo tahiti
pa - ਪੰਜਾਬੀ
ttj - Orutooro
guw - gungbe
tt-cyrl - татарча
jam - Patois
tr - Türkçe
sgs - žemaitėška
rw - Ikinyarwanda
rmy - romani čhib
th - ไทย
kw - kernowek
co - corsu
bcl - Bikol Central
ban-bali - ᬩᬲᬩᬮᬶ
zh-hk - 中文(香港)
eml - emiliàn e rumagnòl
nn - norsk nynorsk
sv - svenska
eo - Esperanto
bci - wawle
ho - Hiri Motu
zh-hant - 中文(繁體)
csb - kaszëbsczi
anp - अंगिका
tcy - ತುಳು
dsb - dolnoserbski
jv - Jawa
ike-cans - ᐃᓄᒃᑎᑐᑦ
sw - Kiswahili
gv - Gaelg
lbe - лакку
su - Sunda
gom-latn - Gõychi Konknni
cv - чӑвашла
dv - ދިވެހިބަސް
ks-arab - کٲشُر
roa-rup - armãneashti
kjp - ဖၠုံလိက်
rif - Tarifit
bm - bamanankan
sr-el - srpski (latinica)
kv - коми
lv - latviešu
ilo - Ilokano
gld - на̄ни
diq - Zazaki
din - Thuɔŋjäŋ
lad - Ladino
br - brezhoneg
kk-cyrl - қазақша (кирил)
fat - mfantse
skr - سرائیکی
sje - bidumsámegiella
min - Minangkabau
grc - Ἀρχαία ἑλληνικὴ
av - авар
simple - Simple English
aeb-arab - تونسي
aeb-latn - Tûnsî
mzn - مازِرونی
mdf - мокшень
bqi - بختیاری
iu - ᐃᓄᒃᑎᑐᑦ / inuktitut
hu - magyar
gu - ગુજરાતી
bug - Basa Ugi
eu - euskara
sei - Cmique Itom
hil - Ilonggo
azb - تۆرکجه
qu - Runa Simi
se - davvisámegiella
bbc-latn - Batak Toba
sdc - Sassaresu
kge - Basa Kumoring
ruq-latn - Vlăheşte
ku - kurdî
ruq-cyrl - Влахесте
nit - కొలామి
de-at - Österreichisches Deutsch
ru - русский
gsw - Alemannisch
zh-yue - 粵語
st - Sesotho
tt - татарча / tatarça
niu - Niuē
fit - meänkieli
tay - Tayal
frp - arpetan
frr - Nordfriisk
awa - अवधी
sjd - кӣллт са̄мь кӣлл
pms - Piemontèis
it - italiano
pi - पालि
hak - 客家語/Hak-kâ-ngî
ht - Kreyòl ayisyen
et - eesti
bi - Bislama
ny - Chi-Chewa
cpx - 莆仙語 / Pó-sing-gṳ̂
nv - Diné bizaad
nog - ногайша
mt - Malti
pt - português
ang - Ænglisc
ii - ꆇꉙ
bjn - Banjar
lt - lietuvių
hyw - Արեւմտահայերէն
ami - Pangcah
nap - Napulitano
ms-arab - بهاس ملايو
fur - furlan
gur - farefare
mrh - Mara
krc - къарачай-малкъар
blk - ပအိုဝ်ႏဘာႏသာႏ
aln - Gegë
khw - کھوار
kiu - Kırmancki
cu - словѣньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ
avk - Kotava
id - Bahasa Indonesia
cps - Capiceño

= 535 languages

Fallback languages edit

is fallback languages

1 - en
There's 1 possible plan-Bs languages.

cv fallback languages

1 - ru
2 - en
There're 2 possible plan-Bs languages.

kk fallback languages

1 - kk-cyrl
2 - en
There're 2 possible plan-Bs languages.

Pageinfo edit

Get title edit

Extension:Scribunto/Lua reference manual

Basic information edit

Test 1 edit

The input is Color

Color exists and isn't a redirect.

Test 2 edit

The input is Colour

Colour exists and is a redirect.

Test 3 edit

The input is Colr

Colr doesn't exist and isn't a redirect.

Test 4 edit

The input is Polymerase

Polymerase exists and isn't a redirect.

Test 5 edit

The input is UK

UK exists and is a redirect.

Test 6 edit

The input is Wikimedia_foundation

Wikimedia_foundation exists and is a redirect.

Experimenting edit
  • When you give the character *, the function is called and the Wikimedia syntax interprets it as a bulleted-list item.
  • exists and is a redirect.
  • When you give #, a non-related Sandbox problem appears:

Lua error in mw.title.lua at line 206: bad argument #1 to 'pairs' (table expected, got nil).

  • When no attribute is given, the following error appears:

Lua error: bad argument #1 to 'title.new' (number or string expected, got nil).

  • When no value is given to the attribute (titleOfPage=):

You need to give a value to the titleOfPage attribute.

  • When you request a page that existed but now is deleted:

Like_this_one doesn't exist and isn't a redirect.

Non-requested implementations edit

  • Now detects subpages and talk pages:

The input is Talk:Australia

Talk:Australia exists and is a talk page.

The input is Wikipedia:Tip_of_the_day/March_8

Wikipedia:Tip_of_the_day/March_8 exists and is a subpage.

Organize all languages [in development] edit

  • Return list with ordered languages.


TASK 7 edit

Fetching a date edit

In the below example, we can see how the data is returned from the Wikimedia database. A + precedes the date (obviously a time-data type). After it, the year, a -, the month, another -, the day, and without any separation, a T that indicates the start of the specific time in the form hh:mm:ss, which null value is 00:00:00, and finally, also without separation, a Z.

+1952-03-11T00:00:00Z

  • The input is qid=Q42 and prop=P569.

The year is 1952, the month is 03 and the day is 11.
This date in an ISO-style is 1952-03-11.

  • The input is qid=Q151973 and prop=P569.

The year is 1925, the month is 11 and the day is 10.
This date in an ISO-style is 1925-11-10.

  • The input is qid=Q34851 and prop=P570.

The year is 2011, the month is 03 and the day is 23.
This date in an ISO-style is 2011-03-23.

Fetching a full date edit

  • The input is qid=Q42 and prop=P569.

11 March 1952

  • The input is qid=Q151973 and prop=P569.

10 November 1925

  • The input is qid=Q34851 and prop=P570.

23 March 2011

Fetching an item edit

  • The input is qid=Q42 and prop=P1196.

natural causes

  • The input is qid=Q151973 and prop=P26.

Elizabeth Taylor