Adblock breaks this site

[Ruby]SytheAdmins

Discussion in 'Web Programming' started by Chase, Jan 31, 2007.

  1. Chase

    Chase Whore
    Retired Global Moderator

    Joined:
    Mar 8, 2006
    Posts:
    1,858
    Referrals:
    6
    Sythe Gold:
    11
    [Ruby]SytheAdmins

    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?
     
  2. cp

    cp an cat
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0
    [Ruby]SytheAdmins

    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.
     
  3. Govind

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus
    [Ruby]SytheAdmins

    What about Cheater and Filefragg?
     
  4. Chase

    Chase Whore
    Retired Global Moderator

    Joined:
    Mar 8, 2006
    Posts:
    1,858
    Referrals:
    6
    Sythe Gold:
    11
    [Ruby]SytheAdmins

    I haven't updated it in a while. Updated :).

    Thanks cp.
     
  5. cp

    cp an cat
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0
    [Ruby]SytheAdmins

    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.
     
  6. Puzzle

    Puzzle Apprentice

    Joined:
    May 6, 2005
    Posts:
    846
    Referrals:
    0
    Sythe Gold:
    0
    [Ruby]SytheAdmins

    i dont understand how this works? explain please.. ruby looks fun
     
  7. cp

    cp an cat
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0
    [Ruby]SytheAdmins

    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.
     
< Download Via Php? | {***++***Build your site with PHP***++***} >


 
 
Adblock breaks this site