User Tools

Site Tools


resources_for_peek-a-boo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
resources_for_peek-a-boo [2022/05/09 12:54] frchrisresources_for_peek-a-boo [2022/05/23 16:43] (current) frchris
Line 1: Line 1:
 **Peek-A-Boo** **Peek-A-Boo**
  
-<code>+<code java>
 import java.awt.Color; import java.awt.Color;
 import java.awt.Font; import java.awt.Font;
Line 33: Line 33:
  
  timer1 = new Timer(1000, this); //1000=1 seconds  timer1 = new Timer(1000, this); //1000=1 seconds
- timer2 = new Timer(3000, this); //1000=1 seconds+ timer2 = new Timer(2000, this); //1000=1 seconds
  timer1.start();  timer1.start();
  timer2.start();  timer2.start();
Line 82: Line 82:
  int r = (int)(26*Math.random());  int r = (int)(26*Math.random());
  ch = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(r);  ch = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(r);
- message = "try Again.  The new Letter is "+ch;+ message = "No, try Again.  The new Letter is "+ch
 + timer1.restart();
  }  }
  repaint();  repaint();
Line 94: Line 95:
  if (e.getSource()==timer1){  if (e.getSource()==timer1){
  message = "Now type that Letter";  message = "Now type that Letter";
 + timer1.stop();
  timer2.start();  timer2.start();
  } else {  } else {
 + timer2.stop();
  int r = (int)(26*Math.random());  int r = (int)(26*Math.random());
  ch = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(r);  ch = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(r);
  message = "try Again.  The new Letter is "+ch;  message = "try Again.  The new Letter is "+ch;
 + timer1.restart();;
  }  }
  repaint();  repaint();
resources_for_peek-a-boo.1652115297.txt.gz · Last modified: 2022/05/09 12:54 by frchris

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki