danke schön !
ich habe es jetzt endlich hinbekommen juhuuu!
dreiecke in bildern programmieren ?
@kloed: Glückwunsch!
Ich hatte das zwischenzeitlich mal in Forth implementiert:
Die Breite des Dreiecks stimmt nicht ganz weil ich es einfach/ganzzahlig belassen wollte.
Ich hatte das zwischenzeitlich mal in Forth implementiert:
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