Chaos game: Difference between revisions

no edit summary
No edit summary
Line 175:
{{out}}
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Chaos_game.png Screenshot from Atari 8-bit computer]
 
=={{header|Amazing Hopper}}==
{{trans|BASIC256}}
<p>Considerar que Hopper no usa modos gráficos, y solo imprime el caracter ascii 219 achicando el tamaño de caracteres de la terminal, dado la ilusión de un modo gráfico "arcaico".</p>
<lang Amazing Hopper>
/* Chaos game - JAMBO hopper */
 
#include <jambo.h>
 
#define LIMITE 50000
 
Main
ancho = 700, alto = 150
x=0,y=0,color=0
vertice=0,
c=0, Let( c := Utf8(Chr(219)))
Let(x := Int(Rand(ancho)))
Let(y := Int(Rand(alto)))
 
mid ancho=0, Let( mid ancho:= Div(ancho,2))
 
i=LIMITE
Void(pixeles)
Loop
Ceil(Rand(3)), Move to (vertice)
If( Eq(vertice,1) )
Let(x := Div(x, 2))
Let(y := Div(y, 2))
color=9
Else If( Eq(vertice,2))
Let(x := Add( mid ancho, Div(Sub(mid ancho, x), 2) ) )
Let(y := Sub( alto, Div( Sub(alto, y), 2 )))
color=10
Else
Let(x := Sub(ancho, Div( Sub(ancho, x), 2)))
Let(y := Div(y, 2))
color=4
End If
Set( Int(y), Int(x), color),Apndrow(pixeles)
--i
Back if (i) is not zero
Set video graph(2)
Canvas-term
Cls
i=1
Iterator(++i, Leq(i,LIMITE), Colorfore([i,3]Get(pixeles)), \
Locate( [i,1]Get(pixeles), [i,2]Get(pixeles) ), Print(c) ); Prnl
Pause
Set video text
End
</lang>
 
 
=={{header|BASIC}}==
543

edits