• Log in or sign up for an account here: https://www.sythe.org/login

[Ruby]SytheAdmins

Chase

Whore

Retired Global Moderator
Joined
Mar 8, 2006
Sythe Gold
11
Messages
1,858
Age
33
Code:
# *COMMENT* After you put this program in and save it, type SytheAdmins and it will repeat whats after puts. 
# *COMMENT* Sythe.org has too many admins
#!/user/bin/ruby
def SytheAdmins
  puts "Sythe, Steph, Clash, Annex, Unknown, Vic, Cheater, and Filefragg are the admins of Sythe.org"
10.times do
end

# Adds comments

def is defining fuctions

puts lets you define other things

10.times do will make it say the SytheAdmin Function 10 times.



One question though to any Ruby programmers, would 10.times do go before or after the puts defining?
 
I really don't know ruby, but from my experience with a similar function in php, function(), it would do the 10.times do after the 'SytheAdmins' is defined.
 
Le Monkey
PHP Shit Show 2k26
Potamus
Prove it!
Sythe Awards 2011 Winner
Tier 1 Prizebox
Tortoise Penis
Trole
UWotM8?
Wait, do you not have an Archer rank?
What about Cheater and Filefragg?
 
I don't really know ruby, but do you need to do this from the command line? Or will it work as a webpage as well? Because I know you can do something like that in javascript, but with a much longer process.
 
i dont understand how this works? explain please.. ruby looks fun
 
Is it just me, or did you mean #!/usr/bin/ruby ? Because my experiences with linux says that there is no /user/ directory (in your case) but a /usr/ instead.

And the '10.times do', is that sort of a loop? Because it looks to me that there isn't anything specifically designated to be done in the loop. wouldn't it be like:

Code:
10.times do:
     SytheAdmins
or
Code:
10.times do {
SytheAdmins }

Or something similar? Because even though I don't know ruby, I do know that in loops, something has to be done in the loop, or else it'll just do nothing 10 times.
 
Runescape Gamblingrunescape gambling
Back
Top