Personally I’ve only ever written two. One that created multiple textfiles in various folders under windows that all grew exponentially. This was in the age of HDD so it could actually caused some serious problems. I created it because a guy in my class stole my homework by copying my files. So i created this virus, named it something fitting and “forgot” to close my laptop when i went to the bathroom.
And another that once every 40 minutes + (5 to 50) minutes would open your cd tray and then close it after 2 seconds. No one used CD’s at this point and i just wanted to prank some colleges.
Not exactly what you ask for but I still find it funny… When I was a child we still had 3.5 floppy disks. A friend convinced me that you get computer viruses like you get human viruses. If you rub dirt from outside on the tape inside the disk there is a chance you could put a virus on the disk.
Did it cause a computer virus? No! Did it destroy the disk drive? Yes! Were my parents mad? Absolutely!