Paul Peterson wrote:It prints the card value correctly put prints a '?' instead of the suit. the full source code for the version that prints correctly and the one that does not can be found in my github repository. The original blackjack is the java object oriented concepts and the current version is under BJack.
Also, is there a standard way to order the methods used in a program? Sometimes it gets a little difficult to find methods going through the code. I know there is a glitch in the payout following each hand, and am working on that too. I know I can track that one down, but could really use a fresh pair of eyes on this problem.
All things are lawful, but not all things are profitable.
Knute Snortum wrote:I ran the code from your GitHub in a command prompt window on Windows 10 and I saw question marks instead of the suit symbols.
Question: would you find a code review of your GitHub BJack project helpful?
Paul Clapham wrote:... it would be far more preferable if you could post an SSCCE which exhibits the problem, but if it's an environment thing like that then looking at the code could well be unhelpful anyway. Would it be fair to say that the characters you're using for the suits are non-ASCII characters?...
Campbell Ritchie wrote:
Please confirm that get two methods in the card class don't return numbers. I think you wouldn't get ? printed if they did return numbers.
Knute Snortum wrote:When a word has little dots underneath it, that means it's a link.
Junilu Lacar wrote:And how is it off, exactly? Check line 10 and see if that's really how many times you want to repeat the character.
Paul Peterson wrote:Line 10 repeats 12 times and the others 15 because the character width of the suit is wider than the standard characters.
Junilu Lacar wrote:... Your reasoning still does not justify hard-coding the value 15 all over the place. That's just plain poor coding style. The console also normally uses a fixed-width font.
Paul Peterson wrote:If you looked ad the actual source code for the project you will notice that your suggestion is how I write most of my code.
Paul Peterson wrote:This keeps getting stranger. When I run it in NetBeans, the output looks like this
Knute Snortum wrote:Gold stars for:
BlackJackApp.java only launches the program A test suite A Console class that takes care of all the screen writing
Paul Clapham wrote:Short answer: Because your console is unable to render those Unicode characters.
Long answer: First of all, I'm going to assume your command line is a Windows command line. So go to the command line and execute the "chcp" command. (When I do that it tells me that my code page is 850.) Now google for that code page and you'll find the Wikipedia article about it. That article will tell you which 256 characters are supported, and you won't find your suit characters among them.
Paul Clapham wrote:Well, if you're really interested in what's going on then we can continue. But it doesn't seem like you are. I've indirectly asked you twice now about what environment you're running the code in but I'm not getting any answers. Perhaps indirect questions aren't a good approach? Let's try the direct question: Where does the console come from for these projects?
All things are lawful, but not all things are profitable.
Paul Peterson wrote: What areas need improvement? I know there is a bug handling the payout and am working on that. What other areas need work?
All things are lawful, but not all things are profitable.
Knute Snortum wrote:When you say "it worked," do you mean it displayed correctly in a Windows command window?
That is because NetBeans runs in Java® and doesn't have the restrictions which the Windows® command line has. I am using Linux at present and that would have no such restrictions.Paul Peterson wrote:. . . It displayed correctly in the NetBeans output window, still displaying ? in the command window.
It seems to make no difference whether I write \u2661 or \\u2661.My Computer, using Bash, wrote:[critchie@campbellsComputer ~]$ printf "\\u2666"
♦[critchie@campbellsComputer ~]$ printf "\\u2660"
♠[critchie@campbellsComputer ~]$ printf "\\u2661"
♡
CAUTION! Do not touch the blades on your neck propeller while they are active. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|