Grade 10 ICS Summative - Minesweeper
Author |
Message |
Nathan4102
|
Posted: Sat Jul 06, 2013 4:48 pm Post subject: Grade 10 ICS Summative - Minesweeper |
|
|
Hey guys,
This is my final summative for grade 10 ICS this year. The task was to make a game, with most people doing a graphical Rock Paper Scissors. I'm really only posting this to see what I could improve on in my code, but I'll post the full package aswell so you can try it out.
Let me know what you think of it!
Note: There is a cheat constant at the top of the program used for bug testing. If all the cells are highlighted, thats why!
Code:
Turing: | %Nathaniel Woodthorpe
%May 17, 2013
%Minesweeper.t
%Create Minesweeper in Turing - ICS2OI Summative
const CHEAT := true
var background1 := Pic.FileNew ("background1.bmp") %Title screen Image
var background2 := Pic.FileNew ("background2.bmp") %Gameplay background Image
var losescreen := Pic.FileNew ("Losescreen.bmp") %Lose screen
var winscreen := Pic.FileNew ("Winscreen.bmp") %Win screen
var minescreen := Pic.FileNew ("SelectMines.bmp") %Select Mines screen
var flag := Pic.FileNew ("flag.jpg") %Flag
var font1 : int := Font.New ("Ariel:15") %Normal Font
var font2 : int := Font.New ("David:20") %Title Font
var loading_Bar : int := 150 %Variable for loading bar
var x, y, button, lastbutton, lastbutton1 : int := 0 %For Mousewhere, and to prevent dragging
var clock_Start, seconds : int %Used in Clock function
var fail : boolean := false %Used in random mine placement
var winOrLose : int := 0 %Used in retry? section
var retry : boolean := false %Used in retry? section
var numberOfMines := 60 %Set number of mines
const OFFSET := 13 %Used in cell placement
type Cells : %Record to store data for each cell
record
x1, y1 : int
clicked, mine : boolean
number, icon : int
end record
type Mines : %Holds mine location, used in random mine placement
record
x, y : int
end record
var cell_Array : array 1 .. 16, 1 .. 16 of Cells %Array of records, 1 per cell
var mine : array 1 .. numberOfMines of Mines %Used for random mine placement
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%FUNCTIONS/PROCEDURES BEGIN%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Function Name: Clock %
%Function Desc.: Outputs time since start in string format %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function Clock : string
var minutes, hours : int := 0
var elapsed : string
seconds := round ((Time.Elapsed - clock_Start ) div 1000)
loop
if seconds > 59 then
minutes + = 1
seconds - = 60
end if
if minutes > 59 then
hours + = 1
minutes - = 60
end if
exit when seconds <= 59
end loop
elapsed := intstr (hours ) + ":" + intstr (minutes ) + ":" + intstr (seconds )
result elapsed
end Clock
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Function Name: HowManyMines%%%%%%%%%%%%%%%%%%
%Function Desc.: Display mine selection scrn%%
%And wait for a selection%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function HowManyMines : int
Pic.Draw (minescreen, 0, 0, picCopy)
View.Update
loop
mousewhere (x, y, button )
if x > 42 and x < 110 and y > 20 and y < 80 and button = 1 then
result 20
elsif x > 140 and x < 210 and y > 95 and y < 160 and button = 1 then
result 30
elsif x > 275 and x < 340 and y > 85 and y < 160 and button = 1 then
result 40
elsif x > 370 and x < 440 and y > 22 and y < 85 and button = 1 then
result 60
end if
end loop
end HowManyMines
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Procedure Name: PlaceMines %
%Procedure Desc.: Randomly generates mine positions %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
procedure PlaceMines
for i : 1 .. numberOfMines
loop
fail := false
mine (i ).x := Rand.Int (1, 16)
mine (i ).y := Rand.Int (1, 16)
for ii : 1 .. i - 1
if mine (i ).x = mine (ii ).x and mine (i ).y = mine (ii ).y then
fail := true
end if
end for
if fail = false then
exit
end if
end loop
end for
for i : 1 .. numberOfMines
cell_Array (mine (i ).x, mine (i ).y ).mine := true
end for
end PlaceMines
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Procedure Name: GenerateNumber %
%Procedure Desc.: Find how many mines are near each cell %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
procedure GenerateNumber
var num : int := 0
for i : 1 .. 16
for ii : 1 .. 16
if cell_Array (i, ii ).mine = false then
for j : max (i - 1, 1) .. min (i + 1, 16)
for k : max (ii - 1, 1) .. min (ii + 1, 16)
if cell_Array (j, k ).mine = true then
num := num + 1
cell_Array (i, ii ).number := num
end if
end for
end for
end if
num := 0
end for
end for
num := 0
end GenerateNumber
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Procedure Name: FindZeros %
%Procedure Desc.: Clicks all cells around 0's.%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
procedure FindZeros
for i : 1 .. 16
for ii : 1 .. 16
if cell_Array (i, ii ).mine = false and
cell_Array (i, ii ).clicked = true and
cell_Array (i, ii ).number = 0 then
for j : max (i - 1, 1) .. min (i + 1, 16)
for k : max (ii - 1, 1) .. min (ii + 1, 16)
cell_Array (j, k ).clicked := true
end for
end for
end if
end for
end for
end FindZeros
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Function Name: CycleIcon %
%Function Desc.: Alternates between 1 and 0, used %
%for flags. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function CycleIcon (CurrentIcon : int) : int
case CurrentIcon of
label 0 :
result 1
label 1 :
result 0
end case
end CycleIcon
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Procedure Name: CheckWin %
%Procedure Desc.: Checks to see if user has won %
%Note: 1 is win, 0 is no win %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function CheckWin : int
var clicked : int := 0
for i : 1 .. 16
for ii : 1 .. 16
if cell_Array (i, ii ).clicked = true then
clicked := clicked + 1
end if
end for
end for
if clicked = 256 - numberOfMines then
result 1
else
result 0
end if
end CheckWin
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Procedure Name: Initialise %
%Procedure Desc.: Initialises all program stuff %
%Note: Used to keep code main loop neater %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
procedure Initialise
setscreen ("graphics:500;530")
View.Set ("offscreenonly")
buttonchoose ("multibutton")
Pic.Draw (background1, 0, 0, picMerge) %Draw Title Background
drawfillbox (150, 180, 350, 195, white)
drawbox (150, 180, 350, 195, black)
Draw.Text ("Loading...", 210, 200, font1, black) %Draw loading bar
loop %Fake loading screen
if loading_Bar > 335 then
loading_Bar := 350
else
loading_Bar + = Rand.Int (2, 15)
end if
drawfillbox (150, 180, loading_Bar, 195, cyan)
drawbox (150, 180, loading_Bar, 195, black)
delay (Rand.Int (10, 200))
View.Update
exit when loading_Bar = 350
end loop
cls
clock_Start := Time.Elapsed %Begin clock
Pic.Draw (background2, 0, 0, picMerge)
Draw.Text ("Minesweeper", 175, 485, font2, black)
for i : 1 .. 16 %Initialise cell boundories and properties
for ii : 1 .. 16
cell_Array (i, ii ).x1 := ((i - 1) * 30) + OFFSET
cell_Array (i, ii ).y1 := ((ii - 1) * 30) + OFFSET
cell_Array (i, ii ).clicked := false
cell_Array (i, ii ).mine := false
cell_Array (i, ii ).number := 0
cell_Array (i, ii ).icon := 0
end for
end for
end Initialise
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Procedure Name: Reset%%%%%%%%%%%%%%%%%%%%%%
%Procedure Desc.: Resets variables%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
procedure Reset
for i : 1 .. 16
for ii : 1 .. 16
cell_Array (i, ii ).clicked := false
cell_Array (i, ii ).mine := false
cell_Array (i, ii ).number := 0
cell_Array (i, ii ).icon := 0
end for
end for
winOrLose := 0
clock_Start := Time.Elapsed
lastbutton := 1
end Reset
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%FUNCTIONS/PROCEDURES END%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%MAIN LOOP BEGIN%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Initialise
loop
numberOfMines := HowManyMines
PlaceMines
GenerateNumber
delay (200)
loop
Pic.Draw (background2, 0, 0, picMerge) %Draw background, clock, and title
Draw.Text (Clock, 50, 495, font2, black) %
Draw.Text ("Minesweeper", 175, 495, font2, black) %
for i : 1 .. 16 %Draws black boxes behind cells
for ii : 1 .. 16
drawfillbox (cell_Array (i, ii ).x1 - 2, cell_Array (i, ii ).y1 - 2, cell_Array (i, ii ).x1 + 25, cell_Array (i, ii ).y1 + 25, black)
end for
end for
mousewhere (x, y, button ) %Gets mouse coords and button state
for i : 1 .. 16 %Draws smaller blue box ontop of black creating a 1px border
for ii : 1 .. 16
if x > cell_Array (i, ii ).x1 - 3 and %If mouse is in cell boundries
x < cell_Array (i, ii ).x1 + 28 and %Then check if mouse is down
y > cell_Array (i, ii ).y1 - 5 and %If it is, check if mouse
y < cell_Array (i, ii ).y1 + 26 then %Button is down. If so,
if button = 1 then
if lastbutton1 = 0 then
lastbutton1 := 1
if cell_Array (i, ii ).mine = true then
winOrLose := 2 %If we lose, set winOrLose to 2
end if
cell_Array (i, ii ).clicked := true %Draw a light blue box
drawfillbox (cell_Array (i, ii ).x1, cell_Array (i, ii ).y1, cell_Array (i, ii ).x1 + 25, cell_Array (i, ii ).y1 + 25, blue)
end if
else
lastbutton1 := 0
if button = 100 then %If right click, put/remove flag
if lastbutton = 0 then %Lastbutton prevents flickering
lastbutton := 1 %Of flag
cell_Array (i, ii ).icon := CycleIcon (cell_Array (i, ii ).icon )
end if
else
lastbutton := 0
end if
if cell_Array (i, ii ).clicked = true then %If a cell is clicked, display the number
drawfillbox (cell_Array (i, ii ).x1, cell_Array (i, ii ).y1, cell_Array (i, ii ).x1 + 25, cell_Array (i, ii ).y1 + 25, grey)
if cell_Array (i, ii ).number not= 0 then
Font.Draw (intstr (cell_Array (i, ii ).number ), cell_Array (i, ii ).x1 + 8, cell_Array (i, ii ).y1 + 6, font1, black)
end if
else %Otherwise, display the blue box
drawfillbox (cell_Array (i, ii ).x1, cell_Array (i, ii ).y1, cell_Array (i, ii ).x1 + 25, cell_Array (i, ii ).y1 + 25, cyan)
end if
end if
else %Draw number if cell is clicked
if cell_Array (i, ii ).clicked = true then
drawfillbox (cell_Array (i, ii ).x1, cell_Array (i, ii ).y1, cell_Array (i, ii ).x1 + 25, cell_Array (i, ii ).y1 + 25, grey)
if cell_Array (i, ii ).number not= 0 then %Don't draw number if cell.number = 0
Font.Draw (intstr (cell_Array (i, ii ).number ), cell_Array (i, ii ).x1 + 8, cell_Array (i, ii ).y1 + 6, font1, black)
end if
else
if cell_Array (i, ii ).mine = true and CHEAT = true then
drawfillbox (cell_Array (i, ii ).x1, cell_Array (i, ii ).y1, cell_Array (i, ii ).x1 + 25, cell_Array (i, ii ).y1 + 25, 5)
else
drawfillbox (cell_Array (i, ii ).x1, cell_Array (i, ii ).y1, cell_Array (i, ii ).x1 + 25, cell_Array (i, ii ).y1 + 25, 150)
end if
end if
end if
if cell_Array (i, ii ).icon = 1 then %If cell's "icon" attribute is 1, draw flag
drawfillbox (cell_Array (i, ii ).x1, cell_Array (i, ii ).y1, cell_Array (i, ii ).x1 + 25, cell_Array (i, ii ).y1 + 25, grey)
Pic.Draw (flag, cell_Array (i, ii ).x1 + 3, cell_Array (i, ii ).y1 + 3, picMerge)
end if
end for
end for
FindZeros %Look to see if we can expand any zeros
if CheckWin = 1 then %If we've won, set winorLose to 1
winOrLose := 1
end if
View.Update %Update screen
exit when winOrLose = 1 or winOrLose = 2 %Exit if we win or if we lose
end loop
case winOrLose of %DIsplay win/lose picture
label 1 :
Pic.Draw (winscreen, 0, 0, picCopy)
Draw.Text (Clock, 370, 345, font1, black)
label 2 :
Pic.Draw (losescreen, 0, 0, picCopy)
end case
View.Update
delay (500) %Prevents buttons from being accidentally clicked
loop
mousewhere (x, y, button )
if x > 100 and x < 400 and y > 50 and y < 125 and button = 1 then
retry := false %"No thanks!" button
exit
elsif x > 100 and x < 400 and y > 145 and y < 215 and button = 1 then
retry := true %"Lets go!" button
exit
end if
View.Update
end loop
exit when retry = false %Exit loop/program if we don't want to retry
Reset %Reset all variables since we want to play again
delay (200) %Short delay so that we don't accidentally click cell
end loop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%MAIN LOOP END%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%Personal Best - 2:26%%%%%%%%%%%%%%%%%%
|
Description: |
|
Download |
Filename: |
Summative.rar |
Filesize: |
4.95 MB |
Downloaded: |
405 Time(s) |
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
Raknarg
|
Posted: Sat Jul 06, 2013 10:07 pm Post subject: RE:Grade 10 ICS Summative - Minesweeper |
|
|
Just a cool way to write findzeroes: Recursion!
Turing: |
procedure FindZeros (x, y : int)
if cell (x, y).clicked = false and cell (x, y).numMines = 0 and x >= 1 and x <= width and y >= 1 and y <= height then
cell (x, y).clicked := true
FindZeroes (x + 1, y)
FindZeroes (x - 1, y)
FindZeroes (x, y + 1)
FindZeroes (x, y - 1)
end if
end FindZeros
|
|
|
|
|
|
|
Raknarg
|
Posted: Sat Jul 06, 2013 10:09 pm Post subject: RE:Grade 10 ICS Summative - Minesweeper |
|
|
Also, for the purpose of this game, I think it'd be cool if you learned to make your own buttons
|
|
|
|
|
|
Nathan4102
|
Posted: Mon Jul 08, 2013 3:55 pm Post subject: RE:Grade 10 ICS Summative - Minesweeper |
|
|
What do you mean by the buttons? Like make a full button class or something? Im not using the GUI.Button buttons, so I kind of made my own!
|
|
|
|
|
|
Zren
|
Posted: Mon Jul 08, 2013 4:05 pm Post subject: RE:Grade 10 ICS Summative - Minesweeper |
|
|
Use constants for the number of rows/coloumns instead of hardcoding the ranges. This way you could later abstract away difficulty/size. Seeing as you used an uncommon number (16), you could probably get away with a Find/Replace.
code: |
if x > cell_Array (i, ii).x1 - 3 and %If mouse is in cell boundries
x < cell_Array (i, ii).x1 + 28 and %Then check if mouse is down
y > cell_Array (i, ii).y1 - 5 and %If it is, check if mouse
y < cell_Array (i, ii).y1 + 26 then %Button is down. If so, |
What are these (-3, 28, -5, 26) magic numbers you're pulling out of your hat?
You use 25 a lot. Is that the size of each cell? If so, make it a constant.
Turing: |
loop %Fake loading screen
if loading_Bar > 335 then
loading_Bar := 350
else
loading_Bar + = Rand.Int (2, 15)
end if
drawfillbox (150, 180, loading_Bar, 195, cyan)
drawbox (150, 180, loading_Bar, 195, black)
delay (Rand.Int (10, 200))
View.Update
exit when loading_Bar = 350
end loop
|
These are pure evil. There is no situation where you want a fake loading screen. Ever. If there isn't a noticeable pause during code execution (that isn't caused from loading the Turing environment), then perish the thought. Some of the best games are those without an actual loading screen.
Instead of forcing a pause on the user, try animating static menus/screens.
~
Turing: |
if x > 100 and x < 400 and y > 50 and y < 125 and button = 1 then
retry := false %"No thanks!" button
exit
elsif x > 100 and x < 400 and y > 145 and y < 215 and button = 1 then
retry := true %"Lets go!" button
exit
end if
|
There's no point in doing 8 comparisons against x and y if button isn't pressed. This might be inconsequential in code this small, but getting in the habit is good.
code: | delay (200) %Short delay so that we don't accidentally click cell |
Perhaps you should expand on what you were trying to achieve with lastbutton.
The following is a little code snippet that works for a single button. You'd have to expand on it to get it working for multiple buttons, but it's the same concept of looking at the previous state.
Turing: |
type MouseData :
record
x, y, b : int
end record
var mouse, mouseLast : MouseData := init (0, 0, 0)
fcn MouseReleased () : boolean
% In the last state, we were pressing the mouse.
% In the current state, we are not.
result mouseLast.b = 1 and mouse.b = 0
end MouseReleased
var winId := Window.Open ("")
loop
% Poll Input
mouseLast := mouse
Mouse.Where (mouse.x, mouse.y, mouse.b )
if MouseReleased () and 0 < mouse.x and mouse.x < maxx then
exit
end if
end loop
Window.Close (winId )
|
code: | function Clock : string |
There's a much better way of doing this. Look into div and mod. Note how you divide milliseconds by a 1000 to get the number of seconds, but the remainder of that division aught to be the number of milliseconds.
code: | seconds := round ((Time.Elapsed - clock_Start) div 1000) |
The div operation will return an integer, so the rounding is pointless.
|
|
|
|
|
|
Raknarg
|
Posted: Mon Jul 08, 2013 4:37 pm Post subject: RE:Grade 10 ICS Summative - Minesweeper |
|
|
I was thinking more teaching him classes
|
|
|
|
|
|
Nathan4102
|
Posted: Mon Jul 08, 2013 6:35 pm Post subject: Re: RE:Grade 10 ICS Summative - Minesweeper |
|
|
"What are these (-3, 28, -5, 26) magic numbers you're pulling out of your hat? "
To be honest, I don't remember where those numbers came from... I wrote this a couple months ago, just forgot to post it. I'm sure they have some sort of meaning though!
"You use 25 a lot. Is that the size of each cell? If so, make it a constant. "
25 is the width/height of a cell, so in the future, Ill use constants for these things
"These are pure evil. There is no situation where you want a fake loading screen. Ever. If there isn't a noticeable pause during code execution (that isn't caused from loading the Turing environment), then perish the thought. Some of the best games are those without an actual loading screen.
Instead of forcing a pause on the user, try animating static menus/screens. "
I know that these aren't very practicial, and I probably shouldn't use them in real programs. My class had this weird thing with fake loading screens though, every single one of us added one. It kind of makes it look like you have a complex program!
"There's no point in doing 8 comparisons against x and y if button isn't pressed. This might be inconsequential in code this small, but getting in the habit is good. "
Thats a good point, I should have just checked if button = 1 first, and then check all the other stuff.
"The following is a little code snippet that works for a single button. You'd have to expand on it to get it working for multiple buttons, but it's the same concept of looking at the previous state. "
It kind of looks just like what I've used, except it checks when the mouse is released. I'm not sure why I didn't do that
"There's a much better way of doing this. Look into div and mod. Note how you divide milliseconds by a 1000 to get the number of seconds, but the remainder of that division aught to be the number of milliseconds."
That could have shortened that code quite a bit... thanks!
Thanks for all the suggestions Zren! And Raknarg, I'll learn classes one day!
|
|
|
|
|
|
Raknarg
|
Posted: Mon Jul 08, 2013 6:52 pm Post subject: RE:Grade 10 ICS Summative - Minesweeper |
|
|
Don't wait. They can help a lot in the future and they'll impress people For me it was kindof like arrays, at first I didn't understand them or why they were useful. ONce things clicked into place, I started realizing how useful they really were and coming up with all these applications for them. I had the same epiphany when I learned how to use classes.
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
Nathan4102
|
Posted: Mon Jul 08, 2013 6:55 pm Post subject: RE:Grade 10 ICS Summative - Minesweeper |
|
|
I remember learning arrays, it made everything SOO much easier! I was supposed to be learning a language this summer, so I'll learn arrays when I get into a language.
|
|
|
|
|
|
Raknarg
|
Posted: Mon Jul 08, 2013 7:01 pm Post subject: RE:Grade 10 ICS Summative - Minesweeper |
|
|
http://processing.org/
Same feel as turing, power and syntax like java. More dynamic.
|
|
|
|
|
|
Nathan4102
|
Posted: Mon Jul 08, 2013 7:41 pm Post subject: RE:Grade 10 ICS Summative - Minesweeper |
|
|
I considered looking into that earlier, but I'm starting java in school next month anyways, so is it really worth learning this?
|
|
|
|
|
|
Raknarg
|
Posted: Mon Jul 08, 2013 8:21 pm Post subject: RE:Grade 10 ICS Summative - Minesweeper |
|
|
I would say so. First, it's not the same. It's a lot easier to deal with (I find), and plus getting an early start with a java like environment means less potential headaches in the future. Gives you more time to learn finer details instead of just the basics.
Before processing, I used Turing for most of my programs, when I wanted to test anything or do any small projects. Now, i can just use Processing, which is easier to use in a lot of ways and much, much more powerful.
|
|
|
|
|
|
BrookeTookie
|
Posted: Mon May 26, 2014 9:48 am Post subject: RE:Grade 10 ICS Summative - Minesweeper |
|
|
Why are the mines coloured purple and not grey like the rest? so the user cant tell which cell has a mine or not.
|
|
|
|
|
|
Nathan4102
|
Posted: Mon May 26, 2014 2:33 pm Post subject: RE:Grade 10 ICS Summative - Minesweeper |
|
|
Change constant "CHEAT" at the top to false. True is debug mode, and shows where the mines are located.
|
|
|
|
|
|
|
|