Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 216feca

Browse files
Tidied file names, added some examples to readme
1 parent 29f6abd commit 216feca

10 files changed

+36
-3
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎README.md

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,46 @@ A standard "Hello World" program.
1919
Prints the current time to the screen.
2020

2121
**3. FizzBuzz**
22-
This program outputs all numbers 1 - 100 inclusive. If a number is divisible by 3, "Fizz" is printed instead of the number. The same goes for multiples of 5, except "Buzz" is printed. If a number is a multiple of both 3 and 5, the output is "FizzBuzz".
22+
This program outputs all numbers 1 - 100 inclusive. If a number is divisible by 3, "Fizz" is printed instead of the number. The same goes for multiples of 5, except "Buzz" is printed. If a number is a multiple of both 3 and 5, the output is "FizzBuzz". For example:
23+
```
24+
1
25+
2
26+
Fizz
27+
4
28+
Buzz
29+
Fizz
30+
7
31+
8
32+
Fizz
33+
Buzz
34+
11
35+
Fizz
36+
13
37+
14
38+
FizzBuzz
39+
```
2340

2441
**4. Factorial**
25-
The user enteres a number. The factorial of that number is calculated by multiplying it by every number preceding it and the result is printed to the screen.
42+
The user enters a number. The factorial of that number is calculated by multiplying it by every number preceding it and the result is printed to the screen. For example, `5! = 5 x 4 x 3 x 2 x 1 = 120`. The program also calculates the sum of the digits in the answer, i.e. `120 = 1 +たす 2 +たす 0 = 3`.
2643

2744
**5. Guessing Game**
28-
The program generates a random number for the user to guess. The program tells the user if their guess was too high or too low, and tells them how many tries it took them when they get the number right. The program does not count multiple guesses of the same number.
45+
The program generates a random number for the user to guess. The program tells the user if their guess was too high or too low, and tells them how many tries it took them when they get the number right. The program does not count multiple guesses of the same number. Below is an example of one game, notice how 33 was guessed twice but only counted as a try once.
46+
```
47+
Guess a number between 1 and 50.
48+
Your guess: 25
49+
Too low, try again.
50+
38
51+
Too high, try again.
52+
33
53+
Too low, try again.
54+
33
55+
Too low, try again.
56+
35
57+
Too low, try again.
58+
36
59+
You're right!
60+
It took you 5 tries.
61+
```
2962

3063
**6. Smallest and Largest in a List**
3164
The user enters a list of 5 numbers, and the program calculates and prints the smallest and largest numbers in the list.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /