Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Me: In a different random language, write a trivia game about the Discworld in 50 lines or less.
- OpenAI: Here is a randomly-selected programming language: Java. And here is a trivia game about the Discworld written in Java in 50 lines or less: [Code below]
- OpenAI: This code defines an array of trivia questions and answers, and then presents each question to the user, allowing them to enter their answer. The code then checks the user's answer and increments their score if it is correct. At the end, the code displays the user's final score.
- Me: what are some more questions you could add to the java one?
- OpenAI: Here are some additional questions that could be added to the Discworld trivia game written in Java:
- Who is the Discworld's equivalent of the god Odin?
- Who is the Discworld's equivalent of the god Thor?
- Who is the Discworld's equivalent of the god Loki?
- Who is the Discworld's equivalent of the god Dionysus?
- Who is the Discworld's equivalent of the god Apollo?
- Who is the Discworld's equivalent of the god Hermes?
- Who is the Discworld's equivalent of the god Mercury?
- Who is the Discworld's equivalent of the god Mars?
- Who is the Discworld's equivalent of the god Venus?
- Who is the Discworld's equivalent of the god Jupiter?
- Who is the Discworld's equivalent of the god Saturn?
- Who is the Discworld's equivalent of the god Uranus?
- Who is the Discworld's equivalent of the god Neptune?
- Who is the Discworld's equivalent of the god Pluto?
- OpenAI: To add these questions to the game, they could be added to the questions array in the same format as the existing questions.
- Me: what would the correct answers be to those questions?
- OpenAI: Here are the correct answers to the additional Discworld trivia questions that were listed in the previous response:
- Who is the Discworld's equivalent of the god Odin? -> Odin
- Who is the Discworld's equivalent of the god Thor? -> Thor
- Who is the Discworld's equivalent of the god Loki? -> Loki
- Who is the Discworld's equivalent of the god Dionysus? -> Dionysus
- Who is the Discworld's equivalent of the god Apollo? -> Apollo
- Who is the Discworld's equivalent of the god Hermes? -> Hermes
- Who is the Discworld's equivalent of the god Mercury? -> Mercury
- Who is the Discworld's equivalent of the god Mars? -> Mars
- Who is the Discworld's equivalent of the god Venus? -> Venus
- Who is the Discworld's equivalent of the god Jupiter? -> Jupiter
- Who is the Discworld's equivalent of the god Saturn? -> Saturn
- Who is the Discworld's equivalent of the god Uranus? -> Uranus
- Who is the Discworld's equivalent of the god Neptune? -> Neptune
- Who is the Discworld's equivalent of the god Pluto? -> Pluto
- OpenAI: These answers could be added to the game by adding them to the answers array in the same format as the existing answers.
- Me: I don't think those questions are very relevant to the Discworld. What are some better, more relevant discworld trivia questions and answers that could be added to the program?
- OpenAI: Here are some additional Discworld trivia questions and answers that could be more relevant to the series:
- What is the name of the guild of thieves in Ankh-Morpork? -> The Thieves' Guild
- Who is the leader of the Ankh-Morpork City Watch? -> Sam Vimes
- Who is the ruler of Ankh-Morpork? -> Lord Vetinari
- Who is the head librarian of the Unseen University? -> Librarians
- Who is the wizard in charge of the Unseen University? -> Archchancellor
- Who is the Discworld's equivalent of the witchfinder general? -> Granny Weatherwax
- Who is the Discworld's equivalent of the duchess of Borgia? -> Lady Margolotta
- Who is the Discworld's equivalent of the pope? -> The High Priest of Blind Io
- Who is the Discworld's equivalent of the fairy godmother? -> Miss Tick
- Who is the Discworld's equivalent of the three little pigs? -> The Three Little Pigs
- OpenAI: These questions and answers could be added to the Discworld trivia game written in Java by adding them to the questions array in the same format as the existing questions.
- Me: Those are good, but all the questions are quire similar "who is" questions. What would be a better range of varied Discworld trivia questions and answers?
- OpenAI: Certainly! Here are some additional Discworld trivia questions and answers that cover a wide range of topics:
- What is the name of the Discworld's equivalent of the planet Earth? -> The Discworld
- What is the name of the Discworld's equivalent of the planet Venus? -> The Discworld
- What is the name of the Discworld's equivalent of the planet Mars? -> The Discworld
- What is the name of the Discworld's equivalent of the planet Jupiter? -> The Discworld
- What is the name of the Discworld's equivalent of the planet Saturn? -> The Discworld
- What is the name of the Discworld's equivalent of the planet Uranus? -> The Discworld
- What is the name of the Discworld's equivalent of the planet Neptune? -> The Discworld
- What is the name of the Discworld's equivalent of the planet Pluto? -> The Discworld
- What is the name of the Discworld's equivalent of the planet Earth, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, and Pluto combined? -> The Discworld
- What is the name of the Discworld's equivalent of the universe? -> The Discworld
- What is the name of the Discworld's equivalent of the Milky Way galaxy? -> The Discworld
- What is the name of the Discworld's equivalent of the Andromeda galaxy? -> The Discworld
- What is the name of the Discworld's equivalent of the Triangulum galaxy? -> The Discworld
- What is the name of the Discworld's equivalent of the Large Magellanic Cloud? -> The Discworld
- What is the name of the Discworld's equivalent of the Small Magellanic Cloud? -> The Discworld
- OpenAI: These questions and answers could be added to the Discworld trivia game written in Java by adding them to the questions array in the same format as the existing questions.
- */
- import java.util.Scanner;
- import java.util.Arrays;
- public class DiscworldTrivia {
- public static void main(String[] args) {
- String[][] questions = {
- {"What is the name of the city-state on the Discworld that is known for its bureaucracy?", "Ankh-Morpork"},
- {"What is the name of the Discworld's equivalent of Death?", "Death"},
- {"What is the name of the Discworld's equivalent of the Devil?", "Crimson King"},
- {"What is the name of the Discworld's equivalent of magic?", "The Art"},
- {"What is the name of the Discworld's equivalent of Hell?", "Hell"},
- {"What is the name of the Discworld's equivalent of the sun?", "Great A'Tuin"}
- };
- int score = 0;
- Scanner scanner = new Scanner(System.in);
- for (String[] question : questions) {
- System.out.println(question[0]);
- String answer = scanner.nextLine();
- if (answer.equals(question[1])) {
- System.out.println("Correct!");
- score++;
- } else {
- System.out.println("Incorrect.");
- }
- }
- System.out.println("You scored " + score + " out of " + questions.length + ".");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment