Groovy web console

subscribe to the feed Subscribe
to this
site

Nyi

Published 3 weeks ago by Nyi with tags Nyyyyi
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def field= 1049088

def binary = new Boolean[31];
int maskBit=1;

for(int i=0; i<32; i++) {
    print("  " + i); 
}

println()

for(int i=0; i<32; i++) {
    if(i > 9) {
        print(" ")
    }
    print("  "+ (((field & maskBit) == 0) ? 0 : 1));   

    maskBit*=2;         
}