To write a program you only need to write the function and add argument if needed. You can include nqc code by insert "nqc [ ]". Here is an example :
begin
go_fordward
wait 5
stop A
stop C
nqc [
/* only this kind of commentar ar allowed */
int i;
i=Random(1);
if(i==1)
OnFwd(OUT_A);
else
OnRev(OUT_A);
]
wait_touch 1
stop A
stop C
end