I have to create the following functions (to a command-line casino in Matlab):
function [wonAmount, noGuesses] = highLow(gambledAmount)
function [wonAmount, noPulls] = slotMachine(gambledAmount, betFactor)
function wonAmount = roulette(gambledAmount, typeOfBet)
This is a matter of the task I'm given, and it has to be fulfilled. I could just create simple functions, since all the games have some similar characteristics, calculation of wonAmount, etc. and generally that OOP is more structured, I would like to try it (OOP) out in Matlab.
I could create a handle class, but I have to fulfill the requirements of the task. Which a handle class with a method play - I am of the understanding that a handle class constructor HAS to return the object itself? I am looking for a class in which the constructor doesn't necessarily return the constructor - a static class/function of a kind?
How would you design this class?