This file contains hidden or 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
#https://www.reddit.com/r/dailyprogrammer/comments/3kx6oh/20150914_challenge_232_easy_palindromes/ | |
$lines = 2 | |
$counter = 0 | |
$text = "" | |
while($counter -lt $lines) { | |
$temp = Read-Host "Enter text" | |
$temp = $temp.ToCharArray() | |
foreach($letter in $temp) { | |
$letter = [string]$letter |
This file contains hidden or 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
#https://www.reddit.com/r/dailyprogrammer/comments/3i99w8/20150824_challenge_229_easy_the_dottie_number/ | |
$number = Read-Host "Enter a number" | |
do { | |
$previous = $number | |
$number = [math]::Cos($number) | |
} while($number -ne $previous) | |
Write-Host $number |
This file contains hidden or 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
#https://www.reddit.com/r/dailyprogrammer/comments/3h9pde/20150817_challenge_228_easy_letters_in/ | |
function CheckOrder { | |
param($Word) | |
#Place the word into an array. | |
$charArray = $Word.ToCharArray() | |
$sortedArray = $charArray | Sort-Object | |
#See if they match. | |
$match = $true |
This file contains hidden or 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
#Stupid test script to generate a random, possibly complex password. | |
param | |
( | |
[Parameter(Mandatory=$true)] | |
[int]$Length, | |
[Parameter(Mandatory=$false)] | |
[switch]$Complexity | |
) | |
function MakePassword |
This file contains hidden or 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 warnings; | |
use strict; | |
sub shuffle_stuff { | |
#Turn the values into an array. | |
my $values = shift; | |
my @values = split(" ", $values); | |
#Figure out length. Create an array of index and a final value array. |
This file contains hidden or 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 warnings; | |
use strict; | |
sub garland { | |
use integer; | |
my $word = shift; | |
print "$word - "; | |
my @word_array = split("", $word); | |
my $length = @word_array; |
This file contains hidden or 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 | |
# Solution To Reddit Daily Programmer 222 | |
# http://www.reddit.com/r/dailyprogrammer/comments/3c9a9h/20150706_challenge_222_easy_balancing_words/ | |
use warnings; | |
use strict; | |
#Function to balance the word. | |
sub balance { | |
my $input = shift; | |
my $word_len = length($input); |
This file contains hidden or 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 warnings; | |
use strict; | |
my $base_word = "SHENANIGANS SALTY YOUNGSTER ROUND DOUBLET TERABYTE ESSENCE"; | |
my @word_array = split(/\s+/, $base_word); | |
my $counter = 0; | |
my $spaces = ""; |
This file contains hidden or 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
#Solution to Reddit Daily Programmer #220 | |
#http://www.reddit.com/r/dailyprogrammer/comments/3aqvjn/20150622_challenge_220_easy_mangling_sentences/ | |
#Original input. | |
#$sentence = "This challenge doesn't seem so hard." | |
#$sentence = "Eye of Newt, and Toe of Frog, Wool of Bat, and Tongue of Dog." | |
#$sentence = "For a charm of powerful trouble, like a hell-broth boil and bubble." | |
$sentence = "Adder's fork, and Blind-worm's sting, Lizard's leg, and Howlet's wing." | |
#Make it into an array of words. | |
$sentenceArray = $sentence.Split(" ") |
This file contains hidden or 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
#http://www.reddit.com/r/dailyprogrammer/comments/3bi5na/20150629_challenge_221_easy_word_snake/ | |
$words = "SHENANIGANS SALTY YOUNGSTER ROUND DOUBLET TERABYTE ESSENCE" | |
$wordArray = $words.Split(" ") | |
$counter = 0 | |
$space = "" | |
foreach($word in $wordArray) | |
{ | |
if($counter % 2 -eq 0) | |
{ |