Skip to content

Commit 85ff8ad

Browse files
Sync the all-your-base exercise's docs with the latest data. (#118)
1 parent 34fbb34 commit 85ff8ad

File tree

2 files changed

+23
-19
lines changed

2 files changed

+23
-19
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,28 @@
11
# Instructions
22

3-
Convert a number, represented as a sequence of digits in one base, to any other base.
3+
Convert a sequence of digits in one base, representing a number, into a sequence of digits in another base, representing the same number.
44

5-
Implement general base conversion. Given a number in base **a**,
6-
represented as a sequence of digits, convert it to base **b**.
5+
~~~~exercism/note
6+
Try to implement the conversion yourself.
7+
Do not use something else to perform the conversion for you.
8+
~~~~
79

8-
## Note
10+
## About [Positional Notation][positional-notation]
911

10-
- Try to implement the conversion yourself.
11-
Do not use something else to perform the conversion for you.
12+
In positional notation, a number in base **b** can be understood as a linear combination of powers of **b**.
1213

13-
## About [Positional Notation](https://en.wikipedia.org/wiki/Positional_notation)
14+
The number 42, _in base 10_, means:
1415

15-
In positional notation, a number in base **b** can be understood as a linear
16-
combination of powers of **b**.
16+
`(4 × 10¹) + (2 × 10⁰)`
1717

18-
The number 42, *in base 10*, means:
18+
The number 101010, _in base 2_, means:
1919

20-
(4 \* 10^1) + (2 \* 10^0)
20+
`(1 × 2⁵) + (0 × 2⁴) + (1 × 2³) + (0 × 2²) + (1 × 2¹) + (0 × 2⁰)`
2121

22-
The number 101010, *in base 2*, means:
22+
The number 1120, _in base 3_, means:
2323

24-
(1 \* 2^5) + (0 \* 2^4) + (1 \* 2^3) + (0 \* 2^2) + (1 \* 2^1) + (0 \* 2^0)
24+
`(1 × 3³) + (1 × 3²) + (2 × 3¹) + (0 × 3⁰)`
2525

26-
The number 1120, *in base 3*, means:
26+
_Yes. Those three numbers above are exactly the same. Congratulations!_
2727

28-
(1 \* 3^3) + (1 \* 3^2) + (2 \* 3^1) + (0 \* 3^0)
29-
30-
I think you got the idea!
31-
32-
*Yes. Those three numbers above are exactly the same. Congratulations!*
28+
[positional-notation]: https://en.wikipedia.org/wiki/Positional_notation
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Introduction
2+
3+
You've just been hired as professor of mathematics.
4+
Your first week went well, but something is off in your second week.
5+
The problem is that every answer given by your students is wrong!
6+
Luckily, your math skills have allowed you to identify the problem: the student answers _are_ correct, but they're all in base 2 (binary)!
7+
Amazingly, it turns out that each week, the students use a different base.
8+
To help you quickly verify the student answers, you'll be building a tool to translate between bases.

0 commit comments

Comments
 (0)