-
Notifications
You must be signed in to change notification settings - Fork 0
FooBar
Anthony Lawrence edited this page Mar 11, 2018
·
2 revisions
An individual training exercise (in Karate or other martial art)
- If a number is divisible by 2, "Foo" should be output.
- If a number is divisible by 5, "Bar" should be output.
- If a number is divisible by 2 and 5 (or 10), "FooBar" should be output.
- If a number is not divisible by these numbers, the number should be output.
- Singles:
- 1 => 1
- 2 => Foo
- 3 => 3
- 4 => Foo
- 5 => Bar
- 10 => FooBar
- Sequences:
- 1, 5 => 1, Foo, 3, Foo, Bar
- 10, 15 => Foo, 11, Foo, 13, Foo, FooBar