Skip to content

Instantly share code, notes, and snippets.

@emreyh
Created March 19, 2014 22:53
Show Gist options
  • Save emreyh/9653119 to your computer and use it in GitHub Desktop.
Save emreyh/9653119 to your computer and use it in GitHub Desktop.
Oyuncak Makine Ornekler
basla get
ifzero duyur
add toplam
store toplam
load bolen
add 1
store bolen
goto basla
duyur load toplam
div bolen
print
stop
toplam 0
bolen 0
#ortalama bulan program
start get
ifzero result
store val1
sub val2
ifpos L # saglanıyorsa L satirina git
goto start # eger "ifpos" sartı saglanmıyorsa bir sey yapma basa don
L load val1
store val2
goto start
result load val2
print
stop
val1 0
val2 0
#en buyuk sayıyı bulan program
load 2 # 2 yi hesaplamaya gerek yok 3 ten baslayalım..
print
start load val
mod range
ifzero L
load range
add 1 # range 1 ekle
store range
goto start
L load val
sub range
ifzero M
continue load val
add 1 # val 1 ekle
store val
sub sayi
ifzero end
load 2
store range
goto start
M load val
print
goto continue
end stop
val 3 # 50 ye kadar gidecek olan sayi
range 2 # tek tek artacak ve mod alınacak sayı
sayi 50 # bu sabit program içinde kontrol için gerekli
#1 ile 50 arasında asal sayıları bulan program
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment