×

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
  • /
  • Module challenges
Module challenges
Ediz
« Censeur »
1398679260000
    • Ediz#0095
    • Profil
    • Derniers messages
    • Tribu
#1
  0
Hey mice.

I'll be giving you challenges often about anything that comes to my mind. This will be only for fun, and it'll help anyone who partipicates to improve their programming. As I think of good questions, I'll ask you to make various scripts, and you will do it.
Your aim should be to use as least characters as possible that does it's job.

Example:


QUESTION: Let us have a variable name called "a".

a = true
a = not a
print (a) -- prints the result of the opposite of a.

What you have to do is find a different way to do this, without just using "not a".

My answer:

a = true
-- this is your variable. I'd ask you to take input, but I'm just giving you an example manually.
print (not(a and true) or false) -- turns a to the opposite of what it is and prints it.


-----

EXERCISE 1:

Make a script where every player in a room can choose their speed(left/right, x speed).
They should have a limit between -50 and 50 in speed.

Additionally, a random person in the room should be chosen as a "speed changer" and have rights to be able to set anyone's speed as they wish, with no limitations.
This "speed changer" must change randomly, every time a map starts.

You are free to allow the player to change the speed any way you want, be it eventKeyboard or eventChatCommand or any other function.


Good luck :)
Hgirl
« Citoyen »
1398681180000
    • Hgirl#0000
    • Profil
    • Derniers messages
#2
  0
finished
Atirn
« Citoyen »
1398685680000
    • Atirn#0000
    • Profil
    • Derniers messages
    • Tribu
#3
  0
Great idea!

First excercise :
a dit :
http://pastebin.com/XWxAjpXk

Usage of command as normal player :
!speed [left speed] [right speed]

Usage of command as speed changer (optional) :
!speed [player name] [left speed] [right speed]
Ediz
« Censeur »
1398686820000
    • Ediz#0095
    • Profil
    • Derniers messages
    • Tribu
#4
  0
Might want to test your script there. There is only one xSpeed, and it is throwing me to the opposite direction I am moving. Also Shaman can't set speed, it throws an error.

Plus, it should be random to choose the speed changer, but it seems like only the shaman is.
Atirn
« Citoyen »
1398690780000
    • Atirn#0000
    • Profil
    • Derniers messages
    • Tribu
#5
  0
Ediz a dit :
Might want to test your script there. There is only one xSpeed, and it is throwing me to the opposite direction I am moving. Also Shaman can't set speed, it throws an error.

Plus, it should be random to choose the speed changer, but it seems like only the shaman is.

Fixed! http://pastebin.com/6U3xTfMK
Also about the shaman bit; it is the name of the speed changer, not the shaman. As I thought it would be more clear, but i've changed it now.

Cheers.
Manacer
« Citoyen »
1398721020000
    • Manacer#0000
    • Profil
    • Derniers messages
    • Tribu
#6
  0
Verry good idea!

Good luck !
Podoko
« Citoyen »
1398864240000
    • Podoko#0000
    • Profil
    • Derniers messages
    • Tribu
#7
  0
that looks funny and will be a good training for me.
http://pastebin.com/gB0VUFdB

I tried to make a small interface but finally it looks longer than what I expected.
I also wanted to add possibility to change Yspeed and the global speed but I think I will do it another day ^^
Dogangun
« Citoyen »
1398868860000
    • Dogangun#0000
    • Profil
    • Derniers messages
    • Tribu
#8
  0
Good idea.

Everyone success.
Abdeltif
« Citoyen »
1398895560000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#9
  0
Ediz if you feel this thread is more active and better you can lock mine already , :)
(It's Topic-622538 )
Blackzdragon
« Citoyen »
1399020900000
    • Blackzdragon#0000
    • Profil
    • Derniers messages
    • Tribu
#10
  0
i dont get it no support whatsoever
Leafileaf
« Citoyen »
1403181600000
    • Leafileaf#0000
    • Profil
    • Derniers messages
    • Tribu
#11
  0
i read your example answer and there's nothing really different

x or false where x is a boolean does nothing whatsoever.
true or false -> true
false or false -> false

x and true where x is a boolean doesn't do anything either
true and true -> true
false and true -> false

when it boils down to it you're still doing "not a" just a little fancier
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Module challenges
© Atelier801 2018

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

Version 1.27