Skip to main content

Timeline for Draw some mountain peaks

Current License: CC BY-SA 3.0

2 events
when toggle format what by license comment
Nov 7, 2016 at 13:55 comment added Kevin Cruijssen Nice answer, +1. You can golf it by 2 bytes though: n%2 to n--%2, and both --n to n. EDIT: And 1 more by adding ,x=s+"\n" and changing both s+"\n" to x. (So in total: String f(int n,String s){String l="",x=s+"\n";for(int i=1;i++<n;l+=" ");return n>1?n--%2<1?l+x+f(n,s+" \\"):l+x+f(n,"/ "+s):s;} 127 bytes)
Nov 5, 2016 at 17:45 history answered Numberknot CC BY-SA 3.0