code:
photon_count = 0 do while photon_count < 10 photon_count = photon_count + 1 dimension photon_array[photon_count] photon_array[photon_count] = createobject("photon", photon_count) * go a while before creating another photon for iii = 1 to 4.2 * 10^5 for jjj = 1 to photon_count photon = photon_array[jjj] photon.move() endfor endfor ?.t. enddo create cursor photons (n i, x n(20,5), c n(10,6)) for jjj = 1 to photon_count photon = photon_array[jjj] insert into photons (n, x, c) values (photon.n, photon.x, photon.c) endfor browse copy to decelerated type csv define class photon as custom x = 0 && position in light years c = 1 && speed in light years per year i = 0 && iterations n = 0 && identification function move this.i = this.i + 1 this.x = this.x + this.c * We've been traveling for 1 million light years, slow down if this.i = 10^6 this.i = 0 this.c = this.c - 0.00002 ?this.c, this.x, this.n endif return function init(tnPhotonCount) this.n = tnPhotonCount return enddefine
Forum Sponsored by Wolfram Research
© 2004-2008 Wolfram Research, Inc. | Powered by vBulletin 2.3.0 © 2000-2002 Jelsoft Enterprises, Ltd. |
Disclaimer
vB Easy Archive Final - Created by Xenon and modified/released by SkuZZy from the Job Openings