A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 9 Ω


Basic256 Subroutine


Programmieren


Basiswissen


In der Programmiersprache Basic256 definiert subroutine ein Unterprogramm. Dazu hier ein Beispiel.

Syntax


subroutine subroutine_name ( function_variable_list )
Beliebige Befehle
end subroutine

Erklärung



Tipps



Beispiel-Code


# 100 random circles
clg
for x = 1 to 100
call draw()
next x
end

function rnd(n)
rnd = int(rand*n)
end function

subroutine draw()
color rgb(rnd(256),rnd(256),rnd(256))
circle rnd(graphwidth), rnd(graphheight), rnd(graphwidth/10)
end subroutine