bleach64
bleach64

Reputation: 107

How to continuously Increment & Decrement with (+1) & (-1) in iOS calculator without the Button "="

First sorry for my poor English.

I am creating a basic iOS calculator for iPhone 6, since I am a beginner for iPhone development. Everything is working fine, addition, subtraction etc. Now I want to make this calculator app for black jack card counting.

But my question is: Q) Is it possible to continuously calculate add +1 to the value without the "=" button? That is I want to continuously add +1 when I press (Low +1) button and subtract -1 when I press (High -1) button?

Please give me some suggestion. And Sorry again for my poor English.

Upvotes: 0

Views: 521

Answers (1)

paxdiablo
paxdiablo

Reputation: 882028

Well, one suggestion would be to provide a up and down button (or increment and decrement or whatever else you might call them) which simply added or subtracted one from the current display value.

Depending on how your code is structured, this could be as simple as something like:

case INCR_BTN:
    setDisplay (getDisplay() + 1);
    break;
case DECR_BTN:
    setDisplay (getDisplay() - 1);
    break;

(in C, but similar enough to ObjC that it'll help out).

But keep in mind I don't think many of the casinos are going to let you sit at their Blackjack tables messing about with your iPhone :-) The best card counters are the ones that do it in their head but, even then, if you seem to be winning too much, they'll start cutting the shoe earlier to remove any advantage counting may give you.

Upvotes: 1

Related Questions