Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Two O's, then four O's, then two O's again?

Name: Bob (Twin Peaks) 2014-11-14 2:58

This for loop prints: XOOOOXOOOOXOOOOXOOOO

for(int i=1;i<=4;i++){
System.out.print("X");
for(int j=1;j<=4;j++){
System.out.print("O");
}
}

Using ONLY "for" (no if, while, etc.), print statements, and modifying the logic of the loops, how can I make the loops print:

XOOXOOOOXOOOOXOO

Where the O's after the first and last X's are HALF the amount of O's printed between the inner X's?

Name: Anonymous 2014-11-14 22:09

>>16
"oh look at me >>> I'm haskal >>> I can $ do flip take"

list(2,4,4,2) map(o, "X" .. "O" repeated(o)) join println

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List