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 ruby | |
#input = "SHENANIGANS SALTY YOUNGSTER ROUND DOUBLET TERABYTE ESSENCE" | |
input = "DELOREAN NEUTER RAMSHACKLE EAR RUMP PALINDROME EXEMPLARY YARD" | |
input = input.split(" ") | |
spaces = 0 | |
#Loop through the words. | |
input.each_with_index do |word, counter| | |
if counter % 2 == 0 | |
print " " * 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
function Lulz | |
{ | |
param([REF]$Stuff) | |
$Stuff.Value *= 5 | |
} | |
$nonsense = 5 | |
Lulz -Stuff ([REF]$nonsense) | |
Write-Host $nonsense |
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/env/ruby | |
#Defining the object for my list. | |
class Todo | |
#Just create an empty array off the bat. | |
def initialize | |
@list = Array.new | |
end | |
#Function to add new items. |
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/env/ruby | |
#Function to test if the current value is a palindrome! | |
def is_palindrome(num) | |
len = num.to_s.length | |
numArr = num.to_s.split("") | |
is_pal = true | |
#Loop through the array, comparing the beginning to the end. | |
for i in 0...len/2 |
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/38yy9s/20150608_challenge_218_easy_making_numbers/ | |
#Function to see if the number is already a palindrome or not. | |
function IsPalindrome | |
{ | |
param($num) | |
#Find the length. | |
$len = ([string]$num).Length | |
#Check it. |
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
#Reddit Daily Programmer #217 - http://www.reddit.com/r/dailyprogrammer/comments/3840rp/20150601_challenge_217_easy_lumberjack_pile/ | |
#Define the parameters of the piles. | |
<# | |
$grid = 3 | |
$logs = 7 | |
$stacks = @(@(1, 1, 1), @(2, 1, 3), @(1, 4, 1)) | |
#> | |
<# | |
$grid = 4 |
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/env/ruby | |
#http://www.reddit.com/r/dailyprogrammer/comments/35l5eo/20150511_challenge_214_easy_calculating_the/ | |
#values = [5, 6, 11, 13, 19, 20, 25, 26, 28, 37] | |
values = [37, 81, 86, 91, 97, 108, 109, 112, 112, 114, 115, 117, 121, 123, 141] | |
sum = 0 | |
mid_sum = 0 | |
#Calculate the mean. | |
values.each do |x| | |
sum += x |
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
#Reddit Daily Programmer #210 - http://www.reddit.com/r/dailyprogrammer/comments/32goj8/20150413_challenge_210_easy_intharmonycom/ | |
#Function to append zeros. | |
function ConvertToBinary | |
{ | |
param($integer) | |
return [Convert]::ToString($integer, 2) | |
} |
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/ruby | |
#Reddit Daily Programmer 208 | |
#http://www.reddit.com/r/dailyprogrammer/comments/30ubcl/20150330_challenge_208_easy_culling_numbers/ | |
puts "Enter your numbers." | |
print "> " | |
input = $stdin.gets.chomp | |
input_array = input.split(" ") | |
#Get the unique values. | |
uniques = input_array.uniq |
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
$failCounter = 0 | |
$phrases = ("Process Kill!", "Double Process!", "Triple Process!", "Processtacular!", "Process Frenzy!", "Proctrocity!", "Procemanjaro!") | |
while($true) | |
{ | |
#Query all processes. | |
$processes = Get-Process | |
$counter = 0 | |