Classic game "Lighs Out"
01-02-2014, 10:15 AM (This post was last modified: 01-02-2014 10:16 AM by ArielPalazzesi.)
Post: #5
 ArielPalazzesi Member Posts: 90 Joined: Dec 2013
RE: Classic game "Lighs Out"
Hello again

Well, the game is almost ready.

1) You can choose from three board sizes: 4x4, 5x5 and 6x6 lights.
2) You can choose the game mode: random or all the lights.
3) control the number of plays is carried efectudas.

Coming soon:

1) Store the highest score obtained (and player movements, for each type of board) (*)
2) Improve the graphics.
3) Sound ('s a joke, of course)
4) Screen presentation, support, and so on.

(*) Not sure that can be implemented, or at least I do not know how to store values ​​between matches.

Here's the code:

Code:
﻿EXPORT lightsout3() BEGIN local XX,YY,AA,M; local XX1, YY1,NIVEL,FINAL,SUMA, MOVI; local xmouse, ymouse, matriz; PRINT(); NIVEL := 5;  CHOOSE(M, "Board Size", "4x4", "5x5", "6x6"); IF M<>0 THEN   NIVEL := M+3; END; CHOOSE(M, "Game mode", "Random", "All On"); matriz := [[1,1,1,1,1,1],[1,1,1,1,1,1],[1,1,1,1,1,1],[1,1,1,1,1,1],[1,1,1,1,1,1],[1,1,1,1,1,1]]; IF M==1 THEN   FOR XX FROM 1 TO NIVEL DO     FOR YY FROM 1 TO NIVEL DO       IF RANDOM(1) > 0.5 THEN         matriz[XX,YY] := 1;        ELSE         matriz[XX,YY] := 0;        END;     END;   END; END; DIMGROB_P(G1,320,240); RECT(); DIMGROB_P(G2,1,18, {#D200F200F300F4:64,#AE00AF00AF00D0:64,#6800680068008C:64,#68006800680068:6​4,#680068:64}); XX := (160-16*NIVEL); YY := (160+16*NIVEL); FOR AA FROM XX TO YY DO   BLIT_P(G2,AA,22); END; DIMGROB_P(G2,64,18, {#F400F400F400F4:64,#F400F400F400F4:64,#F400F400F400F4:64,#F400F400F400F4:6​4,#F400F400F400F4:64,#F400F400F400F4:64,#F400F400F400F4:64,#F400F400F400F4:64,#F​400F400F400F4:64,#F400F400F400F4:64,#F400F400F400F4:64,#F400F400F400F4:64,#F400F​400F400F4:64,#F400F400F400F4:64,#F400F400F400F4:64,#F400F400F400F4:64,#F300F300F​300F3:64,#F300F300F300F3:64,#F300F300F300F3:64,#F300F300F300F3:64,#F300F300F300F​3:64,#F300F300F300F3:64,#F300F300F300F3:64,#F300F300F300F3:64,#F300F300F300F3:64​,#F300F300F300F3:64,#F300F300F300F3:64,#F300F300F300F3:64,#F300F300F300F3:64,#F3​00F300F300F3:64,#F300F300F300F3:64,#F300F300F300F3:64,#F300F200F200F3:64,#F200F2​00F300F2:64,#F300F200F200F3:64,#F200F200F300F2:64,#F300F200F200F3:64,#F200F200F3​00F2:64,#F300F200F200F3:64,#F200F200F300F2:64,#F300F200F200F3:64,#F200F200F300F2​:64,#F300F200F200F3:64,#F200F200F300F2:64,#F300F200F200F3:64,#F200F200F300F2:64,​#F300F200F200F3:64,#F200F200F300F2:64,#D200D200D100D2:64,#D200D100D200D2:64,#D20​0D200D100D2:64,#D200D100D200D2:64,#D200D200D100D2:64,#D200D100D200D2:64,#D200D20​0D100D2:64,#D200D100D200D2:64,#D200D200D100D2:64,#D200D100D200D2:64,#D200D200D10​0D2:64,#D200D100D200D2:64,#D200D200D100D2:64,#D200D100D200D2:64,#D200D200D100D2:​64,#D200D100D200D2:64,#D000D000D100D0:64,#2194113200D000D0:64,#D000D100D02194:64​,#D1197321941973:64,#D000D100D000D0:64,#2194219400D000D1:64,#D000D100D000D0:64,#​D1113200B000D1:64,#D000D100D000D0:64,#D100D000D000D1:64,#8F100D100D000D0:64,#D00​0D119734258:64,#D000D000D100D0:64,#D000D100D000D0:64,#D000D1113200D0:64,#D100D00​0D000D1:64,#AF00AF00AF00AF:64,#7FFF425800AF00AF:64,#CF00CF00CF7FFF:64,#CF633C7FF​F633C:64,#CF00CF00CF00CF:64,#7FFF7FFF00CF00B0:64,#AF00AF00AF00AF:64,#B042587FFF3​A37:64,#AF00B000AF00AF:64,#B000AF00AF00B0:64,#7FFF7BDE00AF00AF:64,#AF7FFF7FFF7FF​F:64,#AF00AF00AF00B0:64,#3A3700AF00AF00AF:64,#AF00B042587FFF:64,#B000AF00AF00B0:​64,#AF00AF00AF00AF:64,#7FFF425700AF00AF:64,#AF00AF00AF7FFF:64,#AF195221931952:64​,#195231F5425700AF:64,#7FFF7FFF00AF1131:64,#AF1993425708CE:64,#195252DA7FFF7FFF:​64,#42574257195200AF:64,#AF00AF00AF00AF:64,#7FFF7FFF31F500AF:64,#5AFB7FFF7FFF219​3:64,#AF2193219200AF:64,#7FFF113111312193:64,#AF195252DA7FFF:64,#AF00AF00AF00AF:​64,#AE00AE00AE00AE:64,#7FFF425700AE00AE:64,#AE00AE00AE7FFF:64,#8E633B7FFF633B:64​,#7FFF7FFF7FFF7FFF:64,#7FFF7FFF00AE4257:64,#19317FFF7FFF7FFF:64,#633B7FFF7FFF7FF​F:64,#7FFF7FFF7FFF633B:64,#AE00AE00AE2193:64,#7FFF7FFF7BDE00AE:64,#7FFF7FFF739E0​0AE:64,#AE7FFF7FFF00AE:64,#7FFF425742577FFF:64,#AE633C7FFF7FFF:64,#AE00AE00AE00A​E:64,#8C008C008C008C:64,#7FFF4257008C008C:64,#8D008D008D7FFF:64,#2171633B7FFF633​B:64,#7FFF008C7FFF7FFF:64,#7FFF7FFF008C4257:64,#42577FFF7FFF08CE:64,#8C42577FFF7​FFF:64,#42577BDE7FFF7BDF:64,#8D008D008D006D:64,#7FFF7FFF7FFF008D:64,#7FFF7FFF633​B008C:64,#8D7FFF7FFF008C:64,#7FFF008C42577FFF:64,#8C008C42577FFF:64,#8C008C008C0​08C:64,#69006800680069:64,#7FFF423400690068:64,#47006900687FFF:64,#214E631A7FFF6​31A:64,#7FFF00477FFF7FFF:64,#7FFF7FFF00684234:64,#42347FFF7FFF0069:64,#6842347FF​F7FFF:64,#7FFF7FFF739D0068:64,#680068006856D9:64,#7BDF7FFF631A0068:64,#7FFF7FFF7​FFF0047:64,#687FFF7FFF0068:64,#7FFF006842347FFF:64,#68006842347FFF:64,#680069006​80068:64,#69006800680069:64,#7FFF423400690068:64,#7FFF7FFF7FFF7FFF:64,#68631A7FF​F631A:64,#7FFF7FFF7FFF7FFF:64,#7FFF7FFF00684234:64,#42347FFF7FFF0068:64,#35D26B5​C7FFF7FFF:64,#56D942347FFF7FFF:64,#68006900697BDF:64,#7FFF7FFF00690068:64,#190D7​FFF7FFF7FFF:64,#739D7FFF7FFF0069:64,#7FFF006942347FFF:64,#6835D26B5C7FFF:64,#690​06800680069:64,#69006800680069:64,#7FFF423400690068:64,#7FFF7FFF7FFF7FFF:64,#696​31A7FFF631A:64,#7FFF52B7631A08AA:64,#7FFF7FFF00694234:64,#42347FFF7FFF0069:64,#6​31A7FFF7FFF2990:64,#7FFF7FFF7FFF190D:64,#69006800680068:64,#7FFF10CB00680068:64,​#68214E7FFF7FFF:64,#7FFF7FFF6B5C0068:64,#2990006942347FFF:64,#68631A7FFF7FFF:64,​#69006800680069:64,#69006800680069:64,#68006800690068:64,#69006800680069:64,#680​06800690068:64,#7FFF7FFF7FFF631A:64,#69006900680069:64,#69006800680069:64,#69006​800690068:64,#68006900680068:64,#69006800680069:64,#68006900680068:64,#680069006​90068:64,#68006800690068:64,#68006900690069:64,#68006900680069:64,#6900680068006​9:64,#69006800680069:64,#68006800690068:64,#69006800680069:64,#68006800690068:64​,#68006900680069:64,#69006900680069:64,#69006800680068:64,#69006800690068:64,#68​006900680068:64,#69006800680069:64,#68006900680068:64,#68006900690069:64,#680068​00690068:64,#68006800680069:64,#68006800680068:64,#69006800680069:64,#6900680068​0069:64,#68006800690068:64,#69006800680069:64,#68006800690068:64,#68006800680069​:64,#68006800680069:64,#68006800680068:64,#68006800680068:64,#68006900680068:64,​#69006800680069:64,#68006900680068:64,#68006800690069:64,#69006900680069:64,#690​06800680068:64,#68006900690068:64,#69006800680069:64,#69006800680069:64,#6800680​0690068:64,#69006800680069:64,#68006800690068:64,#68006800680069:64,#69006800680​069:64,#68006800680069:64,#69006900680069:64,#68006900680068:64,#69006800680069:​64,#68006900680068:64,#69006900680068:64,#69006800680068:64,#68006900680068:64,#​68006900680069:64,#69006800680069:64,#69006800680069:64,#68006800690068:64,#6900​6800680069:64,#68006800690068:64,#68006800680069:64,#69006800680068:64,#68006800​680069:64,#68006900680069:64,#68006900680068:64,#69006800680069:64,#680069006800​68:64,#68006800680068:64,#68006800680068:64,#68006800690068:64,#68006900690068:6​4,#69006800680069:64,#69006800680069:64,#68006800690068:64,#69006800680069:64,#6​8006800690068:64,#68006800680069:64,#69006900680068:64,#68006800680069:64,#69006​800680069:64,#68006900680068:64,#69006800680069:64,#68006900680068:64,#680069006​80068:64,#68006900680068:64,#68006800680069:64,#68006800690068:64,#6900680068006​9:64}); BLIT_P(G2,128,22); DIMGROB_P(G2,32,32, {#B02020001400B02:64,#3F2F3F2F3F2F3F2F:64,#3F2F3F2F3F2F3F2F:64,#3F2F3F2F3F2​F3F2F:64,#3F2F3F2F3F2F3F2F:64,#3F2F3F2F3F2F3F2F:64,#3F2F3F2F3F2F3F2F:64,#7A10EC3​3B0E3F2F:64,#332C0240014002A0:64,#43303F2F3F2F4330:64,#3F2F43303F2F3F2F:64,#4330​3F2F3F2F4330:64,#3F2F43303F2F3F2F:64,#43303F2F3F2F4330:64,#3F2F43303F2F3F2F:64,#​178506613AEE3F2F:64,#47B1034001600701:64,#47B147B147B147B1:64,#47B147B147B147B1:​64,#47B147B147B147B1:64,#47B147B147B147B1:64,#47B147B147B147B1:64,#47B147B147B14​7B1:64,#238816A53F2F4791:64,#4BD20FA301E00B22:64,#4BF24BF24BF24BF2:64,#4BF24BF24​BF24BF2:64,#4BF24BF24BF24BF2:64,#4BF24BF24BF24BF2:64,#4BF24BF24BF24BF2:64,#4BF24​BF24BF24BF2:64,#2BAA32CC43704BD2:64,#4FF30FA302000B22:64,#4FF34FF34FF34FF3:64,#4​FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:6​4,#4FF34FF34FF34FF3:64,#2BAA36ED47914BF2:64,#4FF30FC302000B22:64,#4FF34FF34FF34F​F3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34F​F34FF3:64,#4FF34FF34FF34FF3:64,#2BAA36ED47914FF3:64,#4BF20FA302000B22:64,#4FF34F​F34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4F​F34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#2BAA32EC47914BF2:64,#4FD313A402000B22:64​,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF​3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#2BAA36ED47914FF3:64,#4BF207A1022​00B22:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF​34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#2BAA36ED47914FF3:64,#47F​107A102200B22:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,​#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#2BAA36ED47914BF2​:64,#47F103A002000B22:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF3​4FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#2BAA3AEE​47914FF3:64,#47F103A002000B22:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF3​4FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#​2BAA3AEE47914BF2:64,#47F103A002000B22:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:​64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34​FF3:64,#2BAA3AEE47914FF3:64,#43F0038001E00B22:64,#4FF34FF34FF34FF3:64,#4FF34FF34​FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34​FF34FF34FF3:64,#2BAA3AEE47914BF2:64,#3BEE038001C00B22:64,#4FF34FF34FF34FF3:64,#4​FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:6​4,#4FF34FF34FF34FF3:64,#2F8B3AEE47914FF3:64,#3BEE036001C00B22:64,#4FF34FF34FF34F​F3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34F​F34FF3:64,#4FF34FF34FF34FF3:64,#2F8B3AEE47914BF2:64,#2FEB034001C00B22:64,#4FF34F​F34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4F​F34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#2F8B3AEE47914BF2:64,#2BEA032001C00B22:64​,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF​3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#2F8B3AEE47914FF3:64,#23E8032001A​00B22:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF​34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#2F8B3AEE47914BF2:64,#1BE​6032001800B22:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,​#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#2F8B36ED47914FD3​:64,#1BE602E001800B02:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF3​4FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#2F8B36ED​47914BF2:64,#17E502E001800B02:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF3​4FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#​2F8B36ED47914FF3:64,#17E502C001800B02:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:​64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34​FF3:64,#2F8B32EC47914BF2:64,#BE202A001800B02:64,#4FF34FF34FF34FF3:64,#4FF34FF34F​F34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34FF34FF34FF3:64,#4FF34F​F34FF34FF3:64,#2F8B32EC47914FF3:64,#3C0026001600B02:64,#4FF34FF34FF34FF3:64,#4BF​24FF34FF34FF3:64,#43F043F043F043F0:64,#4BF247F143F043F0:64,#4FF34FF34FF34FF3:64,​#4FF34FF34FF34FF3:64,#27A932CC47914FF3:64,#360024001600721:64,#4FF34FF34FF34FF3:​64,#27E937ED43F04FF3:64,#13E413E413E413E4:64,#27E91BE61BE613E4:64,#4FF34FF34FF34​3F0:64,#4FF34FF34FF34FF3:64,#FC312E447914BF2:64,#280028001800320:64,#3C007E10BE2​13E4:64,#3400340038003C0:64,#2E002E002E00320:64,#3400320032002E0:64,#7E103C003C0​0380:64,#4BF247F12FEB1BE6:64,#34002203FAF4BF2:64,#2A00280020002A0:64,#28002A002A​002A0:64,#280026002600280:64,#280028002800280:64,#280028002800280:64,#2A00280028​00260:64,#3A00340030002C0:64,#2800200030013C4:64,#2A0024002A001C0:64,#2A002A002A​00280:64,#2C002C002C002C0:64,#2C002C002C002C0:64,#2C002C002C002C0:64,#2A002A002C​002C0:64,#280026002600280:64,#24001C002000280:64,#1A002000B020220:64,#1E001E001E​001E0:64,#1E001E001E001E0:64,#1E001E001E001E0:64,#1E001E001E001E0:64,#1E001E001E​001E0:64,#2400200020001E0:64,#200026001600200:64,#220016001C001E0:64,#2000220024​00280:64,#1A001C001C001C0:64,#1800180018001A0:64,#1A001A001A00180:64,#220020001E​001C0:64,#340030002800240:64,#F83014002200300:64,#1C001A0016001A0:64,#1C001C001C​001E0:64,#1C001C001C001C0:64,#1C001C001C001C0:64,#1C001C001C001C0:64,#1C001C001C​001C0:64,#1E001E001E001C0:64,#2200160018001E0:64}); DIMGROB_P(G3,32,32, {#8C00680025008C:64,#F300F400F300F3:64,#F300F300F400F3:64,#F300F400F300F3:6​4,#F300F300F400F3:64,#F300F400F300F3:64,#F300F300F400F3:64,#AF008D00F200F3:64,#D​100680025006A:64,#F400F500F400F4:64,#F400F400F500F4:64,#F400F500F400F4:64,#F400F​400F500F4:64,#F400F500F400F4:64,#F400F400F500F4:64,#D1008B00D200F3:64,#117008C00​25008C:64,#118011801180118:64,#118011801180118:64,#118011801180118:64,#118011801​180118:64,#118011801180118:64,#118011801180118:64,#F200AF00F50117:64,#13900AF004​700AD:64,#139013901390139:64,#139013901390139:64,#139013901390139:64,#1390139013​90139:64,#139013901390139:64,#139013901390139:64,#F300D201160138:64,#13800AF0047​00AD:64,#139013901390138:64,#139013901390139:64,#139013901390139:64,#13901390139​0139:64,#139013901390139:64,#139013901390139:64,#F400F201160138:64,#13900B000470​0AD:64,#139013901390139:64,#139013901390139:64,#139013901390139:64,#139013901390​139:64,#139013901390139:64,#139013901390139:64,#F300F301160118:64,#13900D1004700​AD:64,#139013901390139:64,#139013901390139:64,#139013901390139:64,#1390139013901​39:64,#139013901390139:64,#139013901390139:64,#F400F201160138:64,#13900D0006800A​D:64,#139013901390139:64,#139013901390139:64,#139013901390139:64,#13901390139013​9:64,#139013901390139:64,#139013901390139:64,#F400F201160138:64,#13800D0006800AD​:64,#138013801380138:64,#139013901390139:64,#139013901390139:64,#139013901390139​:64,#139013901390139:64,#139013901390139:64,#F400F201160118:64,#13900D1006800AD:​64,#139013901390139:64,#139013901390139:64,#139013901390139:64,#139013901390139:​64,#139013901390139:64,#139013901390139:64,#F400F301160118:64,#11700AF006800AD:6​4,#138013801380138:64,#139013801380138:64,#139013901390139:64,#139013901390139:6​4,#139013901390139:64,#139013901390139:64,#F500F301160138:64,#11700AF006800AD:64​,#138013801380138:64,#138013801380138:64,#139013901390138:64,#139013901390139:64​,#139013901390139:64,#139013901390139:64,#F400F301160138:64,#11800AE006800AD:64,​#139013901390139:64,#139013901390139:64,#139013901390139:64,#139013901390139:64,​#139013901390139:64,#139013901390139:64,#F500F301160138:64,#11700AE006800AD:64,#​138013801380138:64,#138013801380138:64,#138013801380138:64,#139013901390139:64,#​139013901390139:64,#139013901390139:64,#F400F301160138:64,#13800AE006800AD:64,#1​39013901390139:64,#139013901390139:64,#139013901390139:64,#139013901390139:64,#1​39013901390139:64,#139013901390139:64,#F400F201160118:64,#13700AE006800AD:64,#13​8013801380138:64,#138013801380138:64,#138013801380138:64,#139013801380138:64,#13​9013901390139:64,#139013901390139:64,#F400F301160118:64,#11700AE004700AD:64,#139​013901390139:64,#139013901390139:64,#139013901390139:64,#139013901390139:64,#139​013901390139:64,#139013901390139:64,#F400D201160138:64,#11600AE004700AD:64,#1390​13901390139:64,#139013901390139:64,#139013901390139:64,#139013901390139:64,#1390​13901390139:64,#139013901390139:64,#F400D201160118:64,#11500AD004700AD:64,#13901​3901390139:64,#139013901390139:64,#139013901390139:64,#139013901390139:64,#13901​3901390139:64,#139013901390139:64,#F400D201160118:64,#F4008C004700AD:64,#1390139​01390139:64,#139013901390139:64,#139013901390139:64,#139013901390139:64,#1390139​01390139:64,#139013901390139:64,#F400D201160118:64,#F3008C004700AD:64,#138013801​380138:64,#138013801380138:64,#138013801380138:64,#138013801380138:64,#138013801​380138:64,#138013801380138:64,#F300D201150117:64,#F3008C004700AD:64,#13901390139​0139:64,#139013901390139:64,#139013901390139:64,#139013901390139:64,#13901390139​0139:64,#139013901390139:64,#F400D101160138:64,#F3008C004600AD:64,#1390139013901​39:64,#139013901390139:64,#139013901390139:64,#139013901390139:64,#1390139013901​39:64,#139013901390139:64,#F300D101160138:64,#D2008B004600AD:64,#139013901390139​:64,#139013901390139:64,#139013901390139:64,#139013901390139:64,#139013901390139​:64,#139013901390139:64,#F400D001160138:64,#D1008A004600AD:64,#138013801380138:6​4,#138013801380138:64,#115011501150117:64,#117011701150115:64,#138013801380138:6​4,#138013801380138:64,#F300B001150137:64,#AE0069004600AD:64,#139013901390139:64,​#F5011601180139:64,#D000D100D100D1:64,#D100D100D100D0:64,#138013701160114:64,#13​8013801380138:64,#D0008B01150117:64,#8A00690046008C:64,#B000D100F200F3:64,#AD00A​D00AE00AF:64,#8C008C008C008C:64,#8C008C008C008D:64,#AF00AE00AE00AD:64,#138011600​D100B0:64,#AD006800F20138:64,#6A006A0047008B:64,#8A008B008B008B:64,#8A0069006900​8A:64,#8B008A008A008A:64,#8A008A008A008A:64,#8A00690069008A:64,#8C008C008C008A:6​4,#690068006A00AE:64,#8B008A00690046:64,#8B008A008A008A:64,#8B008B008B008B:64,#8​B008B008B008B:64,#8B008B008B008B:64,#8B008B008B008B:64,#69008A008A008B:64,#69004​700690069:64,#46004700AD0068:64,#47004700470047:64,#47004700470047:64,#470047004​70047:64,#47004700470047:64,#47004700470047:64,#68006800470047:64,#4700690046004​7:64,#69004600470047:64,#4700690069006A:64,#47004700470047:64,#46004600460046:64​,#46004600460046:64,#47004700470047:64,#6A006A00690047:64,#AF00250047008B:64,#47​004700460046:64,#47004700470047:64,#47004700470047:64,#46004700470047:64,#460046​00460046:64,#47004700460046:64,#47004700470047:64,#68004600460047:64}); FOR XX FROM 1 TO NIVEL DO   FOR YY FROM 1 TO NIVEL DO      IF matriz[XX,YY]==1 THEN       BLIT_P(G2,(XX-1)*32+(160-16*NIVEL),(YY-1)*32+40);     ELSE       BLIT_P(G3,(XX-1)*32+(160-16*NIVEL),(YY-1)*32+40);     END;   END; END; TEXTOUT_P("MOVES: ",0,0); FINAL := 0; MOVI := 0; WHILE FINAL == 0 DO   L0 := WAIT(-1);   IF SIZE(L0)>1 THEN     IF L0(1) == #3d THEN.       xmouse := L0(2);       ymouse := L0(3);            IF xmouse>(160-16*NIVEL) AND xmouse<(160+16*NIVEL) AND ymouse>40 AND ymouse<(40+NIVEL*32) THEN         XX1 := IP((xmouse - (160-16*NIVEL)) /32);         YY1 := IP((ymouse - 40) /32);         MOVI := MOVI + 1;           RECT_P(G0,0,0,120,20);         TEXTOUT_P("MOVES: ",0,0);         TEXTOUT_P(MOVI,80,0);         IF matriz[YY1+1,XX1+1]==1 THEN           BLIT_P(G3,XX1*32+(160-16*NIVEL),YY1*32+40);           matriz[YY1+1,XX1+1] := 0;          ELSE           BLIT_P(G2,XX1*32+(160-16*NIVEL),YY1*32+40);           matriz[YY1+1,XX1+1] := 1;          END;         IF XX1>0 THEN           XX1 := XX1 - 1;           IF matriz[YY1+1,XX1+1]==1 THEN             BLIT_P(G3,XX1*32+(160-16*NIVEL),YY1*32+40);             matriz[YY1+1,XX1+1] := 0;            ELSE             BLIT_P(G2,XX1*32+(160-16*NIVEL),YY1*32+40);             matriz[YY1+1,XX1+1] := 1;            END;           XX1 := XX1 + 1;         ELSE           XX1 := NIVEL-1;           IF matriz[YY1+1,XX1+1]==1 THEN             BLIT_P(G3,XX1*32+(160-16*NIVEL),YY1*32+40);             matriz[YY1+1,XX1+1] := 0;            ELSE             BLIT_P(G2,XX1*32+(160-16*NIVEL),YY1*32+40);             matriz[YY1+1,XX1+1] := 1;            END;           XX1 := 0;         END;         IF XX1<(NIVEL-1) THEN           XX1 := XX1 + 1;           IF matriz[YY1+1,XX1+1]==1 THEN             BLIT_P(G3,XX1*32+(160-16*NIVEL),YY1*32+40);             matriz[YY1+1,XX1+1] := 0;            ELSE             BLIT_P(G2,XX1*32+(160-16*NIVEL),YY1*32+40);             matriz[YY1+1,XX1+1] := 1;            END;           XX1 := XX1 - 1;         ELSE           XX1 := 0;           IF matriz[YY1+1,XX1+1]==1 THEN             BLIT_P(G3,XX1*32+(160-16*NIVEL),YY1*32+40);             matriz[YY1+1,XX1+1] := 0;            ELSE             BLIT_P(G2,XX1*32+(160-16*NIVEL),YY1*32+40);             matriz[YY1+1,XX1+1] := 1;            END;           XX1 := NIVEL-1;         END;         IF YY1<(NIVEL-1) THEN           YY1 := YY1 + 1;           IF matriz[YY1+1,XX1+1]==1 THEN             BLIT_P(G3,XX1*32+(160-16*NIVEL),YY1*32+40);             matriz[YY1+1,XX1+1] := 0;            ELSE             BLIT_P(G2,XX1*32+(160-16*NIVEL),YY1*32+40);             matriz[YY1+1,XX1+1] := 1;            END;           YY1 := YY1 - 1;         ELSE           YY1 := 0;           IF matriz[YY1+1,XX1+1]==1 THEN             BLIT_P(G3,XX1*32+(160-16*NIVEL),YY1*32+40);             matriz[YY1+1,XX1+1] := 0;            ELSE             BLIT_P(G2,XX1*32+(160-16*NIVEL),YY1*32+40);             matriz[YY1+1,XX1+1] := 1;            END;           YY1 := NIVEL-1;         END;         IF YY1>0 THEN           YY1 := YY1 - 1;           IF matriz[YY1+1,XX1+1]==1 THEN             BLIT_P(G3,XX1*32+(160-16*NIVEL),YY1*32+40);             matriz[YY1+1,XX1+1] := 0;            ELSE             BLIT_P(G2,XX1*32+(160-16*NIVEL),YY1*32+40);             matriz[YY1+1,XX1+1] := 1;            END;           YY1 := YY1 + 1;         ELSE           YY1 := NIVEL-1;           IF matriz[YY1+1,XX1+1]==1 THEN             BLIT_P(G3,XX1*32+(160-16*NIVEL),YY1*32+40);             matriz[YY1+1,XX1+1] := 0;            ELSE             BLIT_P(G2,XX1*32+(160-16*NIVEL),YY1*32+40);             matriz[YY1+1,XX1+1] := 1;            END;           YY1 := 0;         END;       END;     END;   END;   SUMA := 0;   FOR XX FROM 1 TO NIVEL DO     FOR YY FROM 1 TO NIVEL DO       SUMA := SUMA + matriz[XX,YY];     END;   END;      IF SUMA == 0 THEN      MSGBOX("Solved in "+MOVI+" moves!");     FINAL := 1;   END;  END; END;

And some screencaps:

Note: : the screenshots are in Spanish, but since most of the forum users have English as their first language, the source code is translated texts that language
 « Next Oldest | Next Newest »

 Messages In This Thread Classic game "Lighs Out" - ArielPalazzesi - 01-01-2014, 10:47 PM RE: Classic game "Lighs Out" - tgallo - 01-02-2014, 05:25 AM RE: Classic game "Lighs Out" - ArielPalazzesi - 01-02-2014, 08:17 AM RE: Classic game "Lighs Out" - tgallo - 01-02-2014, 12:16 PM RE: Classic game "Lighs Out" - Han - 01-02-2014, 06:13 AM RE: Classic game "Lighs Out" - Kevin Ouellet - 01-03-2014, 03:55 PM RE: Classic game "Lighs Out" - ArielPalazzesi - 01-02-2014 10:15 AM RE: Classic game "Lighs Out" - Han - 01-02-2014, 04:59 PM RE: Classic game "Lighs Out" - ArielPalazzesi - 01-02-2014, 06:10 PM RE: Classic game "Lighs Out" - ArielPalazzesi - 01-03-2014, 04:32 PM RE: Classic game "Lighs Out" - ArielPalazzesi - 01-03-2014, 04:59 PM RE: Classic game "Lighs Out" - tgallo - 01-03-2014, 06:23 PM RE: Classic game "Lighs Out" - Han - 01-03-2014, 06:03 PM RE: Classic game "Lighs Out" - eried - 01-03-2014, 07:31 PM RE: Classic game "Lighs Out" - ArielPalazzesi - 01-03-2014, 07:40 PM RE: Classic game "Lighs Out" - eried - 01-03-2014, 08:03 PM RE: Classic game "Lighs Out" - Mic - 01-04-2014, 02:54 PM

User(s) browsing this thread: 1 Guest(s)