Skip to content

Commit 04990f0

Browse files
Sync the all-your-base exercise's docs with the latest data. (#818)
1 parent c175775 commit 04990f0

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

exercises/practice/all-your-base/.docs/instructions.md

+8-13
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,27 @@
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.
6-
Given a number in base **a**, represented as a sequence of digits, convert it to base **b**.
7-
8-
## Note
9-
10-
- Try to implement the conversion yourself.
11-
Do not use something else to perform the conversion for you.
5+
~~~~exercism/note
6+
Try to implement the conversion yourself.
7+
Do not use something else to perform the conversion for you.
8+
~~~~
129

1310
## About [Positional Notation][positional-notation]
1411

1512
In positional notation, a number in base **b** can be understood as a linear combination of powers of **b**.
1613

1714
The number 42, _in base 10_, means:
1815

19-
`(4 * 10^1) + (2 * 10^0)`
16+
`(4 × 10¹) + (2 × 10)`
2017

2118
The number 101010, _in base 2_, means:
2219

23-
`(1 * 2^5) + (0 * 2^4) + (1 * 2^3) + (0 * 2^2) + (1 * 2^1) + (0 * 2^0)`
20+
`(1 × 2⁵) + (0 × 2⁴) + (1 × 2³) + (0 × 2²) + (1 × 2¹) + (0 × 2⁰)`
2421

2522
The number 1120, _in base 3_, means:
2623

27-
`(1 * 3^3) + (1 * 3^2) + (2 * 3^1) + (0 * 3^0)`
28-
29-
I think you got the idea!
24+
`(1 × 3³) + (1 × 3²) + (2 × 3¹) + (0 × 3⁰)`
3025

3126
_Yes. Those three numbers above are exactly the same. Congratulations!_
3227

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)