• Post Reply Bookmark Topic Watch Topic
  • New Topic

rectangle with numbers  RSS feed

 
Nika Abcd
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need some help with a problem...actualy with several of them...
I want to write a method which would give us a rectangle with numbers. The input is an integer which represents the length of a line in rectangle and the result type is void. The example for n=4 is:
3210
0321
1032
2103

Any suggestions?
 
Joanne Neal
Rancher
Posts: 3742
16
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nika Abcd wrote:Any suggestions?

Turn off your computer.
Take a piece of paper (or several) and a pencil and write down in English (or your own native language) the steps you would follow to solve this problem.
Keep simplifying each of the steps until it's simple enough for a 6 year old to understand.
Turn your computer back on.
Write the code based on your description.
Only write a few lines of code at a time - don't write more lines of code until the code you have written compiles and does what it is supposed to (i.e. test, test, test).
If you have any problems with the coding part, come back here, post the code you've written and describe what the problem is.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!