我想在我的程序中有for循環這是寫在mozart-oz。每次我嘗試一個循環時,它都會給我錯誤。我已經檢查了語法和它的真實性,但它給出了錯誤。這裏是我的代碼: OZ: declare
fun {Test L}
for E in L do
{Browse L}
end
end
declare
L = [1 2 3 4 5]
{Test L}
請幫助。 感
我編程功能在莫扎特盎司返回一個數字的鏡子,例如 鏡(1234)號將返回4321 所以無論如何,我有這個想法怎麼樣,但我卡住,因爲我需要一個內置的函數,返回一個整數的位數(返回一個整數)。 我試過{長X}的功能,但我不知道它返回...... 這裏是我的代碼(即不工作),瞭解我的問題的情況下。 declare
fun {Mirror Int Acc}
if Int==0 then Acc
els
考慮下面的代碼: declare
class Test
attr L
meth init L:=nil end
meth put(X) {Browse @L} end
meth get {Browse @L} end
meth isEmpty @L==nil end
meth getList @L end
meth setNi
我最近開始學習Oz/Mozart,並且爲了練習,我正在編寫一個簡單的「For」過程的代碼,從「Init」到「End」值,並在每個循環中將當前循環編號打印到瀏覽器。下面是代碼: 此過程創建從初始化列表,以終值: declare
fun {Listing Init End}
if Init == End then
[Init]
else
Init|{Lis