You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
778 B

## printmemory
### Instructions
3 years ago
Write a function that takes `(arr [10]byte)`, and displays the memory as in the example.
After displaying the memory the function must display all the ASCII graphic characters. The non printable characters must be replaced by a dot.
The ASCII graphic characters are any characters intended to be written, printed, or otherwise displayed in a form that can be read by humans, present on the ASCII encoding.
6 years ago
### Expected function
```go
3 years ago
func PrintMemory(arr [10]byte) {
6 years ago
}
```
6 years ago
### Usage
6 years ago
Here is a possible program to test your function :
```go
package main
func main() {
3 years ago
PrintMemory([10]byte{'h', 'e', 'l', 'l', 'o', 16, 21, '*'})
}
```
6 years ago
And its output :
```console
$ go run . | cat -e
68 65 6c 6c$
6f 10 15 2a$
00 00$
hello..*..$
$
6 years ago
```