08/05/2009, 10:07 AM
|
#26 (permalink) |
|
Homebrew Developer
![]() Join Date: Dec 2007
Location: D.C. Area
Posts: 195
Likes Received: 0
Thanks: 73
Thanked 39 Times in 20 Posts
|
OP updated! Inclusion in the App Gallery (and bad timing) were the reason for the missing ipk. Sorry for any inconveniences, now go enjoy!
It's back!! The ipk may now be found in the App Gallery! http://www.precentral.net/homebrew-apps/lights-out Please continue to post issues/suggestions in this thread. Thanks for all the support! |
08/10/2009, 09:34 PM
|
#33 (permalink) |
|
Homebrew Developer
![]() Join Date: Dec 2007
Location: D.C. Area
Posts: 195
Likes Received: 0
Thanks: 73
Thanked 39 Times in 20 Posts
|
New Version! OP updated.
Lights Out v0.4.0 (8/10)
|
08/11/2009, 09:18 AM
|
#34 (permalink) |
|
Member
![]() Join Date: Jun 2009
Posts: 5
Likes Received: 0
Thanks: 0
Thanked 0 Times in 0 Posts
|
If you hit the upper left context menu with a game in progress it clears the board. This is very frustrating. I think the absolute best would be for it to save your state after every button press (a la the sudoku ap in the catalog) so you can quit and come back whenever you want.
|
08/11/2009, 10:43 AM
|
#35 (permalink) | |
|
Homebrew Developer
![]() Join Date: Dec 2007
Location: D.C. Area
Posts: 195
Likes Received: 0
Thanks: 73
Thanked 39 Times in 20 Posts
|
Quote:
What does everyone think of the random mode and other changes? |
|
12/03/2009, 09:20 AM
|
#38 (permalink) |
|
Member
![]() Join Date: Dec 2009
Posts: 3
Likes Received: 0
Thanks: 0
Thanked 3 Times in 3 Posts
|
Improve random game mode (fix solvable check and fix pattern)
Code:
GameboardAssistant.prototype.isSolvable = function(){
var solvmasks = [0, 7, 10, 13, 17, 22, 27, 28];
var row = [0, 0, 0, 0, 0];
/* build bitmasks for rows */
for (var i = 0; i < 5; i++) {
for (var j = 0; j < 5; j++) {
if (this.elementArray[5*i+j]) {
row[i] = row[i] | (1 << j);
}
}
}
/* move all lights down to last row */
for (var i = 1; i < 5; i++) {
var t = row[i-1];
/* press "t" in row i */
row[i-1] = 0; /* 0 == t ^ t: trigger lights in i-1 */
if (i < 4) row[i+1] = row[i+1] ^ t; /* trigger lights in i+1 */
t = (t ^ (t >> 1) ^ (t << 1)) & 0x1f; /* trigger lights in i */
row[i] = row[i] ^ t;
}
/* check for solvable bit masks */
if (solvmasks.indexOf(row[4]) != -1) return;
/* fix pattern */
var switchlights = solvmasks[Math.floor(Math.random() * 8)] ^ row[4];
for (var i = 0; i < 5; i++, switchlights = switchlights >> 1) {
if (switchlights & 1) {
var light = 20+i;
var idx = this.randomArray.indexOf(light);
if (idx == -1) {
this.elementOn(light);
this.randomArray.push(light);
} else {
this.elementOff(light);
this.randomArray.splice(idx, 1);
}
}
}
}
|
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|



