New project with motor and light sensor

So we are building this prototype for our college project. Basically we are building a cloth rolling machine.So we place one end a cloth(long one)on a shaft with clips and the other end the cloth on a table which has a light sensor. So then we press a button and the motors starts and the cloth rolls and after that the light sensor gets light and the motor stops.
For the above process we need a code for the adduino. Can someone help me with it?
We got the arduino uno, the light sensor.

The ldr^

Sure, we can help fix any problems you run into.

Post the code, following the instructions in the "How to use this forum" post, a wiring diagram, and an explanation of what goes wrong.

If you have not done any Arduino programming, we recommend that you start with the simple examples that come with the development software, to learn the language and special features of the Arduino.