online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
/****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl, C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog. Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ import java.util.Scanner; public class Main { public static void main(String[] args) { Board b = new Board(10, 10); b.print(); b.put(new SelectLine()); System.out.println("Hello World"); } } class Board { char[][] grid; int width; int height; int count; char player; public Board(int height, int width){ count = 0; grid = new char[height][width]; this.width = width; this.height = height; for(int i = 0; i < height; i++) { for(int j = 0; j < width; j++){ if(i == 0 && j == 0){ grid[i][j] = '┌'; } else if(j % 2 == 1) { grid[i][j] = '─'; } else if (i == 0 && j == width - 1){ grid[i][j] = '┐'; } else if (i == height-1 && j == 0){ grid[i][j] = '└'; } else if (i == height - 1 && j == width - 1){ grid[i][j] = '┘'; } else if (i == 0){ grid[i][j] = '┬'; } else if (j == 0){ grid[i][j] = '├'; } else if (i == height - 1){ grid[i][j] = '┴'; } else if (j == width - 1){ grid[i][j] = '┤'; } else grid[i][j] = '┼'; } } } public void print(){ for(int i=0; i<height; i++){ for(int j=0; j<width; j++) System.out.print(grid[i][j]); System.out.println(); } } public void put(SelectLine setLine) { int y=setLine.getY(); int x = grid.length-1; if(count%2 == 0) { player = '●'; } else { player = '○'; } for(int i = grid.length-1; i >=0; i--) { if(grid[i][(y-1)*2] != player) { grid[i][(y-1)*2] = player; count++; break; } } System.out.println("────────" + player + "'s Turn ────────"); this.print(); } } class SelectLine { int line; public int input(){ System.out.print("Select Line : "); Scanner sc = new Scanner(System.in); line = sc.nextInt(); return line; } public int getY(){ return input(); } }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue