5 years, 5 months ago.  This question has been closed. Reason: Unclear question

i need a bit of help with code for the rules of the game of life with nokia 5110 lcd please ?

int main() {

lcd.init();

lcd.normalMode(); lcd.setBrightness(0.7); lcd.clear(); lcd.inverseMode();

lcd.printString(" ",0,0); lcd.printString(" The Game Of ",0,1); lcd.printString(" Life ",0,2); lcd.printString(" ",0,3); lcd.printString(" (c) by ",0,4); lcd.printString(" Jose.S ",0,5); wait(1.0); lcd.clear();

lcd.refresh();

lcd.drawRect(0,0,83,47,0); lcd.printString(" THIS IS THE",0,1); lcd.printString(" BEGINNING OF ",0,3); lcd.printString(" LIFE....",0,4); wait(1.0); lcd.clear(); lcd.inverseMode();

lcd.drawRect(0,0,83,47,0); lcd.printString(" 3 ",0,1);

wait(1.0); lcd.clear();

lcd.drawRect(0,0,83,47,0); transparent, just outline lcd.printString(" 2 ",0,2); size 14 characters wait(1.0); lcd.clear();

lcd.drawRect(0,0,83,47,0); transparent, just outline lcd.printString(" 1 ",0,3); wait(1.0); lcd.clear();

lcd.drawRect(0,0,83,47,0); transparent, just outline lcd.printString(" GO!! ",0,3); wait(1.0); lcd.clear();

////---game starts from here--/////////

lcd.setPixel(40,20); lcd.setPixel(40,22); lcd.setPixel(40,24); lcd.setPixel(38,22); lcd.setPixel(42,22);

lcd.refresh();

}

It is easier to read code if you surround it in <<code>> <</code>> tags. For example this:

<<code>>
int main(void)
{
    printf("Hello World\n");
    return 0;
}
<</code>>

Would produce this for output:

int main(void)
{
    printf("Hello World\n");
    return 0;
}
posted by Adam Green 22 Apr 2015

1 Answer