Browse Source

Merge pull request #793 from 01-edu/printmemory_change

printmemory Change exercise
content-update
xpetit 3 years ago committed by GitHub
parent
commit
e111fe5719
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      subjects/printmemory/README.md

16
subjects/printmemory/README.md

@ -2,16 +2,16 @@
### Instructions
Write a function that takes `(arr [10]int)`, and displays the memory as in the example.
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 graphic characters. The non printable characters must be replaced by a dot.
After displaying the memory the function must display all the ASCII graphic characters. The non printable characters must be replaced by a dot.
A graphic character is any character intended to be written, printed, or otherwise displayed in a form that can be read by humans. In other words, it is any encoded character that is associated with one or more glyphs.
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.
### Expected function
```go
func PrintMemory(arr [10]int) {
func PrintMemory(arr [10]byte) {
}
```
@ -24,7 +24,7 @@ Here is a possible program to test your function :
package main
func main() {
PrintMemory([10]int{104, 101, 108, 108, 111, 16, 21, 42})
PrintMemory([10]byte{'h', 'e', 'l', 'l', 'o', 16, 21, '*'})
}
```
@ -32,9 +32,9 @@ And its output :
```console
$ go run . | cat -e
6800 0000 6500 0000 6c00 0000 6c00 0000 $
6f00 0000 1000 0000 1500 0000 2a00 0000 $
0000 0000 0000 0000 $
68 65 6c 6c$
6f 10 15 2a$
00 00$
hello..*..$
$
```

Loading…
Cancel
Save