Thảo luận ngôn ngũ Barbone

164 views
Skip to first unread message

Hà Ngọc

unread,
Sep 16, 2011, 10:02:47 AM9/16/11
to AC&N
Hi các bạn. Hôm thứ 4 học trí tuệ nhân tạo thầy dạy ngôn ngũ BareBone
thấy khó, kèm theo bùn ngủ nên giờ không hiểu gì hết
Các bạn trong nhóm mình ai hiểu giải thích cho n với.
Đặc biệt là chổ sử dụng ngôn ngữ barabone để tính tổng, trừ, nhân,
chia...
Còn bái tập các bạn có ý tưởng gì thì share lun nha.
Hihi. chúc các bạn buổi tối vui vẻ. ^_^
Message has been deleted

Bùi Anh Tài

unread,
Sep 17, 2011, 12:00:28 PM9/17/11
to acn-...@googlegroups.com
sum=1+2+3...+n
clear N;
incr N;
incr N;
incr N;
incr N;
incr N;
clear I;
while N;
    incr I;
    while I;
        incr sum;
        incr tempI;
        decr I;
    end;
    while tempI;
        incr I;
        decr tempI;
    end;
decr N;
end;



--
Bùi Anh Tài
ĐHSP TP HCM

Bùi Anh Tài

unread,
Sep 17, 2011, 12:05:11 PM9/17/11
to acn-...@googlegroups.com

# Z = n!
# Initialize section
clear n;
incr n;
incr n;
incr n;
incr n;

# Program starts
clear Z;
incr Z;
clear i;
while n;
    incr i;
    #----------------------------
    # Z1 = Z
    clear Z1;
    clear tmpZ;
    while Z;
        incr Z1;
        decr Z;
        incr tmpZ;
    end;
    # We commented out below lines because we do not need to keep the value of Z
    #while tmpZ;
    #    incr Z;
    #    decr tmpZ;
    #end;
    #----------------------------
    # Z = Z1*i;
    clear Z;
    clear tmpZ1;
    while Z1;
        clear tmpI;
        while i;
            incr Z;
            decr i;
            incr tmpI;
        end;
        decr Z1;
        incr tmpZ1;
        while tmpI;
            incr i;
            decr tmpI;
        end;
    end;
    while tmpZ1;
        incr Z1;
        decr tmpZ1;
    end;
    while tmpI;
        incr i;
        decr tmpI;
    end;
    #----------------------------
    decr n;
end;

Hà Ngọc

unread,
Sep 17, 2011, 1:12:30 PM9/17/11
to ACN-...@googlegroups.com
Thank ban tai ve bai viet nha.

Hà Ngọc

unread,
Sep 20, 2011, 12:01:11 PM9/20/11
to AC&N
chao cac ban chuc buoi tot tot lanh.
Reply all
Reply to author
Forward
0 new messages