DC motor problem

My dc motor is not working. I don't know if its broken, but I would like my code to be checked.`#include <AFMotor.h>
AF_DCMotor M1(1);
AF_DCMotor M2(2);
AF_DCMotor M3(3);
AF_DCMotor M4(4);

void setup() {
M1.setSpeed(500);
M2.setSpeed(500);
M3.setSpeed(500);
M4.setSpeed(500);
}

void loop() {
M1.run(FORWARD);
M2.run(FORWARD);
M3.run(FORWARD);
M4.run(FORWARD);
delay(100);
}`

Start by posting it properly in code tags. You seem to have tried but failed

In my experience the easiest way to tidy up the code and add the code tags is as follows
Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help.

Also post a wiring diagram of your project showing all the parts, all the pin numbers, including the power supply.

Does it work if you connect the motor DIRECTLY to the power, bypassing any Arduino stuff?