Want to write my own solo cpu bitcoin miner
Tim S. pretty much covered it, but I wanted to 2 great resources which have been very helpful for myself and many others:


Ken Shirriff's blog has a few Bitcoin mining related posts which use Python code to great effectiveness; whilst Bitcoin Mining The Hard Way is probably the most useful, there's also some novel use cases where Ken tries Bitcoin mining by hand and using a 55 year old mainframe
Not specifically related to mining, but very useful in visualising related concepts is RoyalFork Blog