I am the google copy and paste king with code for the staples/basics....it makes absolutely no sense to reinvent the wheel.
Now somethings you can't find 
 
  
When I was in Computer Operating Systems we had to build a model of a 'system' with wait states, a fifo and a filo section, registers and whatever other crap 

 It was 8 processes.
Anyways everyone used C++ and pretty much copied everyone else...I did mine in VBScript as I was trying to figure out ways to do more and more with scripting languages that could be made into webapplications.
It was more difficult, but fun in a sense I completed it (the instructor didn't think it would be accurate and offered me a chance should it not work right to reattempt it in a different language)....it worked perfectly.