I believe the example is a Straight instead?
Test 6 and 7 are the same (no actual problems, just saying).
I removed the extra (duplicate) test case that Albert mentioned.
How annoying of this one, is truly beyond my imagination...
@Bainhome, recently I read a discussion on Mathworks MATLAB Answers [https://www.mathworks.com/matlabcentral/answers/27340-what-do-you-think-of-cody-new-service-for-matlab-central]. According to the community member, Jan; "Cody players learn to use MATLAB inefficiently", hence, he would prefer the top ten Answers or FileExchange contributors to the top ten Cody contributors for a serious project. Clearly, problems such as Doug Hull's poker series and Grant's Scrabble series prove otherwise. So, even though, "all the sub-function were already solved in previous problem" as noted by you, bringing them together in an efficient manner might still be required. Infact, this is actually the case with the top scores. In summary, I think this particular problem is great for Cody players. :)
@J. S. Kowontan, I just read those information about the Jan's opinions on code MATLAB more effciently. and for this besthand problem, I think I missed something critical, THX for the heads up, later I will improved my lazy and horrible code. However, I only partially agree with Jan. size is no doubt a controverial topic, but people's learning skill, basic programming concept can be built either in cody's way or answer's way, or any other way, top ten is bit of drama queen stuff, but when we talked about who is the most suitable programme project charger, I can guarantee those guys like alfonso, Tim, you, yurenchu, Liupeng, LY Cao and my friend binbin are both qualified. as matter of fact and I know that for sure: lots of them already have their own project, and they seem doing just fine. My opinion is: people's mind can be shaped by "real world", envolved with demand.
Hum, Kowontan. I believe this series proves actually the opposite. Many of the functions in this series should have been used as a constructor of others. For instance the function isHighCard should have been used at the functions isQuads, isThreeKind and isTwopair. Moreover, this variable usedCards is completely useless since now at this problem we are replacing it with a number! This should have been done at the very beginning, since this number will define which hand wins. This choice of variables and sequence of problems unfortunately demonstrates poor design and programming choices. It's overall a good series, but not to teach people the right way to code.
And, bainhome, unfortunately, LY Cao used a hack to solve this problem, so it is not a very good example although he seems to be a good programmer. And probably everyone you mentioned already used hacking at Cody (some I know for sure, like Alfonso). Hacking is cool (and a great tool for learning or testing things), but it is not really a good programming practice.
When we want to teach someone, we don't show them a poor design, and ask them to do something a little better, we show them one of the best solutions/designs, and challenge them to do better. At the very least, if they can't, they will know one of the best ways to do it (knowledge they will use in real life).
it won't work properly if hm=[0 1 0 1 0 0 0 0 0 0 0 0 0; 0 1 0 1 0 0 0 0 0 0 0 0 0; 0 1 0 1 0 0 0 0 0 0 0 0 0; 0 0 0 0 0 0 0 0 0 0 0 0 0]; it says that it is a Three of a kind, but it is a Full House actually.
Thank you, @Yan_Orwat; I have repaired the solution.
All your base are belong to us
Back to basics 22 - Rotate a matrix
Getting the absolute index from a matrix
Implement Solitaire cipher for N long deck.
Project Euler: Problem 3, Largest prime factor
Poker Series 01: isStraightFlush
Steal, Share, or Catch
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office