September Morn Update
This commit is contained in:
parent
4e2d22a71d
commit
aac6731f2c
6856 changed files with 141342 additions and 21127 deletions
|
|
@ -0,0 +1,22 @@
|
|||
; https://skilldrick.github.io/easy6502/
|
||||
; Multiplies A by X
|
||||
|
||||
define memory 1040
|
||||
|
||||
JMP MAIN
|
||||
|
||||
MULTIPLY: STA memory ; memory = A
|
||||
BEQ MUL_END ; A = 0
|
||||
TXA ; A = X
|
||||
BEQ MUL_END ; X = 0 -> A = 0
|
||||
LDA memory
|
||||
CLC
|
||||
MUL_LOOP: DEX ; X -= 1
|
||||
BEQ MUL_END ; X = 0 -> A = A * X
|
||||
ADC memory ; A += memory
|
||||
JMP MUL_LOOP
|
||||
MUL_END: RTS
|
||||
|
||||
MAIN: LDA #50
|
||||
LDX #5
|
||||
JSR MULTIPLY
|
||||
|
|
@ -0,0 +1 @@
|
|||
100 DEF MULTIPLY(A,B)=A*B
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
real multiply(RealNumber a, RealNumber b)
|
||||
= a * b.
|
||||
real multiply(real a, real b)
|
||||
= a * b;
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
symbol f := (:x:y)(x * y).
|
||||
symbol f := (x,y => x * y);
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
f(x,y){ ^ x * y }
|
||||
1
Task/Function-definition/Fish/function-definition.fish
Normal file
1
Task/Function-definition/Fish/function-definition.fish
Normal file
|
|
@ -0,0 +1 @@
|
|||
2[*]
|
||||
2
Task/Function-definition/Ol/function-definition-1.ol
Normal file
2
Task/Function-definition/Ol/function-definition-1.ol
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
(lambda (x y)
|
||||
(* x y))
|
||||
3
Task/Function-definition/Ol/function-definition-2.ol
Normal file
3
Task/Function-definition/Ol/function-definition-2.ol
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
(define multiply (lambda (x y) (* x y)))
|
||||
|
||||
(define (multiply x y) (* x y))
|
||||
12
Task/Function-definition/Ol/function-definition-3.ol
Normal file
12
Task/Function-definition/Ol/function-definition-3.ol
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
(let multiply ((x n) (y m))
|
||||
(* x y))
|
||||
|
||||
; example of naive multiplication function implementation using local recursion:
|
||||
(define (multiply x y)
|
||||
(let loop ((y y) (n 0))
|
||||
(if (= y 0)
|
||||
n
|
||||
(loop (- y 1) (+ n x)))))
|
||||
|
||||
(print (multiply 7 8))
|
||||
; ==> 56
|
||||
|
|
@ -1,2 +1 @@
|
|||
(define (mutiply a b)
|
||||
(* a b))
|
||||
(define (multiply a b) (* a b))
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
(define multiply (λ (a b) (* a b)))
|
||||
|
|
@ -0,0 +1 @@
|
|||
(define multiply *)
|
||||
|
|
@ -0,0 +1 @@
|
|||
Multiply(6, 111)
|
||||
3
Task/Function-definition/Xojo/function-definition-1.xojo
Normal file
3
Task/Function-definition/Xojo/function-definition-1.xojo
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
Function Multiply(ByVal a As Integer, ByVal b As Integer) As Integer
|
||||
Return a * b
|
||||
End Function
|
||||
1
Task/Function-definition/Xojo/function-definition-2.xojo
Normal file
1
Task/Function-definition/Xojo/function-definition-2.xojo
Normal file
|
|
@ -0,0 +1 @@
|
|||
Dim I As Integer = Multiply(7, 6)
|
||||
Loading…
Add table
Add a link
Reference in a new issue