Highlights
Topics
Questions
1. Draw a valid Sudoku look
In this section, you will draw the look of a typical Sudoku. It will accept characters from the user and then draw those characters in the positions in the grid that are clicked on by the mouse. At the end of the assignment, the only valid inputs that should be accepted are digits between 1-9, but do not worry about that for this question! You will cover this in the next question. For this question, your program should be able to enter any character in the canvas, as long as there is an empty cell.
All the characters must be positioned at the center of a cell on the canvas. If the size of the canvas changes to other values between 100-900, with width and height always the same, the characters still have to be drawn at the center of the cells, and the text size should change to an appropriate size (not too big or too small).
In both Question 1 and Question 2, some numbers will already be in the grid when the program starts (place the blue numbers in the proper indexes of your array/s), and others will be entered by the user as in Question 1. Provide a suitable mechanism so that numbers that are there at the beginning will be drawn in a different color than the characters entered by the user. In the second question, you can delete a character that was enter by the user, but not the other numbers. Having a different colour makes it easy to spot the user-entered characters.
Purpose of the code
When the code runs, type a character with the keyboard and then click on an empty cell with the mouse. If the cell is empty, draw the character. If the cell is not empty, you shouldn’t be able to enter a character in the cell. By completing this question, your program should be able to map a mouse click on the canvas to the corresponding index in your array(s) (depends on your implementation).
2. A functional Sudoku with error detection
Save your DentStewA5Q1.pde program as DentStew_A5Q2.pde and then modify it. In this section, you will be completing your Sudoku which:
This COMP1010 – Computer Science has been solved by our PHD Experts at My Uni Paper.
© Copyright 2026 My Uni Papers – Student Hustle Made Hassle Free. All rights reserved.