Apply a callback to an array: Difference between revisions

(Added XBS language)
Line 3,680:
MapSingle({{x}, x^2}, {1,2,3,4})
</lang>
 
=={{header|Z80 Assembly}}==
<lang z80>Array:
byte &01,&02,&03,&04,&05
Array_End:
 
foo:
ld hl,Array
ld b,Array_End-Array ;ld b,5
 
bar:
inc (hl)
inc (hl)
inc (hl)
inc hl ;next entry in array
djnz bar</lang>
 
{{out}}
The program above doesn't show the new values but here they are:
<pre>
&04,&05,&06,&07,&08
</pre>
 
 
=={{header|zkl}}==
1,489

edits