Go Back   xda-developers > Windows Mobile Development and Hacking > Development and Hacking General


Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 26th April 2009, 10:17 PM
stephj's Avatar
stephj stephj is offline
Senior Member
 
Join Date: May 2007
Location: Bolton
Posts: 156
Default 5x5 Updated...... V1.5 The Knights Gauntlet.......... Now with demo mode.

There is a game on the iPhone called Lights Out where the object of the game is to light up or knock out all the lights in a 5x5 grid. When a square is selected that square and its four immediate neighbours, above, below, and to each side invert. There is no wraparound. The object of the game is to get all the squares black.

At the risk of revealing my age, I saw a hand held version of this game in the early 1980's.

When mastering any new programming platform, this application becomes the standard with which I start. I know the logic, so the problem merely becomes getting the thing to run under the new platform. I wrote this in 2005 while fighting my way through the very steep learning curve of Embedded C++. Previous platforms for this program have been, ZX81, BBC Micro, DOS, Windows and finally Windows Mobile. Next stop Linux!

It is an example of minimalist programming on WM. Written in Embedded C++ as a Win32 application it is targetted at ARMv4 chipsets. As such it should run on all PPC versions from Windows Mobile 2002 onwards. The menu is limited to two main items, so WM 5/6 will display it as a WM 5/6 app. Minimalist programming means it can be distributed as as a single .EXE file of a mere 9.5 Kb in size. The DLLs it calls are already on your device, there is no need for a .CAB installation.


It has 5x5, 7x7 and 9x9 grids, all are solvable.

I hope you enjoy it. It will keep you quiet but it might drive you totally nuts!

UPDATE!!! Now works with 480x800/240x400 devices, see later posts for the details.

UPDATED!! Version 1.2 released.

Changes: 11x11 grid added. It is solvable, but it took me a while to figure it out!. You may need a stylus as fingers may be a bit too awkward. For that reason, I do not intend to go to 13x13 and beyond.

The short display glitch on initial program load now fixed.

Game and drawing code optimised. (There are often better and faster ways to do things, if you take the time to look.)

UPDATED!! Version 1.3 released.

Now also runs on both Pocket PC and SmartPhone devices. Now runs on any sized screen, even those that have not been released yet! The blank screens that were reported in later posts are now a thing of the past. Here's the method, take the width and height of of the client area and size the game to 90% of smaller of the two. Why did I not think of that in the first place?

SmartPhone users:- Welcome aboard! Image attached below: The white square is the target square. Move it to the square you want to change with the D-Pad/Arrow buttons, then press 'Enter' to change it. Smartphones prior to Mobile 6.0 may not have the 'File Explorer' application. (It depends on the OEM build). In this case, use ActiveSync. Connect to your phone and drop the unzipped 5x5.exe file via the 'Explore' option into the \Windows\Start Menu\Programs\Games\ directory, and it will appear alongside Solitaire and BubbleBreaker in the games menu of your device. Smartphone 2002/2003 users need to use \Storage\Windows\Start Menu\Programs\Games\

Pocket PC users won't see any change, just tap the square you want to change. The program looks at which platform it is running on, and behaves accordingly.

UPDATED!! Version 1.4 released. - The Knight's Gauntlet.

Just when you thought you've mastered it, the Knight's Gauntlet is firmly thrown down. Selecting Knights from the main 5x5 menu, changes the pattern of squares that are inverted to those a knight's move away in chess, (two forward, then one to the side), as per the Knights image below. Up to 9 squares will invert on each move. As per changing the grid size, toggling the knights game on and off will restart the game.

All four grid sizes are solvable, but you are warned, it is a lot harder than the normal cross game.

It was only a small change to the game logic, and this program was all ready to go in September, but I would not release it, until I had proved to myself that it could be done. A brute force attack can be used to break the 5x5 Knight's game but as the grid gets bigger the problem grows exponentially. A quad core processor running a console C++ application, using the SSE3 PC registers (XMM) macros to play one move on the entire board in one machine instruction, was not enough.

I had to use a special version of the mobile program that could dump the state of the board and moves out to a file to be analysed by the PC later by a suite of programs that could combine boards together by the thousands. All good fun!

On and off, it has taken me three months to find the knights solutions to the 7x7, 9x9 and 11x11 games.

UPDATED!! Version 1.5 released. Now with demo mode.

For those who think it is impossible, let the demo mode show you how to do it.... But there is a slight twist........ You will be shown the same solution for each puzzle each time, but the moves are shuffled and they may also be reflected or rotated, just to confuse matters further. Shuffling the moves, rotating, or reflecting, logically, has no effect on the final result.

Happy puzzling!
Attached Images
File Type: jpg Knights.JPG (30.6 KB, 43 views)
File Type: jpg Smart5x5.JPG (26.6 KB, 17 views)
File Type: jpg 5x5.JPG (29.8 KB, 6 views)
Attached Files
File Type: zip 5x5.zip (5.6 KB, 11 views)

Last edited by stephj; 28th January 2010 at 12:52 PM.. Reason: APP updated. Version 1.5 Memory access error fixed.
Reply With Quote
Sponsored Links

  #2  
Old 26th April 2009, 11:13 PM
marendo marendo is offline
Junior Member
 
Join Date: Nov 2007
Posts: 19
Default

Any screenshot?

Thanks!
Reply With Quote

  #3  
Old 26th April 2009, 11:25 PM
l3v5y's Avatar
l3v5y l3v5y is offline
Moderator
 
Join Date: Sep 2007
Location: Bristol
Posts: 7,149
Default

Nice little game.

Attached Images
File Type: gif 5x5.gif (9.9 KB, 4189 views)
__________________


My ROMs:
Diamond 28217/23529 + kitchen
Leo 28014 ROM - also, WMPowerUser HD2 ROM

My devices:
HTC Prophet - 23529 Light
HTC Diamond - 23529 Light
HTC Leo - getting repaired (for £155 )

Reply With Quote

  #4  
Old 13th May 2009, 11:03 PM
gil@spoontools.com's Avatar
gil@spoontools.com gil@spoontools.com is offline
Member
 
Join Date: Apr 2007
Posts: 54
Default Small problem

Hi,

I'm probably missing something here, but I get a white screen without anything I can actually do with it (using Omnia).

Any help?
__________________
The Mobile Spoon

Windows Mobile Tweaks | freeware | incomplete guides | and fun stuff

Reply With Quote

  #5  
Old 13th May 2009, 11:25 PM
deedee's Avatar
deedee deedee is offline
Senior Member
 
Join Date: May 2007
Location: Coleraine
Posts: 891
Default

Grief that is going to be addictive.

So simple yet so tricky at the same time.
__________________
Xperia X1
ROM - Stock O2

O2 - XDA II
ROM - Ather WM6.1 Professional

HTC P3600
ROM - TNYYNT 016BSN
Radio - 1.50.08.11
Reply With Quote

  #6  
Old 13th May 2009, 11:33 PM
ElVikin ElVikin is offline
Member
 
Join Date: Mar 2007
Location: Insjön (almost in the forrest)
Posts: 77
Default

works fine on a SQVGA (320x320) device to, and im after 1 minute angry ....
Reply With Quote

  #7  
Old 14th May 2009, 01:39 AM
tatnai's Avatar
tatnai tatnai is offline
Senior Member
 
Join Date: Jul 2008
Posts: 871
Default

very nice; solved 5x5 - 9 clicks. going to try to crack 7x7
__________________
][ HTC Vogue ][ Sprint SERO 500 ][ Android ][

ANDROID on VOGUE FAQs
check here for an answer to common questions before posting.
Reply With Quote

  #8  
Old 14th May 2009, 01:41 AM
galaxys's Avatar
galaxys galaxys is offline
Senior Member
 
Join Date: May 2007
Location: Las Vegas
Posts: 2,793
Default

this is lot's of fun & a little tricky!
__________________
HTC Nexus One<--HTC HD<--HTC Hermes<--Samsung A920<--Sanyo VM4500<--LG TP5250<--Motorola StarTac<--
Reply With Quote

  #9  
Old 14th May 2009, 01:59 AM
the0ne's Avatar
the0ne the0ne is offline
Senior Member
 
Join Date: Jan 2007
Location: Melbourne
Posts: 451
Default

nice game
__________________
Latest WM App Review :



---
Reply With Quote

  #10  
Old 14th May 2009, 10:17 AM
tonton_nono tonton_nono is offline
Junior Member
 
Join Date: May 2009
Posts: 1
Thumbs down

Does not work with my HTC Touch HD (WVGA 800x480)
I got a white screen.
Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:07 PM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.