Guest User

Untitled

a guest
Sep 23rd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. void logic()
  2. {
  3. cout << "What dimensions would you like for your board?\n" << "Width?";
  4. int width;
  5. int height;
  6. cin >> width;
  7. cout << "Height?";
  8. cin >> height;
  9.  
  10. int array[width][height];
  11. int x = 1, y = 1, widthcount = 0, heightcount =0, value = 0;
  12.  
  13. while (y + heightcount <= height)
  14. {
  15. while( x + widthcount <= width)
  16. {
  17. array[x][y] = 1 + value;
  18. cout << array[x][y];
  19. widthcount++;
  20. }
  21.  
  22. cout << endl;
  23. value++;
  24. heightcount++;
  25.  
  26. }
  27. }
Add Comment
Please, Sign In to add comment