Need help with my lua

Discussion in 'Python' started by Thiefcom, Aug 22, 2017.

  1. Thiefcom

    Thiefcom

    Joined:
    Jun 1, 2017
    Messages:
    48
    Likes Received:
    6
    local lives = 10
    local randomnum = math.random(1 , 50)

    print("Welcome to higher or lower.")

    while live > 0 do

    print("You have"..lives.."Left, Guess the number!")

    local number = io.read()
    number = tonumber(number)

    if number == randomnumber then

    print("Your right")

    break
    elseif number < randomnumber then

    print("Guess higher!")

    elseif number > randomnumber then

    print("Guess lower!")

    if lives <= 0 then

    print("You failed")

    break
    end
    end

    io.read()

    Help me don't work
     
    Thiefcom, Aug 22, 2017
    #1
    1. Advertisements

  2. Thiefcom

    John Joe

    Joined:
    Apr 25, 2017
    Messages:
    57
    Likes Received:
    11
    Location:
    Malaysia
    Don't work mean ? Where are all the semicolon ?
     
    John Joe, Aug 22, 2017
    #2
    1. Advertisements

  3. Thiefcom

    Thiefcom

    Joined:
    Jun 1, 2017
    Messages:
    48
    Likes Received:
    6
    I saw how to make the code and wrote it word by word but it did not work I got the lua exit error
     
    Thiefcom, Aug 24, 2017
    #3
  4. Thiefcom

    John Joe

    Joined:
    Apr 25, 2017
    Messages:
    57
    Likes Received:
    11
    Location:
    Malaysia
    Zero knowledge for python....Sorry
     
    John Joe, Aug 24, 2017
    #4
    1. Advertisements

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Roman Fordinal

    binding lua (newbie)

    Roman Fordinal, Oct 13, 2004, in forum: C++
    Replies:
    4
    Views:
    4,205
  2. John Benson

    Lua, Lunatic and Python

    John Benson, Dec 13, 2003, in forum: Python
    Replies:
    0
    Views:
    481
    John Benson
    Dec 13, 2003
  3. Gustavo Niemeyer

    Re: Lua, Lunatic and Python

    Gustavo Niemeyer, Dec 13, 2003, in forum: Python
    Replies:
    28
    Views:
    1,237
    Stephen J. Bevan
    Dec 19, 2003
  4. John Benson
    Replies:
    4
    Views:
    571
    Frank Bechmann
    Jan 2, 2004
  5. John Benson
    Replies:
    4
    Views:
    940
    David M. Cooke
    Jan 9, 2004
  6. John Benson

    Lua versus C++ for embedded processor

    John Benson, Jan 14, 2004, in forum: Python
    Replies:
    5
    Views:
    713
    Cameron Laird
    Sep 14, 2004
  7. Carsten Eckelmann

    Game Programming with Python, Lua and Ruby

    Carsten Eckelmann, Jan 11, 2004, in forum: Ruby
    Replies:
    3
    Views:
    314
    Shashank Date
    Jan 13, 2004
  8. Catalin Tilimpea

    Parsing lua with Ruby

    Catalin Tilimpea, Jul 3, 2009, in forum: Ruby
    Replies:
    7
    Views:
    352
    Catalin Tilimpea
    Jul 6, 2009
Loading...