Skip to content

Commit

Permalink
Update square-root description.md (#2495)
Browse files Browse the repository at this point in the history
* Update description.md

Moving generally applicable information from the Python specific addendum as per https://forum.exercism.org/t/moving-generic-instructions-from-python-addendum-to-overall-problem-specification/13678/1 and https://forum.exercism.org/t/square-root-exercise-instructions-could-be-clearer/13664/11

See also https://github.com/exercism/python/pull/3815/files

* Update description.md

Include text suggested by tasx in the discussion at https://forum.exercism.org/t/moving-generic-instructions-from-python-addendum-to-overall-problem-specification/13678/7

* Update description.md

Incorporate changes workshopped in the discussion at https://forum.exercism.org/t/moving-generic-instructions-from-python-addendum-to-overall-problem-specification/13678

* Update description.md

Comply with markdown style guide for bullet lists

* One line per sentence and don't use the word "function"

* Split description into introduction and instructions

* Update exercises/square-root/introduction.md

Co-authored-by: Isaac Good <[email protected]>

* Update exercises/square-root/instructions.md

Co-authored-by: Isaac Good <[email protected]>

* Update exercises/square-root/instructions.md

Co-authored-by: Isaac Good <[email protected]>

* Terminate sentences with periods.

* Rephrase introduction.

* Update exercises/square-root/instructions.md

Co-authored-by: Victor Goff <[email protected]>

* Update exercises/square-root/introduction.md

Co-authored-by: Victor Goff <[email protected]>

* Further wording changes

* Simplify introduction

* Replace "output" with "return"

* Remove Wikipedia links

* Revert "Remove Wikipedia links"

This reverts commit b18c2a2.

* Update exercises/square-root/instructions.md

Co-authored-by: Anastasios Chatzialexiou <[email protected]>

* Update exercises/square-root/introduction.md

Co-authored-by: Anastasios Chatzialexiou <[email protected]>

* Clarify requirements

* Remove "directly"

---------

Co-authored-by: Isaac Good <[email protected]>
Co-authored-by: Victor Goff <[email protected]>
Co-authored-by: Anastasios Chatzialexiou <[email protected]>
  • Loading branch information
4 people authored Nov 7, 2024
1 parent 0bc4985 commit 0e138d7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 13 deletions.
13 changes: 0 additions & 13 deletions exercises/square-root/description.md

This file was deleted.

18 changes: 18 additions & 0 deletions exercises/square-root/instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Instructions

Your task is to calculate the square root of a given number.

- Try to avoid using the pre-existing math libraries of your language.
- As input you'll be given a positive whole number, i.e. 1, 2, 3, 4…
- You are only required to handle cases where the result is a positive whole number.

Some potential approaches:

- Linear or binary search for a number that gives the input number when squared.
- Successive approximation using Newton's or Heron's method.
- Calculating one digit at a time or one bit at a time.

You can check out the Wikipedia pages on [integer square root][integer-square-root] and [methods of computing square roots][computing-square-roots] to help with choosing a method of calculation.

[integer-square-root]: https://en.wikipedia.org/wiki/Integer_square_root
[computing-square-roots]: https://en.wikipedia.org/wiki/Methods_of_computing_square_roots
10 changes: 10 additions & 0 deletions exercises/square-root/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Introduction

We are launching a deep space exploration rocket and we need a way to make sure the navigation system stays on target.

As the first step in our calculation, we take a target number and find its square root (that is, the number that when multiplied by itself equals the target number).

The journey will be very long.
To make the batteries last as long as possible, we had to make our rocket's onboard computer very power efficient.
Unfortunately that means that we can't rely on fancy math libraries and functions, as they use more power.
Instead we want to implement our own square root calculation.

0 comments on commit 0e138d7

Please sign in to comment.