[Ruby]SytheAdmins

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

[Ruby]SytheAdmins
  1. Unread #1 - Jan 31, 2007 at 8:04 PM
  2. Chase
    Joined:
    Mar 8, 2006
    Posts:
    1,858
    Referrals:
    6
    Sythe Gold:
    11

    Chase Whore
    Retired Global Moderator

    [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?
     
  3. Unread #2 - Feb 1, 2007 at 5:09 PM
  4. cp
    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0

    cp an cat
    Banned

    [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.
     
  5. Unread #3 - Feb 7, 2007 at 7:01 PM
  6. Govind
    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

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    [Ruby]SytheAdmins

    What about Cheater and Filefragg?
     
  7. Unread #4 - Feb 7, 2007 at 7:06 PM
  8. Chase
    Joined:
    Mar 8, 2006
    Posts:
    1,858
    Referrals:
    6
    Sythe Gold:
    11

    Chase Whore
    Retired Global Moderator

    [Ruby]SytheAdmins

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

    Thanks cp.
     
  9. Unread #5 - Feb 10, 2007 at 1:55 PM
  10. cp
    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0

    cp an cat
    Banned

    [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.
     
  11. Unread #6 - Feb 12, 2007 at 10:27 PM
  12. Puzzle
    Joined:
    May 6, 2005
    Posts:
    846
    Referrals:
    0
    Sythe Gold:
    0

    Puzzle Apprentice

    [Ruby]SytheAdmins

    i dont understand how this works? explain please.. ruby looks fun
     
  13. Unread #7 - Feb 13, 2007 at 6:56 PM
  14. cp
    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0

    cp an cat
    Banned

    [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***++***} >

Users viewing this thread
1 guest


 
 
Adblock breaks this site