Re: dreiecke in bildern programmieren ?
Verfasst: Dienstag 1. Mai 2012, 20:03
danke schön !
ich habe es jetzt endlich hinbekommen juhuuu!

ich habe es jetzt endlich hinbekommen juhuuu!
Seit 2002 Diskussionen rund um die Programmiersprache Python
https://www.python-forum.de/
Code: Alles auswählen
\ Flag of the Bahamas as PPM.
800 constant width
width 2/ constant height
: black ( -- ) ." 0 0 0" ;
: aquamarine ( -- ) ." 102 205 170" ;
: gold ( -- ) ." 255 215 0" ;
: main ( -- )
." P3 " width . height . ." 255" cr
height 6 / height 2/
height 0 ?do
width 0 ?do
dup j - abs \ distance to horziontal middle
2dup - dup 2/ + i >=
if black
else dup 3 pick <= if gold else aquamarine then
then space drop
loop cr
loop 2drop ;
main
bye