online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <stdint.h> #include <iostream> int main() { // This is our bit mask with the 31 bit set to '1' for initial state uint64_t state = 1u << 31; for (int i = 0 ; i < 32 ; i++) { for (int j = sizeof(uint64_t) * 8 - 1; j >= 0; j--) { // Here we decide what should be the color of the current cell based on the current state bit mask. // Bitwise operator is used to accomplish this efficiently std::cout << char(state >> j & 1 ? '1' : '-'); } std::cout << '\n'; // This is just the (left, current, right) -> left XOR (current OR right) functioned mentioned previously // Bitwise operators are used to accomplish this efficiently state = (state >> 1) ^ (state | state << 1); } }

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