led for new dummy me

where is the error in this
#define numleds 16

byte ledpins = { 0,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17 } ;

void setup( ) {

for ( int i=1; i <= numleds; i++ ) {

pinMode ( ledpins [ i ], OUTPUT) ;

digitalWrite ( ledpins [ i ] , HIGH) ;

}

}

void loop ( ) {

digitalWrite ( ledpins [ random ( 0, numleds+1 ) ], lightsw ( ) ) ;

delay ( 900 ) ;

}

boolean lightsw ( ) {

if ( random (0,100) > 40 ) return LOW ;

else return HIGH ;

}

HIGH and LOW are not Boolean values.

    for ( int  i=1; i <= numleds;  i++ )  {  Having a seventeen element array to hold sixteen values is silly. Just correct your for loop controls.

Please remember to use code tags when posting code

Thank you but iam very new to this and the code was written by an us model railroad magazine so i dont know what it means when the arduino says Arduino: 1.8.5 (Windows 10), Board: “Arduino/Genuino Uno”

java.io.IOException: Adgang nægtet
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.createTempFile(File.java:2024)
at processing.app.BaseNoGui.saveFile(BaseNoGui.java:908)
at processing.app.SketchFile.save(SketchFile.java:287)
at processing.app.Sketch.save(Sketch.java:138)
at processing.app.SketchController.save(SketchController.java:344)
at processing.app.Editor.handleSave2(Editor.java:2020)
at processing.app.Editor.handleSave(Editor.java:2000)
at processing.app.Editor.handleRun(Editor.java:1718)
at processing.app.Editor.handleRun(Editor.java:1713)
at processing.app.EditorToolbar.mousePressed(EditorToolbar.java:345)
at java.awt.Component.processMouseEvent(Component.java:6530)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4522)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Adgang nægtet

C:\Users\Tage\AppData\Local\Temp\arduino_modified_sketch_706199\building.ino.ino: In function ‘void loop()’:

building.ino:12: error: ‘numleds’ was not declared in this scope

for ( int i=1; i <= numleds; i++ ) {

^

C:\Users\Tage\AppData\Local\Temp\arduino_modified_sketch_706199\building.ino.ino: In function ‘void loop()’:

building.ino:22: error: redefinition of ‘void loop()’

void loop ( ) {

^

C:\Users\Tage\AppData\Local\Temp\arduino_modified_sketch_706199\building.ino.ino:6:6: note: ‘void loop()’ previously defined here

void loop() {

^

building.ino:24: error: ‘ledpins’ was not declared in this scope

digitalWrite ( ledpins [ random ], lightsw ( ) ) ;

^

exit status 1
‘numleds’ was not declared in this scope

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.
chanced the led to the right numbers still error

Your code compiles without error.building.ino.inoThis is puzzling.