mirror of https://github.com/01-edu/public.git
docs(cytale_cipher) correct grammar
This commit is contained in:
parent
ea708717c5
commit
ad7c443467
|
@ -2,49 +2,38 @@
|
|||
|
||||
### Instructions
|
||||
|
||||
Create a function called `scytale_cipher` that takes a `string` and an `integer` and returns a `string`.
|
||||
This function should create a scytale cipher also known as spartan cipher. In practice its a cylinder with a
|
||||
strip strapped around it on which is written a message, when removed the strip the message is coded.
|
||||
Depending on the size of the cylinder the message would change. So the only way to decipher the coded message is
|
||||
by using a cylinder of the same size.
|
||||
Create a **function** which creates a scytale cipher (also known as spartan cipher).
|
||||
|
||||
You function should recreate the scytale cipher, the string being the message and the size being the number of
|
||||
straps in the cylinder.
|
||||
In practice, it is represented by a strip wrapped around a cylinder. The message is written across the loops of the strip (not along the strip). The message becomes *coded* if the radius of the cylinder changes, or the strip is removed from the cylinder.
|
||||
|
||||
Your function should recreate the scytale cipher, so that the `String` represents the message, and the `u32` represents the number of times the strip is wrapped around the cylinder.
|
||||
|
||||
### Example
|
||||
|
||||
message : "scytale Code"
|
||||
size : 6
|
||||
**size 6:** `"scytale Code"` -> `"sec yCtoadle"`
|
||||
|
||||
```console
|
||||
['s', 'e']
|
||||
['c', ' ']
|
||||
['y', 'C']
|
||||
['t', 'o']
|
||||
['a', 'd']
|
||||
['l', 'e']
|
||||
--------------------------------
|
||||
|s| |c| |y| |t| |a| |l|
|
||||
|e| | | |C| |o| |d| |e|
|
||||
--------------------------------
|
||||
```
|
||||
|
||||
output : sec yCtoadle
|
||||
size : 8
|
||||
**size 8:** `"scytale Code"` -> `"sCcoydtea l e"`
|
||||
|
||||
|
||||
```console
|
||||
['s', 'C']
|
||||
['c', 'o']
|
||||
['y', 'd']
|
||||
['t', 'e']
|
||||
['a', ' ']
|
||||
['l', ' ']
|
||||
['e', ' ']
|
||||
[' ', ' ']
|
||||
------------------------------------------
|
||||
|s| |c| |y| |t| |a| |l| |e| | |
|
||||
|C| |o| |d| |e| | | | | | | | |
|
||||
------------------------------------------
|
||||
```
|
||||
|
||||
output : sCcoydtea l e
|
||||
|
||||
### Expected Functions
|
||||
|
||||
```rust
|
||||
fn scytale_cipher(message: String, i: u32) -> String {}
|
||||
fn scytale_cipher(message: String, i: u32) -> String {
|
||||
}
|
||||
```
|
||||
|
||||
### Usage
|
||||
|
|
Loading…
Reference in New Issue