You will need to make a table (list of lists) of your Textboxes.
For Sudoku, a 9 by 9 table should work well.
You will also need functions (value procedures that take a textbox component and return its row(1-9) and column (1-9).
You will need to code a true/false value procedure sibling that takes the addresses (row1, column1, row2, column2) of two squares and tells you if the two squares are located in the same row, column, or 3 by 3 square of the board. This is needed for checking if a proposed value (1-9) has already been claimed by a sibling and is therefore forbidden.
You will need the for each number loop block to traverse rows and columns to cover them all while keeping track of where you are.
To stop the player from changing a textbox value, turn off (false) its Enabled attribute.
To tell the player that a given number is hard coded as part of the puzzle, also mark that textbox as Bold.
If you haven't yet set up your 81 text boxes, here is a trick to make it easier using Copy (Ctrl-C) and Paste (Ctrl-V) in the Designer:
- Make a Vertical Arrangement. (Fill Parent, centered)
- Make a Horizontal Arrangement inside that Vertical Arrangement (Fill Parent, centered)
- Add a Textbox into the Horizontal Arrangement (empty, centered, numeric, Fill Parent)
- Select the text box and press Ctrl-C to start the copying
- Select the Horizontal Arrangement then press CTrl-V 8 times to paste in the rest of the row
- While the Horizontal Arrangement is selected, Press Ctrl-C to prepare to copy it
- select the Vertical Arrangement then press CTrl-V (Paste) 8 times to paste in rows 2-9
Here are some projects to study, to learn how to use generic blocks and lists of components ...
the eight queens problem
http://ai2.appinventor.mit.edu/?galleryId=5858910198693888