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
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") | |
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | |
$Form = New-Object System.Windows.Forms.Form | |
$Form.Size = New-Object System.Drawing.Size(600,270) | |
$Form.Text = "Caesar Cipher Decryption" | |
$Form.ShowIcon = $False | |
###Function used to decrypt the text | |
function Decrypt { |
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
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") | |
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | |
$Form = New-Object System.Windows.Forms.Form | |
$Form.Size = New-Object System.Drawing.Size(600,270) | |
$Form.Text = "Caesar Cipher Encryption" | |
$Form.ShowIcon = $False | |
###Function used to encrypt the text | |
function Encrypt { |
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
################### | |
#Encrypt | |
################### | |
#Message to encrypt | |
$text = "titi a cru voir un grosminet" | |
#Shift number | |
$i = 3 |
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
#Function to calculate the Collatz conjecture | |
Function Calc ($number) { | |
#If number is even divide by 2 | |
if ($number % 2 -eq 0){ | |
$result = $number / 2 | |
[void]$myArray.Add($result) | |
#Else (number is odd) multiply by 3 and add 1 | |
}Else{ | |
$result = $number * 3 + 1 | |
[void]$myArray.Add($result) |