iAmUserNumberOne's recent activity

  1. Comment on Programming Challenge: Translate 24-hour time into words in ~comp

    iAmUserNumberOne
    Link
    I used python. It's probablsy not the best solution but i guess it works ¯\_(ツ)_/¯ hours = 0 minutes = 0 amOrPM = "am" oh = "" translation = ["", "One", "Two", "Three", "Four", "Five", "Six",...

    I used python. It's probablsy not the best solution but i guess it works ¯\_(ツ)_/¯

    hours = 0
    minutes = 0
    amOrPM = "am"
    oh = ""
    
    translation = ["", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve",
                     "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen", "Twenty", "Twenty-One",
                     "Twenty-Two", "Twenty-Three", "Twenty-Four", "Twenty-Five", "Twenty-Six", "Twenty-Seven", "Twenty-Eight", "Twenty-Nine",
                     "Thirty", "Thirty-One", "Thirty-Two","Thirty-Three", "Thirty-Four", "Thirty-Five", "Thirty-Six", "Thirty-Seven", "Thirty-Eight", "Thirty-Nine",
                     "Fourty", "Fourty-One", "Fourty-Two","Fourty-Three", "Fourty-Four", "Fourty-Five", "Fourty-Six", "Fourty-Seven", "Fourty-Eight", "Fourty-Nine",
                     "Fifty", "Fifty-One", "Fifty-Two","Fifty-Three", "Fifty-Four", "Fifty-Five", "Fifty-Six", "Fifty-Seven", "Fifty-Eight", "Fifty-Nine"]
    
    while(1):
        inClock = input("Enter a time: ")
        inputArr = inClock.split(":")
    
        hours = int(inputArr[0])
        minutes = int(inputArr[1])
        
        if hours > 12:
            hours -= 12
            AMorPM = " pm"
        elif hours == 0:
            hours = 12
            AMorPM = "am"
        else:
            AMorPM = " am"
    
        if minutes < 10 and minutes > 0:
            oh = " oh "
        else:
            oh = " "
        
        print("It's " + translation[hours] + oh + translation[minutes] + AMorPM + ".\n")
    
    2 votes
  2. Comment on Hey ~comp, what's your current project? in ~comp

    iAmUserNumberOne
    Link
    I'm trying to make a game using Python. Basically i'm a python noob, only experience is in C and Java. However the languages are kinda similar so it doesn't seem to hard.

    I'm trying to make a game using Python. Basically i'm a python noob, only experience is in C and Java. However the languages are kinda similar so it doesn't seem to hard.

  3. Comment on What books are you reading nowadays? in ~misc

    iAmUserNumberOne
    Link
    How is Artemis? I loved The Martian, when i saw Artemis in a bookstore i knew i had to read it. Currently i'm reading End of the World Running Club. A story about a world after asteroids hit earth.

    How is Artemis? I loved The Martian, when i saw Artemis in a bookstore i knew i had to read it.
    Currently i'm reading End of the World Running Club. A story about a world after asteroids hit earth.