Code effects:
Code:
Import Java.util.Scanner;
/*
Complete verse
*/
public class Game1 {
public static void Main (string[] args) {
int x=1,y=0;
while (x==1) {
System.out.println ("");
Char D;
int m=5; Number of topics
int cc[] = new Int[m];
String str[] = new String[m]; Topic
Str[0] = "Softly I go, as I softly come.";
STR[1] = "I waved softly to the clouds of the Western heavens." ";
STR[2] = "The Golden Willow on the river is the bride in the sunset." ";
STR[3] = "The vivid shadow in the wave of the waves, in my heart ripples." ";
STR[4] = "I waved my sleeves without taking a cloud." ";
for (int n=0;n<m;n++)
Cc[n]=n;
int i2 = (int) (Math.random () *cc.length); The randomness of the quiz
String str = Str[i2];
String S=new string (str);
int Lens=s.length ();
System.out.println ("+lens+" characters in the verse);
int aa[] = new Int[lens];
for (int a=0;a<lens-1;a++)
Aa[a]=a;
int i = (int) (Math.random () * aa.length); Get random number
System.out.println ("Random number:" +i);
int n=i;
for (int b=0;b<lens;b++) {//Output topic
char C = Str.charat (b);
if (b==n) {
System.out.print ("_");
}
Else
System.out.print (c);}
System.out.println ();
char C2 = Str.charat (n);
Scanner sc = new Scanner (system.in);
System.out.print ("Please enter answer:");
char name = Sc.next (). charAt (0);
if (NAME==C2) {
System.out.println ("Ture" + "+1");
++y;
}
else{
System.out.println ("False");
++x;
System.out.println ("Final score:" +y);
}
System.out.println ("Random word:" +c2);
}
}
}
java--Full Verse code