Simple Poker Game in C++

I started studying C++ and Object Oriented Programming recently, so I decide to create a small poker game, Texas Hold’em style. It took me three days and 670 lines of code, which I don’t think is too bad given it simulates a complete poker game for one human player against 5 computer players. The fact […]

A Better Poker Hand Evaluator in C++

Still working on my poker game simulation, and now I got to the hand evaluation part. I had written a small C program to do it a while ago, but taking a look at it now, well, all I can say is it was pretty awful. I didn’t sort the cards on that program, so […]

Using the Built-in Sort and Search Functions in C++

Being able to implement your own versions of quicksort (as well as other sorts that might be suitable for the occasion) and binary search algorithms is important (you can check my own implementations here). However, when you are participating in programming contests and challenges the last thing you want to worry about is whether or […]

CodeSprint 2 Problem: Permutations

This problem appeared on the Code Sprint 2 competition by InterviewStreet.com (check out my review here). Given n, print a permutation(p) of (0,1,2…n-1). From the permutation p, you can create n-1 (x,y) coordinates, where x and y are consecutive pairs in the permutation. You are also given the n x n square matrix V. For […]

CodeSprint 2 Problem: Picking Cards

This problem appeared on the Code Sprint 2 competition by InterviewStreet.com (check out my review here). There are N cards on the table and each has a number between 0 and N. Let us denote the number on the ith card by ci. You want to pick up all the cards. The ith card can […]

Make Sure to Participate on the Next Code Sprint

This weekend I took part on Code Sprint 2, a programming competition organized by the folks at InterviewStreet.com. The whole contest was very well organized. What I liked was the fact that you could follow a live leaderboard with the rankings of all participants, and the problems were well structured and explained. They were pretty […]