- Code Golf Hole Three - Number Flipper
- 29 Jun 2019 07:27:13 am Permalink
- Last edited by LogicalJoe on 04 Jul 2019 03:29:20 pm; edited 8 times in total

LJ Open: The Third Hole - Number Flipper

This program should take a number in Ans and return the "flipped" number in Ans. Because this program does not output anything during execution, it is an "invisible" program. The program should physically flip the number upside down, i.e. 6->9 8->8 60->09. I deem only 0 6 8 9 flippable digits, so if a unflippable number is given, simply return 0 (see examples below) leading and ending zeros can be ignored due to the nature of flipping numbers. Input is assumed to be a positive integer or zero (Whole Numbers).

Examples of usage:

PT_ requested no example code, so I'll leave it up to everyone else to create their own example code.

Size: The program's size is measured as:

The poll will be open for a week. I will post my solution as soon as someone beats it or about a week has passed. Good luck!

Current Results: where invalid inputs -> 0

lirtosiast: 38 (with error on invalid)

lirtosiast: 45

kg583: 51

LogicalJoe: 56

Alternate Results: where invalid inputs -> unknown outputs

lirtosiast: 30

PT: 33 (with imaginary output)

LogicalJoe: 42

PT: 42

kg583: 43

This program should take a number in Ans and return the "flipped" number in Ans. Because this program does not output anything during execution, it is an "invisible" program. The program should physically flip the number upside down, i.e. 6->9 8->8 60->09. I deem only 0 6 8 9 flippable digits, so if a unflippable number is given, simply return 0 (see examples below) leading and ending zeros can be ignored due to the nature of flipping numbers. Input is assumed to be a positive integer or zero (Whole Numbers).

Examples of usage:

**Code:**```
980:prgmF[:Ans]
```

86

106:prgmF[:Ans]

0 // due to 106 being an unflippable number

9068906:prgmF[:Ans]

9068906

PT_ requested no example code, so I'll leave it up to everyone else to create their own example code.

**Restrictions wrote:**

Restricted tokens: prgm

(input/output) Ans must be a positive integer or zero (Whole Numbers)

(input/output) Ans must be a positive integer or zero (Whole Numbers)

Size: The program's size is measured as:

**Code:**`on-calc-size - 9 - length(name)`

The poll will be open for a week. I will post my solution as soon as someone beats it or about a week has passed. Good luck!

Current Results: where invalid inputs -> 0

lirtosiast: 38 (with error on invalid)

lirtosiast: 45

kg583: 51

LogicalJoe: 56

Alternate Results: where invalid inputs -> unknown outputs

lirtosiast: 30

PT: 33 (with imaginary output)

LogicalJoe: 42

PT: 42

kg583: 43