on this game you’ll check how much you and your computer are “Synced”
yes .. “Synced” 🙂 , lets create a fun game.
all you have to do is choose a number from 1 to 10 ,while the same time the computer choose one also
1 |
Get-random –Minimum 1 –Maximum 10 |
if the number chosen by the user isn’t match between 1 to 10 ,you’ll get an Error message
1 |
Write-Host "Guess between 1 to 10 Please" -BackgroundColor Black -ForegroundColor Red |
but ..if you chosen a number between 1 to 10 then this script will check if you and your computer are thinking the same 🙂
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
$Random = Get-random –Minimum 1 –Maximum 10 cls Write-Host "Instructions - Hello! This Game is Checking if you and the Computer Are Synced with your minds you and the computer choosing number between 1 to 10 .. ..then we'll check if both of you sharing your minds :) ..." -BackgroundColor Black -ForegroundColor Yellow try { $Guess = "" [int]$Guess= Read-Host Please Guess from 1 to 10 } catch {Write-Host "Guess between 1 to 10 Please" -BackgroundColor Black -ForegroundColor Red break } if ( ($Guess -ge 11) -or ($Guess -lt 1) ){ Write-Host "Guess between 1 to 10 Please" -BackgroundColor Black -ForegroundColor Red $Guess break } elseif ($Random -eq $Guess) { Write-Host "Full Match!!!" -BackgroundColor White -ForegroundColor Blue } elseif ($Random -ne $Guess) { Write-Host "Sorry!.. " -BackgroundColor DarkYellow -ForegroundColor Yellow } |
(Visited 854 times, 1 visits today)