online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
import numpy as np import time bit = 1 << np.arange(26,dtype=np.uint32) flags = np.zeros([7,7],dtype=np.uint32) grid = np.zeros([7,7],dtype=np.int32) preset = np.zeros(27,dtype=np.int32) solve_time = 0 def set_val(row,col,val): grid[row,col] = val preset[val] = (row<<3)|col flags[row-1:row+2,col-1:col+2] ^= bit[val] def fill_grid(val): if val < 3: if preset[val] != 0 : fill_grid(val + 1) else: for row in range(1,6): for col in range(1,6): if grid[row,col] == 0 : grid[row,col] = val flags[row-1:row+2,col-1:col+2] ^= bit[val] fill_grid(val + 1) flags[row-1:row+2,col-1:col+2] ^= bit[val] grid[row,col] = 0 return if preset[val] != 0 : row = preset[val] >> 3 col = preset[val] & 7 i = 1 while i + i < val : f = bit[i] | bit[val - i] if (flags[row, col] & f) == f: break i += 1 if i + i < val : fill_grid(val + 1) return if val == 26 : print(grid[1:6,1:6]) print(time.time()-start) return for row in range(1,6): for col in range(1,6): if grid[row,col] != 0: continue i = 1 while i + i < val : f = bit[i] | bit[val - i] if (flags[row,col] & f) == f : break i += 1; if i + i < val : grid[row,col] = val flags[row-1:row+2,col-1:col+2] ^= bit[val] fill_grid(val + 1) flags[row-1:row+2,col-1:col+2] ^= bit[val] grid[row,col] = 0 set_val(1,2,7) set_val(3,3,18) start=time.time() fill_grid(1) print(time.time()-start)

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