Archived
1
0

Eingegebene Buchstaben werden jetzt in Großb. konvertiert

Außerdem einige Kommetare hinzugefügt
This commit is contained in:
1998-12-01 19:12:21 +00:00
parent 4c394ff550
commit ce912c3d57

View File

@ -1,8 +1,24 @@
/*
HANGMAN FOR JAVA
(c)1998/99 by Markus Birth <Robo.Cop(a)gmx.net>
This is the first program I wrote in Java. Thanks to
Mr. Fr<46>bel for making me learning Java so quick (We had to
finish our projects for the computer science lessons.)
Things used for the making of this:
-Xemacs with its Revision Control System
-hangman.java from Carlos von Hoyningen-Huene
-some bottles of PEPSI Coke
-hints & tips from Carlos von Hoyningen-Huene
*/
import java.applet.*; import java.applet.*;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
import java.math.*; import java.lang.Character.*;
import java.io.*; // f<>r Dateioperationen ("Tupfer, Schere ...") import java.math.*; // eigentlich nur f<>r die eine Zufallszahl
import java.io.*; // f<>r Dateioperationen ("Tupfer, Schere ...")
public class hangman extends Frame public class hangman extends Frame
{ {
@ -12,9 +28,10 @@ public class hangman extends Frame
int maxdat=0; int maxdat=0;
String words[]; String words[];
String myword=null; String myword=null;
char probed[]; // "-----------------------------"; char probed[];
char alphab[]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T', char alphab[]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N',
'U','V','W','X','Y','Z','<27>','<27>','<27>'}; 'O','P','Q','R','S','T','U','V','W','X','Y','Z',
'<27>','<27>','<27>'};
int mistakes=0; int mistakes=0;
KL CONTROL; KL CONTROL;
char c; char c;
@ -69,6 +86,7 @@ public class hangman extends Frame
public void keyTyped(KeyEvent e) public void keyTyped(KeyEvent e)
{ {
c=e.getKeyChar(); c=e.getKeyChar();
c=java.lang.Character.toUpperCase(c);
int i; int i;
for (i=0;i<29;i++) { for (i=0;i<29;i++) {
if (c==alphab[i]) { if (c==alphab[i]) {
@ -89,7 +107,7 @@ public class hangman extends Frame
System.exit(0); System.exit(0);
} }
}); });
frame.setTitle("HangMan for Java - <EFBFBD> 1998 by Markus Birth"); frame.setTitle("HangMan for Java - \u00a91998 by Markus Birth");
frame.setSize(WND_B, WND_H); frame.setSize(WND_B, WND_H);
frame.show(); frame.show();
} }