Search found 675 matches

by Henko
Tue Sep 10, 2013 3:03 pm
Forum: BASIC programs
Topic: Celestial bodies simulation (Newton's gravitational law)
Replies: 6
Views: 6436
Flag: Netherlands

Re: Celestial bodies simulation (Newton's gravitational law)

Mr. Kibernetik wrote:Very interesting!

I suggest you to force device rotation to vertical, because otherwise buttons can be missing from view...
Indeed. I added "set orientation top" to the initprog subroutine

Very nice Basic now.
by Henko
Tue Sep 10, 2013 9:25 am
Forum: BASIC programs
Topic: Celestial bodies simulation (Newton's gravitational law)
Replies: 6
Views: 6436
Flag: Netherlands

Celestial bodies simulation (Newton's gravitational law)

' This program simulates the movement of a system of celestial bodies. ' The movements are governed by Newtons law: F = g x m1 x m2 / r2 ' All bodies attract each other following that law. ' The system may have a dominant object like the sun in our system. ' If you want to manipulate the proces othe...
by Henko
Fri Jul 12, 2013 10:11 am
Forum: BASIC programs
Topic: Conway's Game of Life
Replies: 10
Views: 13196
Flag: Netherlands

Re: Conway's Game of Life

Did I understand you correctly, that smart BASIC runs the same code 10 times faster than BASIC! ? It doesn't surprise me. I did a 9x9 matrix inversion (exclusively floating point arithmetic) using the inversion routine that i wrote for both basics (check the program sections). Using the timer: Basi...
by Henko
Fri Jun 21, 2013 9:22 am
Forum: BASIC programs
Topic: Maze generator (algorithm and program)
Replies: 0
Views: 4707
Flag: Netherlands

Maze generator (algorithm and program)

Maze algorithm The maze is generated in a rectangular field of cells, each cell being an element in a 2-dimensional array. Each cell has 2 to 4 neighbour cells separated by horizontal and vertical walls. Cells may be "visited" by the algorithm or not. At the end of the procedure all cells have been ...
by Henko
Wed Jun 19, 2013 1:49 pm
Forum: BASIC programs
Topic: Question
Replies: 2
Views: 4700
Flag: Netherlands

Question

option base 1 ! option angle degrees dim tok(40,10,2) ! tokens(tok) graphics ! draw color 0,0,0 loop1: ! count=3 ! graphics clear .8,.8,.8 loop: draw_text("hello all, is this forum still alive?","b",.53*count,count/40,20,20*count,10-count/2,tok) count=count+1 ! pause .3 if count=40 then ! pause 1 ! ...
by Henko
Sat Jun 08, 2013 11:58 am
Forum: BASIC programs
Topic: Can you read this? - another draw text (hopefully temporary)
Replies: 0
Views: 4701
Flag: Netherlands

Can you read this? - another draw text (hopefully temporary)

option base 1 ! option angle degrees ! randomize dim tok(40,10,2) tokens(tok) graphics ! graphics clear .8,.8,.8 ! fill color .8,.8,.8 graphics lock for angl=0 to 340 step 22 alph=.3+rnd(.7) ! c=rnd(100) ! siz=3+int(angl/20) if c<25 then ! col$="z" ! goto lab ! end if if c<50 then ! col$="r" ! goto ...
by Henko
Tue Jun 04, 2013 10:49 am
Forum: BASIC programs
Topic: Data encryption / decryption function
Replies: 0
Views: 5012
Flag: Netherlands

Data encryption / decryption function

option base 1 print crypt$("intext","this-key","outtext",1) pause 2 print ! print print crypt$("outtext","this-key","wastebin",-1) end ' This function will encrypt a text-file which must be present ' in the map where the program is started. ' Encryption is done with mode=1, the result is written to ...
by Henko
Sat Jun 01, 2013 8:16 am
Forum: BASIC programs
Topic: Long rubbish string for test purpose
Replies: 0
Views: 4875
Flag: Netherlands

Long rubbish string for test purpose

a$=gen_str$(2000) print a$ ! print ! print "count= ";len(a$) end ' function generates a long string for test purposes. ' the string looks like a piece of text, be it in a ' language which has not yet been deciphered. ' def gen_str$(length) ko=substr$("10",1,1) ' works for either OPTION BASE 0 or 1 r...
by Henko
Thu May 30, 2013 4:17 pm
Forum: BASIC programs
Topic: Lunar lander: a classic in a new dress
Replies: 8
Views: 9850
Flag: Netherlands

Re: Lunar lander: a classic in a new dress

Mr. Kibernetik wrote:I think that illuminator on a ship will be a cool upgrade. Also exhaust fire will add some interaction.
And time indicator will add some competition...
Anybody to add these thingies? Or one or two of them?
by Henko
Sun May 26, 2013 8:00 am
Forum: BASIC programs
Topic: Lunar lander: a classic in a new dress
Replies: 8
Views: 9850
Flag: Netherlands

Lunar lander: a classic in a new dress

option base 1 ! option angle degrees dim lander_x(15),lander_y(15),lx(15),ly(15) gosub init_prog fuel=select_level(bmin) create_gauges(fuel,height,velocity,gas) draw_poly(14,lx,ly,120,910-3*height/10,0,0,0,0,2) button "start" title "start" at 324,80 size 120,40 start: if button_pressed("start")=0 th...