Posts

Showing posts from September, 2017

it's been a long time python.

Image
I'm realizing I might not have time to experiment outside of my online course,  I know we're not supposed to compare ourselves to our piers in the class, but I am quite certain that these folks are way ahead of me.  I'll catch up, but it means not being able to do a lot of experimenting on the side.

Oh, and python has changed in 5 years, but I totally forgot how easy it is too read.  Especially after experimenting with other languages. 

My old blog had some stuff I did in python, maybe I'll reblog some of that here.  Undecided.

Problem of the day:

I downloaded and installed python 3.6, but powershell still was using the old 2.7. 
this reveals your version:

PS C:\Users\sarah> python



I had to uninstall 3.6, reinstall it, make sure it was making a path for me(click on the box in the options when it opens the exe), I also had it install for all users.... even though I'm the only one,  to make sure it did the install in administrative mode, and restart the computer.

time for a hammer

So I did a python book YEARS ago, and never got around to doing programming again until this blog.  The atom.io I need to install on this computer keeps failing.  (this computer is soo weak).  So, there is another computer I can use, it's been packed a while, and I'll need to wipe a ton of stuff my son downloaded onto it, WoW, Steam, all that stuff.  It's linux, which is ok, because the first time I did the python book I did it on linux. 

I'm out.  I'll have to wait to set all that up before I can start.  DOH!

I should go back and say that eclipse and android studio probably weren't bad, just my computer.  I'll just say it here. 

Later.

codeacademy because it's free

Getting ready for the junior development class by trying to get some courses done in Codecademy.
It's free, why not!

starting an online course soon

So, I'm a fan of the way Zed Shaw teaches programming,  and I found out he's doing a junior development certificate course.  I will be starting that soon, but I hope to keep posting things I learn as I go, but I think all the work is protected, so I'll be posting other things I work on as I'm doing that.

update:
I can share all I want,  but I think I'll just share stuff I find interesting or fun, or helpful in some way to someone who stumbles across my blog.


Hopefully I don't need an actual working program like eclipse to do his course.  I guess if I do, I'll have to wipe the ones I got and load what we're using in the course.  My sibling has offered me a different computer if need be.  That'll probably be what I have to do. 

Later!

update:
excited and scared all at the same time!  Got a lot of the setup done for the course.  I did end up deleting the android studio to get things going.  Discord was trying to load into the atom files for some reason,  …

Ecllippse is having a brain fart.

Image
My eclipse is totally screwing with me right now.... I want to work on code, but it won't even recognize:

System.out.println("Hello");








I have no classes or variables or anything named System in my package,  and this line works in the other classes, just not my Inventory class.  I tried restarting it.... I checked StackOverFlow....

I'll update if I figure it out.  Or maybe I'll just use a hammer to fix it.

I guess I can keep trying to make other bits of code without it, but I use System.out.println to test a lot of things.  Hrmmmm.  Frustrating.

making a java inventory

I got super frustrated with Android Studio,  so to make myself not feel like I failure I decided to try and make a workable inventory like you'd use on a classic RPG.  It's not done, but so far this much works!
There are more classes, but I just focused on getting my item inventory to work for now. Here are the three in use.
update: added a useItem&itemHeal to Inventory, i tried making it a part of Item Class, but I couldn't make it work there.
Main Class:

package nellie.tobey.inventory;

public class TestGame {

public TestGame() {
Inventory myInventory = new Inventory();
String printItemName = myInventory.getItemName();
System.out.println("Item = " + printItemName);
System.out.println("Hello");

}

public static void main(String[] args) {
new TestGame();

}

}



Item Class:
package nellie.tobey.inventory; import java.util.ArrayList;
public class Item { String name; int itemHeal; int itemBoost; int itemModWeapon; int itemModArmor;
public Item(String n) { name = n;
} }
Inventory Cla…

renamed a text ID, now I have to find the original one and delete it

Image
So here's my first big problem.  I entered an invalid name for my ID, the text box, and saved it before I realized what I did....  I renamed it to one that was correct, but the builder is still trying to use the old ID....  Trying to locate it and take it out is proving to be a monumental task.  Not much help on google.  I will update if I find it so if anyone else has this issue they have an answer.

I am going to just start the project brand new,  and come back to that error later.  It is unacceptable that this happens, and I need to find how to fix it (because once you have hours put into something, there is no way you're going to want to redo it all) , but later.

update:

I think my computer is too slow and low memory to run any of the android studio.  It can't even build the pre-built Hello World that is created when you start a new program.... now it's saying my virtual device is not working.... Seriously.  My amazing sibling already did something to fix the speed …

thinking about returning this book

Even the author says that advances are being made to Android rapidly.  This book was published 2 years ago, and it seems really out of date for the current Android Studio.  I sent in an errata to try and find out what the deal is with an import the author tells us to use that isn't recognized by the studio....

The author also has you use an android version API that isn't even available on the new studio.

I have a feeling that import is out of date, or the intention was to type it in and then just put it back to the way it was, but it's really frustrating to think that maybe this book is just too out of date.

I'm going to wait to see if I get a response in the next couple days, then I might just go to the library and see if they have a newer book on Android Studio. And then this one is being returned. I'll update.

update
I have a strong feeling, that although some of the things in the book are out of date, it would still work for someone with a more powerful computer…

new book

I am starting:  Learning Java by Building Android Games,  by John Horton.
First problem I encountered was that the Microsoft Edge was not letting me download the Android Studio.... I googled a bit, then decided installing Google Chrome.
It worked.  Google Chrome let me download without issue.

Now that I got it installed,  after about 40 minutes of download time and set up,  It runs really slowly.
I'm sure it's my computer,  it didn't like eclipse either.

Anyhoo Here we go!

finished Crazy Eights!!

Do-It-Yourself Java Games
By: Annette Godtland

Completed!!!
Going to toy around with making something myself, then on to the next book!

Here is the link to the .jar  file in my google drive.



https://drive.google.com/file/d/0B3jCoMOxti9fM1FNMnJXSnhNZjQ/view?usp=sharing


java testing a boolean method

Ok, I'm still a ways from done on CrazyEights, and I got sidetracked wondering how the if statement works on a Boolean.   So I made up this little test to check if a Boolean is false or true.

Not sure what purpose it will serve yet, but I wanted it.

private int testing(boolean method) {
  int test = 1;

  if(method) {
   test = 0;
   }

  System.out.println("testing method:  " + test);
  return test;
 }

I have encountered yet another gameplay issue.  If an invalid card is entered, but it is a card in your hand,  It is removing it.....  I only have one method that removes my cards, and it is not executing, so I need to find out why it is removing the cards from my hand.

I'm pretty sure the card is being removed in this function.... But HOW!!!

Update:
The problem was in my Hands class.  For some crazy reason I had this function removing the card if it was found.  When the isValidPlay(); was running, it was checking if the card was in my hand, and this function was removin…

DIY java CrazyEights problem with drawing cards not adding to displayed hand

I've found every time there was a problem I typed something wrong, and that was the source of my error.  This time, I think though, the error is in the code, and not my fault.

When I find the answer, I will edit this post and display the fix at the bottom.

Here are the two methods that are not working together.  The game plays fine, but the hand will not display the drawn cards that are added to myhand when 'showStatus()' is called.

update:
Two fixes.  It is NOT what the author has. The Boolean isValidPlay(); is the problem.  I will test some more and find out why.  Amazing help from my genius sibling.  I try everything before asking for help, but this time I was dumbfounded.  Still haven't figured out why isValidPlay(); was deleting the cards from my hand.
update:
Found the culprit to the disappearing cards.  It was a remove statement in the 'contains()' function of Hands class.   It totally didn't belong there, no idea why I put it there. So what the book has…

missing array, making a deck of cards

So I kept getting this error:
Will also post the Deck Class below:

Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
 at java.util.ArrayList.rangeCheck(Unknown Source)
 at java.util.ArrayList.remove(Unknown Source)
 at nellie.tobey.crazyeights.Deck.deal(Deck.java:39)
 at nellie.tobey.crazyeights.CrazyEights.deal(CrazyEights.java:53)
 at nellie.tobey.crazyeights.CrazyEights.<init>(CrazyEights.java:24)
 at nellie.tobey.crazyeights.CrazyEights.main(CrazyEights.java:94)



It took me a stupid long time of printing of the results of all the different methods before I found the problem.

When the deck is created, it's named cards.  When I shuffled it, all the items in the array are removed and put into a new array named shuffled.  That left my cards array empty.  I forgot to change the name of shuffled(Array) back to cards(Array) when the task was complete.

I don't know if any one else will find this useful, but I know I had a hard time finding…

Eclipse renaming classes already being used by another package

Image
I still don't know if it's just my computer, or a bug in my eclipse.  Screen shot on bottom.

Eclipse doesn't like it when you rename a java project/class that is being used in another project/class.

I deleted the old project to try and fix the bugs I was getting, but it still told me that the path for that class didn't exist even after renaming, and renaming them all in the main file I was trying to run.

What I had to do to fix it:

After I got the new name by deleting the old java project, and creating a new one with the new name:
(and renaming the class) (I just copied and pasted the it into a newly created java project)

I had to right click the main file I was running, and go to properties:
Go to java build path
Go to projects
Remove all references to the missing project from the list
Add the newly named project to that list.

Hope this helps!

Eclipse.... argg.

Eclipse sometimes will insist something is wrong, and really if you just save what you're doing, close eclipse and open it again,  the problem seems to have disappeared.

I'd suggest trying this if you're having issues with Eclipse accepting your code.

If it doesn't work, then I'd think there really is something wrong with the code.

This might just be me, because I did something wrong setting it up, or my laptop is crummy and lags trying to process code in Eclipse.

First world problems.

Happy Labor Day!