ID:139848
 
Code:
    Click()                            //overrides its Click() proc
if (usr.holding)
usr.holding.loc = loc //puts held stone on clicked stone's square
usr.moves++ //increases usr's move number
if (ColorChange(usr.holding)) //if ColorCheck() returns 1 to ColorChange()
usr << "You've won the game in [usr.moves] moves!"
CleanUp()
Reset()
else
MoveCheck() //if the game wasn't won, see if the game's been lost
usr.holding = null //makes it so usr is no longer "holding" anything
else
loc = null //takes the clicked stone off the board
usr.holding = src //but "remembers" it
proc
CleanUp()
for (var/obj/stone/O in world)
del(O)

ColorCheck(color) //takes a color as an argument
for (var/obj/stone/O in world) //loops through all stones
if (O.icon_state != color) return 0 //returns 0 if one is a different color

return 1 //returns 1 if the game is won

MoveCheck()
if (usr.moves == 7)
usr << "You've used up all you moves. Game over!"
CleanUp()
Reset()
else
usr << "You have [7-usr.moves] move\s remaining."
Reset()
if (usr.moves == 7 || ColorCheck())
var/obj/stone
stone.icon_state = rand("yellow","red")


Problem description:
Ok. I just recently started to learn programming, and this might be a really easy problem for some of you, but i still need help with it. What I'm trying to do is to get the pieces to reset with the Reset() proc. When I compiled it, no errors came up, but when i run it, it doesn't reset like it's supposed to. Is it because i put Reset() at the wrong place, or is the formula wrong?

help would REALLY be appreciated (spent hours trying to figure this out...)
Zila tutorial 2, did you not notice how the stones were place.
world                                                   //we set one of our world's characteristics:
turf = /turf/square //its default turf now square turf.
New() //overrides its New() proc
for(var/turf/square/T in world) //loops through all squares,
new /obj/stone(T) //putting a stone on each square.
..()//Parent proc, to give child inheritance.