Skip to main content

Timeline for Print a string with vertical words

Current License: CC BY-SA 3.0

9 events
when toggle format what by license comment
Feb 25, 2014 at 16:04 comment added daniero (untested) if(A[i][y]){B+=A[i][y];}else{B+=" ";} => B+=(x=A[i][y])?x:" "
Feb 21, 2014 at 16:43 comment added Florent Doesn't work for I love JavaScript
Feb 21, 2014 at 16:10 comment added Danny hello world, gave me hw\neo.
Feb 21, 2014 at 13:28 comment added manatwork Works correctly now. But some minor things: no need for variable N, store the array's length instead of asking it twice, some pointless braces, some unnecessary semicolons. A=prompt().split(" "),B="";for(y=0;y<(l=A.length);y++){for(i=0;i<l;i++)if(A[i][y])B+=A[i][y];else B+="_";B+="\n"}alert(B). (In the JavaScript Standards for IO meta question the mostly agreed opinion was that relying on REPL's implicit output should not be considered correct.)
Feb 21, 2014 at 13:11 comment added ˈvɔlə Fixed Bugs. Should work as expected :)
Feb 21, 2014 at 13:11 history edited ˈvɔlə CC BY-SA 3.0
deleted 12 characters in body
Feb 21, 2014 at 12:54 comment added mniip You should attempt to make your code as short as possible, for instance, remove spaces, also "Input ?" doesn't really affect the program's behaviour, remove it too.
Feb 21, 2014 at 12:54 comment added Foo Barrigno Its great for your first attempt!
Feb 21, 2014 at 12:53 history answered ˈvɔlə CC BY-SA 3.0