Skip to main content
Commonmark migration
Source Link

#Haskell, 99 bytes

Haskell, 99 bytes

Two solutions of equal length.

Call f.

f n=mapM_ putStrLn$[[x?y|x<-[0..2*n-y-0^y]]|y<-[0..2*n-1]]
x?y|mod(x+y)2==0='/'|x*y==0='\\'|0<1=' '

and

f n=mapM_ putStrLn$[[x?y|x<-[y..2*n-0^y]]|y<-[0..2*n-1]]
x?y|mod x 2==0='/'|mod y x==0='\\'|0<1=' '

#Haskell, 99 bytes

Two solutions of equal length.

Call f.

f n=mapM_ putStrLn$[[x?y|x<-[0..2*n-y-0^y]]|y<-[0..2*n-1]]
x?y|mod(x+y)2==0='/'|x*y==0='\\'|0<1=' '

and

f n=mapM_ putStrLn$[[x?y|x<-[y..2*n-0^y]]|y<-[0..2*n-1]]
x?y|mod x 2==0='/'|mod y x==0='\\'|0<1=' '

Haskell, 99 bytes

Two solutions of equal length.

Call f.

f n=mapM_ putStrLn$[[x?y|x<-[0..2*n-y-0^y]]|y<-[0..2*n-1]]
x?y|mod(x+y)2==0='/'|x*y==0='\\'|0<1=' '

and

f n=mapM_ putStrLn$[[x?y|x<-[y..2*n-0^y]]|y<-[0..2*n-1]]
x?y|mod x 2==0='/'|mod y x==0='\\'|0<1=' '
Source Link

#Haskell, 99 bytes

Two solutions of equal length.

Call f.

f n=mapM_ putStrLn$[[x?y|x<-[0..2*n-y-0^y]]|y<-[0..2*n-1]]
x?y|mod(x+y)2==0='/'|x*y==0='\\'|0<1=' '

and

f n=mapM_ putStrLn$[[x?y|x<-[y..2*n-0^y]]|y<-[0..2*n-1]]
x?y|mod x 2==0='/'|mod y x==0='\\'|0<1=' '