ÎÌÌÌ̈ˆˆ¬ªªª¬ˆˆˆ¬ÌÌ̬ÌÀ̬ÌÀ̬ÌÀÌÌÌìÌÀÀî̬ÀÌÀ¬ÀÀÀ¬ÀÀÀ¬ÀÀÎÌÌÌ̈ˆˆ¬ªªª¬ˆˆˆ¬ÌÌ̬ÌÌ̬ÌÀ̬ÌÀÌÌÌìÌÀÀî̬ÀÌ̬ÀÀÀ¬ÀÀÀ¬ÀÀ¬ÌÌ̬ªªª¬ª¬ª¬ªÊ̬ªªªŒˆˆˆÌÀÌÎÌÌÎ̬̪ªÀ쬪ÀÀÀÌîÀìîÌÌîî¬ÌÌ̬ªªª¬ª¬ª¬ªÊ̬ªªªŒˆˆˆÌÀÌÎÌÌÎ̬̪ªÀ쬪ÀÀÀÌîÀìîÌÌîî >Ú> ÌÌÀ ÌÌÀÌÌÌ ÌÌÀÌ À ÀÀ ÀÌ Ì ÀÌ ÌÌ Ì ÌÌÀ ÌÀÌÀ ÀÀ ÀÀÌÌÀ ÀÀ ÌÀ ÀÌÌ ÌÌÌÀÌÀÌÀ ÀÀ ÀÀÀÀÀ ÀÀÌÀ ÌÀ ÌÌÀÌÌ ÌÌÀ ÀÌ ÀÀÀÀÌ Ì À ppwpppwwÌÌÀ ÀÌÌÌÌ ÌÌ À Ì À ÀÌÌÀÌÌÀÌÌ ÀÌÌ ÌÌÌÀ ÌÌÀÌÌÌÌÌ ÀÌÌÌ À ÌÀ ÌÀÌÌ ÀÌÌ ÀÌÀÌÌ ÀÌ ÀÌÀÌ À À ÌÌ ÌÌ ÀÌ ÌÌÌÌ ÀÌÌ ÀÌÀÌ ÀÌ ÀÌ Ì ÀÌÀ À Ì À À Ì ÌÀ Ì Ì ÌÀ ÀÀÌÌ À À ÌÀ ÌÌ Ì Ì Ì Ì ÌÀ ÀÀÌÌÀ Ì ÌÌÌ ÀÌ ÌÌ À ÀÌÀÌÌÌÌÌÌÀ ÀÌÌ À ÌÀÌÌ À ÀÌÀÀ À ÀÌÌÌ ë-- title: The Command Mind Reader -- author: N.G. Jose -- desc: A progam mind reader -- site: https://www.youtube.com/@ngjose -- license: N.G. Jose grants you a non-exclusive, non-transferable license to use the progam for personal, non-commercial use. -- version: 0.1 -- script: lua -- Constants MENU_OPTION_START = "Press Z to start program" numbers = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} -- List of numbers (no "Start guessing" here) START_GUESSING_TEXT = "Start guessing" -- Separate for positioning in the corner RESET_OPTION_TEXT = "Reset" -- Text for the reset option -- State selected_option = 1 in_cmd_room = false -- Flag to check if we are in the "command prompt" room selected_number = nil -- To store the player's selected number guessing_started = false -- Flag for starting the guessing function init() -- Initialization end function TIC() cls(0) -- Clear screen if not in_cmd_room then -- Main menu screen print("The Command Mind Reader", 50, 30, 12) -- Title at position (50, 30) in color 12 print(MENU_OPTION_START, 50, 60, selected_option == 1 and 7 or 12) -- Menu option -- Check for input if btnp(4) then -- Z key is pressed in_cmd_room = true -- Move to command prompt room sfx(0) -- Play selection sound when entering the room end else -- Command prompt room if not guessing_started then if selected_number then -- Show selected number above "Write a number" if already chosen print("Selected number: " .. selected_number, 10, 0, 12) end print("Write a number", 10, 20, 12) -- Prompt below selected number -- Display list of numbers for i = 1, #numbers do if i == selected_option then print("> " .. numbers[i], 10, 40 + (i - 1) * 10, 7) -- Highlight selected number else print(numbers[i], 10, 40 + (i - 1) * 10, 12) -- Display unselected number end end -- "Start guessing" in the bottom-right corner local start_guessing_x = 240 - (#START_GUESSING_TEXT * 6) - 10 -- Calculate correct x-position local start_guessing_y = 136 - 10 -- y-position slightly above the bottom print(START_GUESSING_TEXT, start_guessing_x, start_guessing_y, selected_option == #numbers + 1 and 7 or 12) -- Highlight if selected -- Navigate through the numbers using up/down arrow keys if btnp(0) then -- Up arrow key selected_option = selected_option > 1 and selected_option - 1 or #numbers + 1 elseif btnp(1) then -- Down arrow key selected_option = selected_option < #numbers + 1 and selected_option + 1 or 1 end -- Select a number or start guessing with Z if btnp(4) then -- Z key is pressed sfx(0) -- Play selection sound when Z is pressed if selected_option == #numbers + 1 then -- "Start guessing" is selected guessing_started = true -- Hide the list and start guessing else selected_number = numbers[selected_option] -- Store the selected number end end else -- Guessing screen after "Start guessing" is selected if selected_number then print("The number you are thinking of is: " .. selected_number, 10, 50, 12) end -- Display Reset option print(RESET_OPTION_TEXT, 10, 70, 12) -- Position the reset option -- Check for Reset input if btnp(4) then -- Z key is pressed if btn(4) then -- If the reset option is selected sfx(0) -- Play selection sound when resetting -- Reset the game state selected_option = 1 in_cmd_room = false selected_number = nil guessing_started = false end end end end end