Created
September 27, 2015 04:41
-
-
Save anonymous/5046901cdbccf409e9ff to your computer and use it in GitHub Desktop.
Shared via Rust Playground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
swizzle_gen(); | |
} | |
fn swizzle_gen() { | |
swizzle_gen0("x"); | |
swizzle_gen0("y"); | |
swizzle_gen0("z"); | |
swizzle_gen0("w"); | |
} | |
fn swizzle_gen0(c0: &str) { | |
println!("{}", c0); | |
swizzle_gen1(c0, "x"); | |
swizzle_gen1(c0, "y"); | |
swizzle_gen1(c0, "z"); | |
swizzle_gen1(c0, "w"); | |
} | |
fn swizzle_gen1(c0: &str, c1: &str) { | |
println!("{}{}", c0, c1); | |
swizzle_gen2(c0, c1, "x"); | |
swizzle_gen2(c0, c1, "y"); | |
swizzle_gen2(c0, c1, "z"); | |
swizzle_gen2(c0, c1, "w"); | |
} | |
fn swizzle_gen2(c0: &str, c1: &str, c2: &str) { | |
println!("{}{}{}", c0, c1, c2); | |
swizzle_gen3(c0, c1, c2, "x"); | |
swizzle_gen3(c0, c1, c2, "y"); | |
swizzle_gen3(c0, c1, c2, "z"); | |
swizzle_gen3(c0, c1, c2, "w"); | |
} | |
fn swizzle_gen3(c0: &str, c1: &str, c2: &str, c3: &str) { | |
println!("{}{}{}{}", c0, c1, c2, c3); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment