+ 2
[ algorithm CHALLENGE ] : big text cross
Implement a simple algorithm to write a variable sized cross to the screen. Size is entered by the user and must be an odd number. It would be nice if your program gives error messages when the input is not a number or if the number is even. The odd size specifies the width and height of your cross, so it basically is built up of characters X to make a line and spaces as fill up. The examples below are a bit weird as this page doesn't have a fixed width font. Examples: - size 3: X X X X X - size 9: X X X X X X X X X X X X X X X X X - size 4: Error: it seems that '4' is not an odd number - size A: Error: it seems that 'A' is not an integer
4 Answers
+ 6
https://code.sololearn.com/cYXb3YQFdzZl/?ref=app
0
This is my version in Python:
https://code.sololearn.com/cMx6ABF2CY9X/?ref=app
And C:
https://code.sololearn.com/cx2hMRMHcn7E/?ref=app