Skip to content

Instantly share code, notes, and snippets.

@blude
Created April 26, 2012 05:14
Show Gist options
  • Select an option

  • Save blude/2496133 to your computer and use it in GitHub Desktop.

Select an option

Save blude/2496133 to your computer and use it in GitHub Desktop.
Primeiras experimentações com Pen-C.
// desenho formado por esse código:
// http://is.gd/sbxOxQ
void main(void) {
inicia();
origem(320, 240);
int i;
for (i = 0; i < 64; i++) {
// pura tentativa e erro pra gerar as cores das linhas.
cor(
i + i % 100, // vermelho
2 * i % 100, // verde
1 / (1 + i * i) // azul
);
// do ponto A(0, 20) ao B(200, 20)
linha(0, 20, 200, 20);
rotaciona(45);
// muda as coordenadas de origem
// novamente, tentativa e erro. :P
origem(
i, // x
-2 * i // y
);
}
termina();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment