ASCII Triangle Ripple
GNU sed -nr, 210
A start:
s/1/__/g
p
s#_(.*)_#\\\1/#
s#\\__#\\ #
s#__/# /#
ta
:a
p
s#(.*) _{6}(_*) # \1\\ \2 /#;ta
s#(.*) ( )# \1\2#;
s#(.*) _(_*)_ # \1\\\2/#
y/_/ /
Tc
:b
p
:c
s#(.*)((\\) ( *)(/)|()()()\\/)# \1\3\4\5#;tb
Input is a positive unary integer via STDIN, as per this meta-question.
Output:
$ for i in 1 11 111 1111 11111 111111 1111111; do sed -rnf triripple.sed <<< $i; done
__
\/
____
\ /
\/
______
\ /
\ /
\/
________
\ __ /
\ \/ /
\ /
\/
__________
\ ____ /
\ \ / /
\ \/ /
\ /
\/
____________
\ ______ /
\ \ / /
\ \ / /
\ \/ /
\ /
\/
______________
\ ________ /
\ \ __ / /
\ \ \/ / /
\ \ / /
\ \/ /
\ /
\/
$
Pyth, 31 bytes
VhQ+J<t+++*Nd*N"\ "d*Q\_Q_XJ"\/
Demonstration.
Explanation:
VhQ+J<t+++*Nd*N"\ "d*Q\_Q_XJ"\/
Implicit: Q = eval(input()), d = ' '
VhQ for N in range(Q + 1):
Concatenate:
*Nd N spaces
+ *N"\ " N of the string "\ "
+ d another space
+ *Q\_ Q of the string "_"
If N = 2 and Q = 7, the string so far is:
" \ \ _______" and we want
" \ \ _" as the left half.
t Remove the first character.
< Q Take the first Q characters remaining.
This is the left half of the triangle ripple.
J Store it in J.
XJ"\/ Translate \ to / in J.
_ Reverse it.
+ Concatenate the left and right halves and print.
C, 165 bytes
n,x,y,b,c;main(c,v)char**v;{for(n=atoi(v[1]);y<=n;++y){for(x=-n;x<n;++x){b=2*n-abs(2*x+1);c=b-2*y+2;b-=6*y;putchar(b>0?95:b<-4&c>0&c%4==1?"/\\"[x<0]:32);}puts("");}}
Before the golfing steps that destroy readability:
#include <stdio.h>
#include <stdlib.h>
int main(int c, char** v) {
int n = atoi(v[1]);
for (int y = 0; y <= n; ++y) {
for (int x = -n; x < n; ++x) {
int b = 2 * n - abs(2 * x + 1);
int c = b - 2 * y + 2;
b -= 6 * y;
putchar(b > 0 ? 95 :
b < -4 && c > 0 && c % 4 == 1 ? "/\\"[x<0] : 32);
}
puts("");
}
}
This loops over all characters in the rectangle containing the figure, and evaluates the line equations that separate the inside of the triangle from the outside, as well as the ones that separate the different parts of the triangle.