Skip to content

Commit eebe50a

Browse files
committed
Format
1 parent 1fd3f14 commit eebe50a

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

concepts/randomness/about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ Using the multiplication technique spreads out the bias over the entire range, s
5252
5353
[bias]: https://adammil.net/blog/v134_Efficiently_generating_random_numbers_without_bias.html
5454
~~~
55+
5556
## Generating random integers
5657

5758
To generate a random integer, you can use `Math.floor()` or `Math.ceil()` to turn a randomly generated number into an integer.
5859

59-
6060
[why-randomness-is-hard]: https://www.malwarebytes.com/blog/news/2013/09/in-computers-are-random-numbers-really-random
6161
[Math.random]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random

concepts/randomness/introduction.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,5 @@ getRandomInRange(4, 10);
3636

3737
To generate a random integer, you can use `Math.floor()` or `Math.ceil()` to turn a randomly generated number into an integer.
3838

39-
4039
[why-randomness-is-hard]: https://www.malwarebytes.com/blog/news/2013/09/in-computers-are-random-numbers-really-random
4140
[Math.random]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random

exercises/concept/captains-log/.docs/introduction.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Common, familiar examples include:
1010
- The creation of trees and bushes in a 3-D graphics simulation.
1111

1212
Generating truly random values with a computer is a [surprisingly difficult technical challenge][why-randomness-is-hard], which is why there are also "pseudorandom" generators.
13+
1314
<!-- prettier-ignore -->
1415
~~~exercism/caution
1516
The `Math.random()` function should NOT be used for security and cryptographic applications!
@@ -21,8 +22,5 @@ Finish the learning exercise(s) about this concept to learn more
2122
In Javascript, you can generate psuedorandom numbers using the [`Math.random()`][Math.random] function.
2223
It will return a psuedorandom floating-point number between 0 (inclusive), and 1 (exclusive).
2324

24-
25-
26-
2725
[why-randomness-is-hard]: https://www.malwarebytes.com/blog/news/2013/09/in-computers-are-random-numbers-really-random
2826
[Math.random]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random

exercises/concept/captains-log/.meta/exemplar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ export function randomStardate() {
1919
}
2020

2121
const PLANET_CLASSES = 'DHJKLMNRTY';
22-
22+
2323
/**
2424
* Generates a random planet class.
2525
*
2626
* @returns {string} a one-letter planet class.
2727
*/
2828
export function randomPlanetClass() {
29-
return PLANET_CLASSES[Math.floor(Math.random() * PLANET_CLASSES.length)];
29+
return PLANET_CLASSES[Math.floor(Math.random() * PLANET_CLASSES.length)];
3030
}

0 commit comments

Comments
 (0)