![]() |
LG KS 360
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
With the kit MidletPASCAL 2.02, you can create JAVA applications without writting in JAVA. Just write your code in PASCAL and it outputs your JAR
and JAD files to be loaded into the phone for using your application.
To RUN your code you'll need the Phone emulator integrated into the WTK from SUN and downloadable here! |
![]() |
![]() The title's screen of my Master Mind |
Example with the Master Mind I wrote a little application, and here is the whole project to be downloaded:
Read the source code. |
![]() The game board. |
![]() |
At last, here is the starting screen of the CellularBASIC with my modifications!
A complete menu that allows you to edit, save, load and, of course, run programs! |
A view of the editor. On this cellular, the keyboard is really a great thing when programming!
One could regret that some symbols are hard to find (=, ", parenthesis). Else, you can prepare the source on the PC and copy it to the MicroSD card in the ZAM folder with *.ZAM extension as a text file. It will be loaded with no problem. The source editor included into the CellularBASIC has problems with the LG KS as it seems that the size of the edition can't exceed 512 bytes! I solved the problem writting my own editor with the MidletPascal (see below). |
![]() |
![]() |
An example of program: sub main CLS FOR I = 1 TO 50 X = INT(RND * width) Y = INT(RND * height) R = INT(RND * 50) if R < 17 then FILLON else FILLOFF end if color(rnd*256,rnd*256,rnd*256) CIRCLE (X, Y, R) NEXT I end sub |
The well known 8 queens problem Clic to get the source code. sub main t=timemilli q=0 : i=0 : sol=0 cls : print "Recherche..." while i<>-2 q=q+1 if q=9 then call dessin else r(q)=1 end if i=-1 while i=-1 if q<9 then s(q)=q+r(q) : d(q)=q-r(q) i=1 : p=q while i<p if r(i)=r(p) or s(i)=s(p) or d(i)=d(p) then i=-1 : p=-1 else |
![]() (screen says 311 sec with a previous version). |
i=i+1 end if wend else q=8 end if if i=-1 then p=1 while p=1 if r(q)<8 then p=0 else q=q-1 if q=0 then p=0 end if end if wend if q=0 then i=-2 else r(q)=r(q)+1 end if end if wend wend end sub |
sub dessin cls : sol=sol+1 x=(width-160)/2 : y=(height-160)/2 color(255,0,0) : filloff : box(x-1,y-1,162,162) color(200,200,200) : fillon : box(x,y,160,160) color(120,0,0) : c=0 for k=x to x+140 step 20 for j=y to y+140 step 20 if c=0 then box(k,j,20,20) end if c=1-c next j c=1-c next k color(0,0,255) : x=x-10 : y=y-10 for k=1 to 8 circle(x+k*20,y+r(k)*20,7) next k color(255,255,255) clt : print sol print int((timemilli-t)/100)/10 end sub |
![]() |
HELP! This BASIC don't have the INKEY$ instruction! I've been unable to add one in spite of my researches on the Canvas in Java. If someone could do it... |
To bypass the limitations of the CellularBASIC editor, I wrote mine with MidletPASCAL.
It is similar to TextEditor, a russian program that was really slow with all the confirmations needed to access the files:
The source code appears, you can navigate through it and, when you press EDIT, you enter into an edit box with the 6 current lines. This bloc can be deleted, modified, appended and when you press ACCEPT, it is inserted in the source. |
![]() |
![]() |
You can doanwload MPedit. The zip contains:
|