Q:

How to write a program that controls a motor

Well I want hook up a motor to move a laser pointer up/down left/right to draw patterns on the  wall,
I cannot find any examples of people doing this.
Has anyone come across any help for this project/what programming language would be used for this/what computer ports would this use/would I have to make a circuit or can I just buy one?

A:

There is a lot of different approaches you could go to this. Here is a few off the top of my head.
1. You could use a micro controller like an Arduino. 
2. You could use a serial port and a socket. Here would be a good resource if you want to pursue this route. http://www.easysw.com/~mike/serial/serial.html
3. If you only need to control two motors you could use the headphone jack on your computer. You could hook a simple amplifier circuit up to each of the left and right speaker line. Then hook each of the amplifiers up to a separate motor. Then you could write a program that generates a separate sound for each channel, thus modifying the voltage given to each motor.
P.S if you use a servo, you can control the exact angle of the laser.  

