Module challenges |
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 :) |
0 | ||
finished |
0 | ||
Great idea! First excercise : a dit : 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] |
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. |
0 | ||
Ediz a dit : 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
| 0 | ||
Verry good idea! Good luck ! |
Podoko « Citoyen » 1398864240000
| 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
| 0 | ||
Good idea. Everyone success. |
Abdeltif « Citoyen » 1398895560000
| 0 | ||
Ediz if you feel this thread is more active and better you can lock mine already , :) (It's Topic-622538 ) |
Blackzdragon « Citoyen » 1399020900000
| 0 | ||
i dont get it no support whatsoever |
Leafileaf « Citoyen » 1403181600000
| 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 |