Skip to content
This repository was archived by the owner on Dec 17, 2022. It is now read-only.

Commit

Permalink
12-9-AJ
Browse files Browse the repository at this point in the history
Tree64 Complete. Fixed Saving to wrong file.
  • Loading branch information
ajnorell committed Dec 9, 2022
1 parent e8d9242 commit ae5466b
Show file tree
Hide file tree
Showing 19 changed files with 75 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"name": "Run GuessingGame",
"request": "launch",
"mainClass": "${file}",
"args": "naenae.data"
"args": "tree64.data"
}
]
}
Binary file modified bin/BinaryTreeNode$Visitor.class
Binary file not shown.
Binary file modified bin/BinaryTreeNode.class
Binary file not shown.
Binary file modified bin/Game.class
Binary file not shown.
Binary file modified bin/Guess.class
Binary file not shown.
Binary file modified bin/GuessingGame.class
Binary file not shown.
Binary file modified bin/LinkedBinaryTreeNode.class
Binary file not shown.
Binary file modified bin/LinkedBinaryTreeNodeTest.class
Binary file not shown.
Binary file modified bin/Question.class
Binary file not shown.
Binary file modified bin/TreeDisplayPanel$1.class
Binary file not shown.
Binary file modified bin/TreeDisplayPanel$2.class
Binary file not shown.
Binary file modified bin/TreeDisplayPanel.class
Binary file not shown.
Empty file removed bin/tree64.data
Empty file.
4 changes: 4 additions & 0 deletions naenae.data
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Q:Are you thinking of a person?
Q:Is it an animal
G:A Ferrari
G:Dolphin
Q:Is the person alive?
Q:Was the person a woman?
Q:Was he an actor?
Expand All @@ -13,7 +15,9 @@ G:Dizzy Gillespie
G:Charlie Chaplin
G:Grace Hopper
Q:Is the person a woman?
Q:Did they star in the Matrix
G:Matthew Broderick
G:Keanu Reeves
Q:Is she an actress?
Q:Is she a politician?
Q:Is she a scientist?
Expand Down
6 changes: 4 additions & 2 deletions src/GuessingGame.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
public class GuessingGame implements Game{
LinkedBinaryTreeNode<String> root;
private static Scanner sc = new Scanner(System.in);
private static String filepath;

@Override
public BinaryTreeNode<String> loadTree(String filename){
Expand Down Expand Up @@ -125,14 +126,15 @@ public void play() {
}

}
this.saveTree("naenae.data");
this.saveTree(filepath);
}

public static void main(String[] args) {
if(args.length != 1) throw new IllegalArgumentException("Exactly one command line argument needed!");
if(!args[0].contains(".data"))throw new IllegalArgumentException("filename must be of type 'data'");
GuessingGame game = new GuessingGame();
game.loadTree(args[0]);
filepath = args[0];
game.loadTree(filepath);
game.play();
}

Expand Down
21 changes: 0 additions & 21 deletions src/tree4.data

This file was deleted.

Empty file removed src/tree64.data
Empty file.
File renamed without changes.
66 changes: 66 additions & 0 deletions tree64.data
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
Q:Are you thinking of a person?
Q:Is it an animal
Q:Is it a plant
G:A Ferrari
Q:Is it a tree
Q:Is it edible
G:Cork
Q:Is it a cereal
Q:Is it a starchy root
Q:Is it a legume
Q:Is it a vegetable Oil
Q:Is it a fruit
G:Peppers
G:Strawberries
G:Olive Oil
Q:Is it in a pod
G:Beans
G:Peas
G:Potatoes
G:Wheat
Q:Is it a mammal
Q:Is it a reptile
Q:Is it a fish
Q:Is is a amphibian
Q:Does it have at least 3 pairs of legs
Q:Is is worm like
G:Tapeworm
G:Earthworm
Q:Does it have more than 3 pairs of legs
G:Ant
G:Scorpion
Q:Does it have a tail
G:Frog
G:Salamander
Q:Is it toxic
G:Salmon
G:Lionfish
Q:Is it venomous
G:Turtle
G:Snake
Q:Does it live in water
G:Bear
G:Dolphin
Q:Is the person alive?
Q:Was the person a woman?
Q:Was he an actor?
Q:Was he a musician?
Q:Is your person a former US president?
G:Albert Einstein
G:George Washington
Q:Was he a jazz player?
G:Jerry Garcia
G:Dizzy Gillespie
G:Charlie Chaplin
G:Grace Hopper
Q:Is the person a woman?
Q:Did they star in the Matrix
G:Matthew Broderick
G:Keanu Reeves
Q:Is she an actress?
Q:Is she a politician?
Q:Is she a scientist?
G:Maya Angelou
G:Dedre Gentner
G:Angela Merkel
G:Judi Dench

0 comments on commit ae5466b

Please sign in to comment.