fork download
  1. #include <stdio.h>
  2.  
  3. void print_board(char b[9], int depth){
  4. int i,j;
  5. for(i=1;i<=9;i++){
  6. if(i%3 == 1){
  7. for(j=1;j<=depth;j++){
  8. printf(" ");
  9. }
  10. }
  11.  
  12. if(b[i-1] == 8){
  13. printf(".");
  14. }
  15. else{
  16. printf("%d",b[i-1]);
  17. }
  18.  
  19. if(i%3 == 0){
  20. printf("\n");
  21. }
  22. }
  23. }
  24.  
  25. int main(void) {
  26. char board[9]={0,1,2,3,4,8,6,7,5};
  27. print_board(board,4);
  28. }
Success #stdin #stdout 0.01s 5268KB
stdin
Standard input is empty
stdout
    012
    34.
    675