Posts

DIY java hearts

I am discovering that I am not very good at reading explicit instructions....  another reason I suck at baking sweets, and another reason I always felt bad for the kids at Hogwarts in potions class. Something new I really need to focus on, because from what I've learned so far about coding, it requires a great deal of doing things in a precise order, and in a precise way. I can do this. Give me a skillet, stove top or a steak and it's instinctual to me, implicit. Cook it until it stops bleeding. Boil it too long and it will be crap.  Make it tastes how you'd want it to taste. Never trust a skinny cook(unless they eat like a starving hyena (lucky sons-o-jackolaterns eat whatever they want and never have to pay for it)). Tell me to bake a cake from scratch, I might get a surge of anxiety. I did all right in chemistry classes... I never blew the class up doing it wrong.... But then again it's not like the experiments involved anything so volatile that this was possib...

complete playable Hangman JAVA

Here is the link to the JAR download from my google drive: The random selector worked in this one.  Think I need to look up what 'seeded' means. https://drive.google.com/open?id=0B3jCoMOxti9fV05TdVU1aUlSSjQ Next up, Project 16: Crazy Eights.

working JAVA Hangman

This isn't complete. I still have to add the text file with all the different phrases for it to use.  But it is a working program. A lot of the problems I had with it were because I would skip over parts of the lesson that were redundant, or would be changed later,  and then my code would end up in the wrong places, so I had to go back through the lesson and fix all the locations. Error 1:  if you enter more then 1 letter, it adds both to the 'wrong letters' Error 2: typing more then one correct letter will fill them in. Fixed Errors with :     found = true;     index = -1; I'm going to keep trying to mess with it to find all the problems. Will add anymore I find. Fixes will be highlighted. package nellie.tobey.Hangman; import nellie.tobey.mystringmethods.MyStringMethods; import nellie.tobey.mywindow.MyWindow; public class Hangman extends MyWindow {  private String phrase;  private String clue;  private St...

guess my word JAVA completed

This is the working version: I'll highlight the changes that fixed it. package nellie.tobey.wordmastermind; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.Random; import nellie.tobey.mystringmethods.MyStringMethods; import nellie.tobey.mywindow.MyWindow; public class WordMastermind extends MyWindow {  private String word;  private String clue;  private static final int numberOfWords = 342;  private static final String filename = "wordMastermind.txt";  public WordMastermind() {   String words[] = new String[numberOfWords];     //this fixed random   //int rand = (int) (Math.random() * numberOfWords);   try {    BufferedReader in = new BufferedReader(new FileReader(new File(filename)));    for(int i = 0; i < numberOfWords; i++) {     words[i] = in...

guess my word not working

I know I have things wrong.  It runs, but not how I want it to, first error: the first random word it picks is 'said'  every time.  That's not random. second error: It doesn't restart the game cleanly.  Things print I don't want it to. third error: It doesn't pick a new random word until the third play through. First two words are said. fourth error: It doesn't close properly when you tell it that you do not want to repeat. I'll post a corrected version when I figure it out.  Once again the cheat it the back is almost completely useless.  Learning the hard way.  Hurray. package nellie.tobey.wordmastermind; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.Random; import nellie.tobey.mystringmethods.MyStringMethods; import nellie.tobey.mywindow.MyWindow; public class WordMastermind extends MyWindow {  private String word; ...

eclipse doesn't like my imports

Besides eclipse not helping me figure out what's wrong with my {},  it also doesn't like to recognize imports from java.io.   I save it, close it, close eclipse, open it all back up, and it tends to recognize them after that. Not sure if saving the workspace is changing the way the paths are running.... I can't find the reason it's doing this on google. If I figure it out, or anyone knows why, feel free to comment and let me know. There are mistakes all over that I keep having to find the hard, long way round.  I really wish Annette Godtland would have put the full completed code in the back instead of the snippets from each part of the lesson. I guess learning the hard way will teach me more, but sometimes its just really infuriating to think I've done what she told me, just to find out I did something wrong along the lines.

Empty prompt

Lesson 14.... The author has a tendency to have to write stuff half way and complete it, clean it up later in the lesson.  In the beginning of this lesson you create a new promptForYesNo(), that has it's own prewritten prompt in a while loop. The thing I find odd is that you have to give a prompt in the function call to make it run properly,  but that prompt will not be used at all.  I'll copy and paste the code and highlight what I'm talking about.  It seems like a waste somehow, but I can see how having a function to just ask to continue would be useful, but if you want to change the prompt, you have to change it in the method's while loop, and not in the class you're importing the method too.   Maybe this will be addressed later,  will update. MasterMind class method:  public WordMastermind() {   boolean repeat = true;   while(repeat) {    print("Hello!");     repeat = promptForYesNo(""); ...