Skip to content

Instantly share code, notes, and snippets.

@pastagatsan
Last active April 21, 2017 09:33
Show Gist options
  • Save pastagatsan/49de7364754810700e7f5166b26d6758 to your computer and use it in GitHub Desktop.
Save pastagatsan/49de7364754810700e7f5166b26d6758 to your computer and use it in GitHub Desktop.
Penne Hello World example
#include "penne.h"
#include "time.h"
#include "elements/string.h"
#include <ncurses.h>
int main()
{
srand(time(0));
PenneCanvas* canvas = PenneCanvas_new(0, 0, 80, 24);
PenneString* hello = PenneString_new(canvas, "Hello world!", rand() % 60, rand() % 24);
PenneCanvas_add(canvas, hello);
initscr();
PenneCanvas_draw(canvas, stdscr);
getch();
endwin();
PenneCanvas_destroy(canvas);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment