×

Langue

Fermer
Atelier 801
  • Forums
  • Dev Tracker
  • Connexion
    • English Français
      Português do Brasil Español
      Türkçe Polski
      Magyar Română
      العربية Skandinavisk
      Nederlands Deutsch
      Bahasa Indonesia Русский
      中文 Filipino
      Lietuvių kalba 日本語
      Suomi עברית
      Italiano Česky
      Hrvatski Slovensky
      Български Latviešu
      Estonian
  • Langue
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [TASK] Coding tasks
« ‹ 2 / 2
[TASK] Coding tasks
Moepl
« Citoyen »
1392570480000
    • Moepl#0095
    • Profil
    • Derniers messages
#21
  0
Abdeltif a dit :
O, M, G
Well, Hmm, is it even possible to do it without tables ? lol

easily, if you already know those "hands" that the function will be called from.

If you don't know, I think that you'd need to restrict that those "hands" may not contain a special symbol e.g '#'.
That way you could define a variable and concatenate it with every "hand" and the symbol #. If the variable doesn't contain (e.g string.gmatch) the "hand", it will be printed.
Abdeltif
« Citoyen »
1392571380000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#22
  0
Moepl a dit :
easily, if you already know those "hands" that the function will be called from.

If you don't know, I think that you'd need to restrict that those "hands" may not contain a special symbol e.g '#'.
That way you could define a variable and concatenate it with every "hand" and the symbol #. If the variable doesn't contain (e.g string.gmatch) the "hand", it will be printed.

hmm
I guess you have a point in that then
Pro moepl
Since that task is useless now, I'll go and create another similar one

Moepl give me your mind !
because It's just pretty damn smart
Abdeltif
1392572520000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#23
[Modéré par Bolinboy, raison : pls dont share coding to get xml from a map]
Safwanrockz
1392584940000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#24
[Modéré par Bolinboy, raison : ^]
Abdeltif
1392655560000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#25
[Modéré par Bolinboy, raison : ^]
Smgxxx
« Citoyen »
1392908160000
    • Smgxxx#0000
    • Profil
    • Derniers messages
    • Tribu
#26
  0
Script a dit :

Task 5

STATS = {
-- You may only work from here
-- To here
}
for k,v in pairs(tfm.get.room.playerList) do
-- You may only work from here
STATS[k] = {cheese = 0, wins = 0, shaman = 0,lost = 0}
--To here
end
function eventChatCommand(n, c)
-- You may only work from here
if c == "stats" then
ui.addTextArea(1, "Statistics<br><br>Cheese: "..STATS[n].cheese.."<br>Wins: "..STATS[n].wins.."<br>Deaths: "..STATS[n].lost.."<br>Shaman: "..STATS[n].shaman, n, 10, 30, 120, 100)
elseif c == "close" then
ui.removeTextArea(1, n)
end
--To here
end
-- you must add eventNewGame
function eventNewGame()
for k,v in pairs(tfm.get.room.playerList) do
if v.isShaman then
STATS[k].shaman = STATS[k].shaman + 1
end
end
end
function eventPlayerDied(name)
-- You may only work from here
STATS[name].lost = STATS[name].lost + 1
--To here
end

function eventPlayerWon(name)
-- You may only work from here
STATS[name].wins = STATS[name].wins + 1
--To here
end
function eventPlayerGetCheese(name)
-- You may only work from here
STATS[name].cheese = STATS[name].cheese + 1
--To here
end
Abdeltif
« Citoyen »
1392913260000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#27
  0
Smgxxx a dit :

I really appreciate you post in here : https://docs.google.com/forms/d/1Mu3p06ocmP6kVAzvaKC-pWPnruuHD4H9LkFmBKQxXJE/viewform
So no one else steal your codes
Also, good job, that's right ;)
Abdeltif
« Citoyen »
1394802300000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#28
  0
Erimismeyve - Task 3 :
Sayo need to be 100 pixil below Saya textArea.
Anything else : Good job .

You may from now on only do the tasks here:
Task 1
Task 2
Task 3
Task 4
Task 5
Abdeltif
1394804580000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#29
[Modéré par Bolinboy, raison : unnecessary double post]
Issey
« Citoyen »
1394839680000
    • Issey#0000
    • Profil
    • Derniers messages
#30
  0
task 3 and 4 is borked
Abdeltif
« Citoyen »
1394898780000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#31
  0
Issey a dit :
task 3 and 4 is borked

Fixed.

Task1 :
smgxxx -- they should NOT be printed.
erikq -- Good work
Issey -- It works fine, true, but it's a bit complex and you could make it in an easier way.
cheetahkitty -- Good work.
Shamousey -- Good work.

Task2:
No one ( There are, but they diidn't do the exercise , they kept it blank. )

Task5:
Issey --
--no eventNewGame, can't tell if sham or not
You are right, I added the function
and good job, it's perfect, your code .
Abdeltif
1394899440000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#32
[Modéré par Bolinboy, raison : unnecessary double post]
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [TASK] Coding tasks
« ‹ 2 / 2
© Atelier801 2018

Equipe Conditions Générales d'Utilisation Politique de Confidentialité Contact

Version 1.27