DEV Community

Discussion on: Daily Challenge #193 - What's the Real Floor?

Collapse
 
madstk1 profile image
Natamo

C#

Same as @savagepixie , not sure about negative superstitions, though I opted not to include it.

static int getRealFloor(int floor) {
    if(floor >  0 ) { floor--; }
    if(floor >= 13) { floor--; }
    return floor;
}