mirror of https://github.com/01-edu/public.git
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.
23 lines
723 B
23 lines
723 B
5 years ago
|
## printchessboard
|
||
|
|
||
|
### Instructions
|
||
|
|
||
5 years ago
|
Write a program that takes two integers as arguments and displays the chess desk, in which white cells are represented by `' '` and black cells by `'#'`.
|
||
5 years ago
|
|
||
5 years ago
|
- If the number of arguments is different from 2, or if the argument is not a positive number, the program displays `Error` followed by a newline (`'\n'`).
|
||
5 years ago
|
|
||
|
### Usage
|
||
|
|
||
|
```console
|
||
|
student@ubuntu:~/[[ROOT]]/printchessboard$ go build
|
||
|
student@ubuntu:~/[[ROOT]]/printchessboard$ ./printchessboard 4 3 | cat -e
|
||
|
# # $
|
||
|
# #$
|
||
|
# # $
|
||
|
student@ubuntu:~/[[ROOT]]/printchessboard$ ./printchessboard 7 | cat -e
|
||
|
Error$
|
||
![]()
5 years ago
|
student@ubuntu:~/[[ROOT]]/printchessboard$ ./printchessboard 0 0 | cat -e
|
||
|
Error$
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/printchessboard$
|
||
|
```
|