![]() |
||
| Home | SwiftForth Archive | SwiftX Archive | |

Very nice! Thanks Charles.
Have a Merry Christmas!
Unable to run on 2.0 though.
Date sent: Wed, 22 Dec 1999 10:14:15 -0800
From: SF Talk <sftalk_at_forth.com>
To: SF Talk <sftalk_at_forth.com>
Send reply to: SF Talk <sftalk_at_forth.com>
Subject: Mary Chrismas integral by Monte Carlo's method.
> Date: Wed, 22 Dec 1999 18:52:17 +0100
> From: "Charles Melice" <mail_at_forthcad.com>
> Subject: Mary Chrismas integral by Monte Carlo's method.
>
> Just to say MERRY CHRISTMAS to all friends.
>
> Charles Melice
>
> PS: The following tested on SF 1.5 - Hoping it works also on 2.0.
> _____________
>
> REQUIRES RND
> DECIMAL
> 4 IMPORT: SetPixel
> 3 IMPORT: GetPixel
>
> : MC ( -- )
> PAGE S" MERRY CHRISTMAS " 2DUP TYPE HDC -ROT PAD DT_CALCRECT
> DT_SINGLELINE OR DrawText dup 2/ + PAD 2 CELLS + @ 100000 0 DO KEY? IF
> KEY 27 = IF LEAVE THEN THEN 2DUP RND SWAP RND 2DUP HDC -ROT GetPixel
> $FF AND IF 10 + SWAP 4 SWAP OVER * -ROT SWAP OVER * OVER BOUNDS DO
> 2DUP BOUNDS DO HDC I 2 RND + J 2 RND + 3DUP GetPixel 7 RND 7 RND 8
> LSHIFT OR 7 RND 16 LSHIFT OR - ROT 2 RND + ROT 2 RND + ROT SetPixel
> DROP LOOP LOOP 2DROP ELSE 2DROP THEN LOOP 2DROP ;
>
> CR .( Type MC )
>
>
>
.
Received on Wed Dec 22 1999 - 12:09:12 PST
This archive was generated by hypermail 2.2.0 : Thu Nov 20 2008 - 03:04:26 PST