Sudoku4ppc

HomeWorx

Member
Licensed User
Longtime User
Hi !
Here's my very first app for the PocketPC using the amazing Basic4ppc.
Not original but, well, I really love sudoku, so I wanted to do it :)
The biggest issue is display speed... I haven't spent much time on optimization, only disabled the form before it displays pictures. But it's still slow...

Other things to do :
- add a timer
- add a settings file to save an unfinished game and load it on app start
- add a Check option so that a wrong digit would turn red

That's all for now. Tell me what you think !
Congrats to the dev team, Basic4ppc is just the greatest tool ever made.
All the best for the New Year !
 
Last edited:

HomeWorx

Member
Licensed User
Longtime User
Updated ! Please use the same link to download...
Fixed :
- improved display speed (I was using way too many ImageButtons - displaying them caused huge slowdown)
- added a timer
- selected cell and selected digit are now surrounded with a square so they are more visible
- you can now click and hold on a cell to select a digit (in the initial version you had to click on the cell first, then on the selection panel)

Enjoy !
 

Attachments

  • Sudoku4ppc_screenshot.jpg
    Sudoku4ppc_screenshot.jpg
    57.2 KB · Views: 204
Last edited:

klaus

Expert
Licensed User
Longtime User
I just downloaded your program, it seems that it is written for a VGA screen because I get only the upper left quarter of the image.

Wouldn't you also share the source code ?

It would be interesting to have a check for wrong number entries.

Best regards.
 

HomeWorx

Member
Licensed User
Longtime User
Thanks for your comments.
I'm not familiar with that screen resolution stuff so I hadn't thought about compatibility. I tried N1c0_ds' method. Not sure if it works correctly though since I don't have a QVGA device. Would you mind telling me if it's OK on your device ?
BTW, the program now checks wrong numbers.
 

Attachments

  • Sudoku4ppc.zip
    89.4 KB · Views: 250

klaus

Expert
Licensed User
Longtime User
Sorry, but it doesn't work on the device nor on the desktop.

I tried to put an existing number in the grid, the program accepts it, this is a part of what I meant with checking wrong numbers.

Attached 2 images of what I get, left on desktop and right on the device.

If you posted the source code we could look at it and probably give you some advice.
 

Attachments

  • SodukoDesk.jpg
    SodukoDesk.jpg
    14 KB · Views: 174
  • SodukoDev.JPG
    SodukoDev.JPG
    12.1 KB · Views: 174

HomeWorx

Member
Licensed User
Longtime User
OK, I won't be porting it to QVGA for now. Wasted like 2 hours readjusting and all, and I'm just fed up. There should be an auto-resize in the designer, or a ResizeQVGA function, something like that.
 

digitaldon37

Active Member
Licensed User
Longtime User
OK, I won't be porting it to QVGA for now. Wasted like 2 hours readjusting and all, and I'm just fed up. There should be an auto-resize in the designer, or a ResizeQVGA function, something like that.

I like the routine that Filippo wrote (as suggested by Klaus) over having to resize in the IDE and compile different versions for different devices.

I wrote a little album art program and with Filippo's code was able to make it compatible for both QVGA and VGA. When the application starts, I do a call to get the VGA mode (see "VGA_Mode" below) and if the return value is "VGA" I do a call to reset the display (see "SetVGA" below)

Of course this works if the form and controls are first created to QVGA display size.

I don't see why it wouldn't be possible to take his routine and rename it "SetQVGA" and change the value "2" to ".5" to create a function to reset the controls to QVGA. I don't have a VGA device so I can test this out.

B4X:
Sub VGA_Mode
   If form1.Height > 240 AND form1.Height < 480 Then
      Return "QVGA"
   Else If form1.Height > 480 Then
      Return "VGA"
   End If


End Sub

Sub SetVGA
   'Handles resolutions of 480 * 640
  Controls() = GetControls("")

  For i = 0 To ArrayLen(Controls()) - 1
    Crttype=ControlType(Controls(i))
    If Crttype = "CheckBox" OR Crttype = "TextBox" OR Crttype = "Label" OR Crttype = "Button" OR Crttype = "Panel" OR Crttype = "Image" OR Crttype = "ComboBox" OR Crttype = "ImageButton" OR Crttype = "RadioBtn" Then
      Control(Controls(i)).Left = 2 * Control(Controls(i)).Left
      Control(Controls(i)).Top = 2 * Control(Controls(i)).Top
      Control(Controls(i)).Height = 2 * Control(Controls(i)).Height
      Control(Controls(i)).Width = 2 * Control(Controls(i)).Width
      If Not(cPPC) Then
        Control(Controls(i)).FontSize = 2 * Control(Controls(i)).FontSize
        'There is no need to change the font size on the VGA device.
      End If
    End If
  Next

End Sub
 
Last edited:
Top