r/programminghorror • u/Nanocephalic • Feb 08 '26
The Shell of Power hi
I have had this dumb idea fermenting in my lower intestine for a long time, and finally decided to excrete it. Sorry for sharing it.
$DisplayWidth = 6
$DisplayHeight = 4
$DisplayScreen = [int[]]::new($DisplayWidth * $DisplayHeight)
$DisplayScreen[0] = 1
$DisplayScreen[6] = 1
$DisplayScreen[12] = 1
$DisplayScreen[18] = 1
$DisplayScreen[13] = 1
$DisplayScreen[14] = 1
$DisplayScreen[20] = 1
$DisplayScreen[4] = 1
$DisplayScreen[16] = 1
$DisplayScreen[22] = 1
for ($pixel = 0; $pixel -lt $DisplayScreen.Length; $pixel++) {
if ($displayscreen[$pixel] -eq 1) {
$mask = [IntPtr](1 -shl $pixel)
$p = Start-Process pwsh -WindowStyle Hidden -PassThru -ArgumentList @(
'-NoLogo','-NoProfile','-Command',
'while ($true) { }'
)
$p.ProcessorAffinity = $mask
$p.PriorityClass = 'Idle' # optional so it doesn’t hog the machine
Write-Output "pid $($p.id)"
}
}
770
Upvotes
128
u/YellowBunnyReddit Feb 08 '26
Can it play Bad Apple?
74
u/rainydio Feb 08 '26
ok
62
u/justsomerandomchris Feb 08 '26
Please keep the products of your intestinal fermentation to yourself. Thanks
45
u/riveyda Feb 08 '26
I -Fucking -Hate -Powershell
9
u/Frytura_ Feb 08 '26
Here's the deal.
Make it either Play bad apple OR snake videogame
7
u/Baratao00 Feb 08 '26
What you want me to do with that information?
1
u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" Feb 09 '26
So how does it set the value of each "pixel"? Or is that not shown here?
4
u/NotSoProGamerR Feb 08 '26
what the powershell
2
u/wildfire_117 Feb 08 '26
hi
2
u/exnez Feb 10 '26
hi
2
u/jeremyStover Feb 12 '26
I hate you
1
u/Material-Aioli-8539 Feb 10 '26
Now do this in C or even python and feel how fast it is in comparison lol
0
u/ZipKitty Feb 10 '26
The real horror is using winblows, my condolonce.