CODINGLISTINGS ★ The dragon curves on ... ★

Dragon Curves 2 (Computing with the Amstrad)Coding Listings
★ Ce texte vous est présenté dans sa version originale ★ 
 ★ This text is presented to you in its original version ★ 
 ★ Este texto se presenta en su versión original ★ 
 ★ Dieser Text wird in seiner Originalfassung präsentiert ★ 

IN the March 1987 issue of Computing with the Amstrad an article by Ian Sharpe showed how to produce a dragon curve using a recursive technique. The members of a different kind of dragon curve can be generated using the short program given here.

Each curve in the series can be represented by a string of 1s and Os, where 1 defines a 90 degree curve to the right and 0 defines a 90 degree curve to the left. You can see the idea in Figure I.

The program first generates the Os and 1s for the chosen curve, putting them in the array j1. Then the curve is plotted. As the order of the curve increases, so the curve becomes more complex, snaking all over the screen. Amazingly, it never crosses itself.

The curve is plotted a second time, beginning at the same starting point but rotated through 90 degrees. The second curve fits snugly against the first, interlocking like a jigsaw puzzle. Two more plots can be drawn, each rotated through 90 degrees to complete the pattern.

Curves with an order between 6 and 10 produce the best pictures. Higher order curves take a long time to finish and spill off the edges of the screen.


Figure I: The first four dragon curves

CWTA

★ PUBLISHER: Computing with the Amstrad
★ YEAR: 1987
★ CONFIG: 64K + AMSDOS
★ LANGAGE: ???
★ LiCENCE: LISTING
★ COLLECTION: COMPUTING WITH THE AMSTRAD 1987
★ AUTHOR: John Hulbert
 

★ AMSTRAD CPC ★ DOWNLOAD ★

Type-in/Listing:
» Dragon  Curves  2    (Computing  with  the  Amstrad)    ENGLISH    LISTINGDATE: 2020-08-05
DL: 226
TYPE: PDF
SiZE: 34Ko
NOTE: 1 page/PDFlib v1.6

★ AMSTRAD CPC ★ A voir aussi sur CPCrulez , les sujets suivants pourront vous intéresser...

Lien(s):
» Coding Src's » Country Garden (Computing with the Amstrad)
» Coding Src's » Ball Control (Computing with the Amstrad)
» Coding Src's » Baum des Pythagoras (CPC Amstrad International)
» Coding Src's » Graffitis (Amstrad Magazine 16)
» Coding Src's » Muzakology (Computing with the Amstrad)
» Coding Src's » Faster disc drives (Computing with the Amstrad)
Je participe au site:
» Pour ce titre nous ne disposons de fichier executable sur CPC (Saisie du listing) , alors si vous avez ça dans vos cartons ou vous désirez usé vos petit doigts boudinés sur votre clavier faites le nous savoir.
» Vous avez des infos personnel ?
» Vous avez remarqué une erreur dans ce texte ?
» Aidez-nous à améliorer cette page : en nous contactant via le forum ou par email.

CPCrulez[Content Management System] v8.7-desktop/c
Page créée en 095 millisecondes et consultée 772 fois

L'Amstrad CPC est une machine 8 bits à base d'un Z80 à 4MHz. Le premier de la gamme fut le CPC 464 en 1984, équipé d'un lecteur de cassettes intégré il se plaçait en concurrent  du Commodore C64 beaucoup plus compliqué à utiliser et plus cher. Ce fut un réel succès et sorti cette même années le CPC 664 équipé d'un lecteur de disquettes trois pouces intégré. Sa vie fut de courte durée puisqu'en 1985 il fut remplacé par le CPC 6128 qui était plus compact, plus soigné et surtout qui avait 128Ko de RAM au lieu de 64Ko.