Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Justin Johnson

Greenhorn
+ Follow
since Sep 12, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Justin Johnson

Winston is correct in that there is no real need to calculate hand strength until the very end of the hand where you are forced to determine the winner (showdown). For human players playing against other human players this will be sufficient as long as your program knows how to read the player's hands and evaluate them based on the list of hand rankings, flush beats straight for example.

If you're developing a poker playing artificial intelligence or if you're just curious you may want to look into starting hand strength from a strategic standpoint. As was pointed out, in texas holdem an ace and a king is a better starting hand than a two and a seven. One way to determine this is by running both hands through an equity simulator, which is a program that runs hundreds of thousands of different possible boards out that allows you to get a pretty accurate estimate as to which hand wins more often. Then you can run each hand against each other possible hand, determine an average equity and then rank the hands accordingly. There are two great free programs out there that do this already:

PokerStove
ProPokerTools

Its still however, ultimately a matter of strategy that determines what the best hands are and not programming since there are different betting streets and different player psychologies.
TwoPlusTwo is a great strategy site that also has a programming forum.
9 years ago

Alex Pupyshev wrote:
I bought the enthuware mock exams too. Did you have any questions on the real exam that are not covered by the software ?



Not really. String concatenation and for-each loops seemed to have proportionally more questions on the real exam, but they're both still covered by enthuware. In this case I think what not to study is the real question.
9 years ago

Jeff Verdegan wrote:

Justin Johnson wrote:
In the meantime though, if there is a quick fix available for my program above what is it?



There almost certainly is. I'm sure not gonna give it out though. I don't like encouraging bad habits.

So far I've posted all my code and none of the suggestions given so far have worked. Are they working for anyone else?



If they didn't work, then you didn't follow them correctly. If you show your current code (or better a version stripped down to an SSCCE), then somebody should be able to point out where you went wrong.



Yeah I followed a lot of variations of the quick fix advice given (starting with simply adding the static modifier to printAtlantic() )and it still doesn't work, but you're right, getting back to the basics is the way to go. I appreciate your help and thanks for trying.
10 years ago

Jeff Verdegan wrote:
I think it's time to take a step back and actually learn and understand the concepts of static and non-static, so you'll be able to use them appropriately in your design.



Yeah I definitely have to do this, I originally simply created the program for just printing out stats of one team and then later I decided I wanted to include the team within divisions. It looks like arrays is the best route to go about doing this (I haven't gotten to the chapter on arrays yet though).

In the meantime though, if there is a quick fix available for my program above what is it? So far I've posted all my code and none of the suggestions given so far have worked. Are they working for anyone else?
10 years ago

Gary Deer wrote:
To keep the design the way it is I would suggest using an array, adding the division as a member variable, and using a for loop to iterate over the teams printing those whose division variable == "Atlantic". I'm just going off the top of my head here, so there might be scoping issues with that solution too, but you might think of something else while trying to implement that.



Thanks, this is definitely an approach I would be willing to take. Just to clarify, teams and divisions are set in stone and will always be held constant for the scope of this program. I just want a small program to mess around with stats a little, this isn't something I'm looking to have for years.
10 years ago

Jeff Verdegan wrote:You could make printAtlantic static. That would get rid of one compilation error. But that's just a non-OO hack. I hope you will not choose to continue down that path.



I tried that and get a different error

Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Cannot make a static reference to the non-static method printAtlantic() from the type LeagueStats
10 years ago
Thanks Fred, I did what you suggested but now have a different error. I feel I am not properly using the static modifier somewhere but while I try different combinations I receive a variety of errors. I realize this probably isn't the best way to construct a formal project, but I just threw this together and am wondering what I'm doing wrong.

Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Cannot make a static reference to the non-static method printAtlantic() from the type LeagueStats



The following is my complete code for HockeyTeam.java which works, but I'm including it here if someone wants to try and compile the program themselves.

10 years ago
I have successfully created a class HockeyTeam.java that includes the method printTeamStats() to print out various stats of a hockey team that I build. So when I place the line "Penguins.printTeamStats();" at the end of this program it works. However, I'm having trouble with what seems like a simple task of building a method to print out the stats of the division, meaning just using printTeamStats() for each team in the division with a name like "printAtlanticStats()". I'm usually getting a "cannot be resolved" error.




Just to clarify I want something like the below to work but it doesn't.
10 years ago
Thanks for the response.

Unfortunately my degree is in philosophy which might sound pretty far off, but it includes math and logic courses and involves thinking in a manner much like a computer scientist. I'm mainly curious as to what a realistic timetable would look like. For example, after six months of full time study I would hope to achieve basic certifications and then I could look for internships or volunteer projects. After a year I think I would have enough to put my resume out there while continuing to build it. I think I could be hired between one and two years for an entry-level position. Is this completely unrealistic for someone who can devote 40 or more hours a week to it?
10 years ago
I am interested in pursuing a career in Java programming and am wondering what it realistically takes to be hired for an entry-level position. I have no work experience in java. My understanding of the language I believe is about equivalent to that of someone who finished their first college level Java course. I have the means to go back to school and obtain a second degree (in computer science), which would take me 2 years since my elective credits carry over, however I feel this option is still very time consuming, expensive, and since there are many different subjects in computer science besides just "Java" it might be missing the point anyway.

So the basic question is, how long would it take me to become employable for an entry-level position assuming I devote myself full time to learning, certification, and completing small projects to showcase abilities?

10 years ago