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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use feature ":5.10"; | |
use feature 'signatures'; | |
no warnings "experimental::signatures"; | |
use Algorithm::Combinatorics qw(permutations); | |
my $n = shift @ARGV; |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use feature ":5.10"; | |
my $n = shift @ARGV; | |
while (1) { | |
if ($n <= 1) { | |
say $n; |
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
#!/usr/bin/env python2 | |
from sys import argv | |
n = int(argv[1]) | |
while True: | |
if n <= 1: | |
print n | |
break |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use feature ":5.10"; | |
use feature 'signatures'; | |
no warnings "experimental::signatures"; | |
for my $line (@ARGV) { | |
say testForPangram($line); | |
} |
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
func testForPangram(_ s: String) -> String { | |
var count = [Character:Int]() | |
for c in s.lowercased().characters { | |
if c >= "a" && c <= "z" { | |
if count[c] == nil { | |
count[c] = 1 | |
} else { | |
count[c] = count[c]! + 1 | |
} | |
} |
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
#include <stdio.h> | |
#include <string.h> | |
void boxWord(char *); | |
int main(int argc, char *argv[]) { | |
for (int i = 1; i < argc; i++) { | |
boxWord(argv[i]); | |
puts(""); | |
} |
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
#!/usr/bin/env python2 | |
from sys import argv | |
def boxWord(s): | |
if len(s) <= 1: | |
print s | |
return | |
# top | |
print s |
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
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
void boxWord(char *s, int rows, int cols); | |
void printEdge(char *s, int cols, int dir); | |
void printMiddle(char *s, int cols, int offset); | |
int main(int argc, char *argv[]) { | |
if (argc != 4) { |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use feature "signatures"; | |
no warnings "experimental::signatures"; | |
my ($s, $rows, $cols) = @ARGV; | |
boxedWord($s, $rows, $cols); |
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
#!/usr/bin/env python2 | |
from sys import argv | |
def printWord(s): | |
if s[0] == s[-1]: | |
triangleWord(s) | |
else: | |
boxWord(s) | |
def triangleWord(s): |