Skip to content

Commit 6239651

Browse files
committed
update FizzBuzz w/ @mattballin
1 parent cffb0c6 commit 6239651

4 files changed

Lines changed: 13 additions & 3 deletions

File tree

0 Bytes
Binary file not shown.

TeachingKidsProgramming/src/org/teachingkidsprogramming/section09final/FizzBuzz.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ public class FizzBuzz
55
// For the whole numbers from 1 to 100, print either that number, or,
66
// If that number is divisible by 3, then print the word 'Fizz',
77
// If that number is divisible by 5, then print the word 'Buzz',
8-
// If that number is divisible by either 3 or 5, then print the word 'FizzBuzz'
8+
// If that number is divisible by 3 and 5, then print the word 'FizzBuzz'
99
//
1010
// NOTE: this is a kata (higher level instructions)
1111
// part of the exercise is to translate into line-by-line English, THEN Java

TeachingKidsProgramming/src/org/teachingkidsprogramming/section09final/FizzBuzzGoldenMaster.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static String convert(int i)
2121
// For the whole numbers from 1 to 100, print either that number, or,
2222
// If that number is divisible by 3, then print the word 'Fizz',
2323
// If that number is divisible by 5, then print the word 'Buzz',
24-
// If that number is divisible by either 3 or 5, then print the word 'FizzBuzz'
24+
// If that number is divisible by 3 and 5, then print the word 'FizzBuzz'
2525
return "";
2626
}
2727
}
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
package org.teachingkidsprogramming.section09final;
22

3+
import static org.junit.Assert.assertEquals;
4+
5+
import org.junit.Test;
6+
37
public class FizzBuzzTDD
48
{
59
// For the numbers being tested, print out either that number, or,
610
// If that number is divisible by 3, then print the word 'Fizz',
711
// If that number is divisible by 5, then print the word 'Buzz',
8-
// If that number is divisible by either 3 or 5, then print the word 'FizzBuzz'
12+
// If that number is divisible by 3 and 5, then print the word 'FizzBuzz'
913
//
1014
// Write tests using the Assert object via the TDD style
1115
//
1216
// For more complete directions see this page
1317
// https://www.penflip.com/lynnlangit/tkp-lesson-plans/blob/master/course09.txt
18+
@Test
19+
public void test1Returns1()
20+
{
21+
//String result = FizzBuzzTDD.convert(1);
22+
assertEquals(1, 0);
23+
}
1424
}

0 commit comments

Comments
 (0)