Family Day update
This commit is contained in:
parent
aac6731f2c
commit
9ad63ea473
2442 changed files with 39761 additions and 8255 deletions
|
|
@ -1,5 +1,5 @@
|
|||
100 LET I=0
|
||||
110 DO
|
||||
120 LET I=I+1
|
||||
130 PRINT I
|
||||
140 LOOP UNTIL MOD(I,6)=0
|
||||
a = 0
|
||||
REPEAT
|
||||
a = a + 1
|
||||
PRINT a
|
||||
UNTIL a MOD 6 = 0
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
10 LET X=0
|
||||
20 LET X=X+1
|
||||
30 PRINT X
|
||||
40 IF X/6<>INT (X/6) THEN GOTO 20
|
||||
100 LET I=0
|
||||
110 DO
|
||||
120 LET I=I+1
|
||||
130 PRINT I
|
||||
140 LOOP UNTIL MOD(I,6)=0
|
||||
|
|
|
|||
4
Task/Loops-Do-while/BASIC/loops-do-while-5.basic
Normal file
4
Task/Loops-Do-while/BASIC/loops-do-while-5.basic
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
10 LET X=0
|
||||
20 LET X=X+1
|
||||
30 PRINT X
|
||||
40 IF X/6<>INT (X/6) THEN GOTO 20
|
||||
4
Task/Loops-Do-while/Common-Lisp/loops-do-while-3.lisp
Normal file
4
Task/Loops-Do-while/Common-Lisp/loops-do-while-3.lisp
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
(do* ((a 0) ; Initialize to 0
|
||||
(b (incf a) (incf b))) ; Set first increment and increment on every loop
|
||||
((zerop (mod b 6)) (print b)) ; Break condition and print last value `6' (right?)
|
||||
(print b)) ; On every loop print value
|
||||
11
Task/Loops-Do-while/Go/loops-do-while-2.go
Normal file
11
Task/Loops-Do-while/Go/loops-do-while-2.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
var value int
|
||||
for ok := true; ok; ok = value%6 != 0 {
|
||||
value++
|
||||
fmt.Println(value)
|
||||
}
|
||||
}
|
||||
27
Task/Loops-Do-while/Go/loops-do-while-3.go
Normal file
27
Task/Loops-Do-while/Go/loops-do-while-3.go
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
// do-while loop 1
|
||||
n1 := 2
|
||||
for n1 < 6 {
|
||||
n1 *= 2
|
||||
}
|
||||
fmt.Println(n1) // prt 8
|
||||
// do-while loop 2
|
||||
n2 := 2
|
||||
for ok := true; ok; ok = n2%8 != 0 {
|
||||
n2 *= 2
|
||||
}
|
||||
fmt.Println(n2) // prt 8
|
||||
// do-while loop 3
|
||||
n3 := 2
|
||||
for {
|
||||
n3 *= 2
|
||||
if n3 >= 6 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fmt.Println(n3) // prt 8
|
||||
}
|
||||
6
Task/Loops-Do-while/Haxe/loops-do-while.haxe
Normal file
6
Task/Loops-Do-while/Haxe/loops-do-while.haxe
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
var val = 0;
|
||||
|
||||
do {
|
||||
val++;
|
||||
Sys.println(val);
|
||||
} while( val % 6 != 0);
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
DOWHILELOOP
|
||||
set val = 0
|
||||
do {
|
||||
set val = val + 1
|
||||
write val,!
|
||||
} while ((val # 6) '= 0)
|
||||
|
||||
quit
|
||||
set val = 0
|
||||
do {
|
||||
set val = val + 1
|
||||
write val,!
|
||||
} while ((val # 6) '= 0)
|
||||
|
||||
quit
|
||||
|
|
|
|||
7
Task/Loops-Do-while/Vala/loops-do-while.vala
Normal file
7
Task/Loops-Do-while/Vala/loops-do-while.vala
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
int a = 0;
|
||||
|
||||
do {
|
||||
a++;
|
||||
print(a.to_string() + "\n");
|
||||
}
|
||||
while ( a % 6 != 0);
|
||||
25
Task/Loops-Do-while/X86-Assembly/loops-do-while.x86
Normal file
25
Task/Loops-Do-while/X86-Assembly/loops-do-while.x86
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
extern _printf
|
||||
|
||||
section .data
|
||||
output db 0,0
|
||||
|
||||
section .text
|
||||
global _main
|
||||
_main:
|
||||
mov bl, 0
|
||||
looping:
|
||||
add bl, 0x31 ;0x30 to 0x39 is 0 to 9 in ASCII
|
||||
mov [output], bl
|
||||
sub bl, 0x30
|
||||
push output
|
||||
call _printf
|
||||
add esp, 4
|
||||
xor eax, eax
|
||||
xor edx, edx
|
||||
mov al, bl
|
||||
mov ecx, 6
|
||||
div ecx ; remainder is saved in edx
|
||||
cmp edx, 0
|
||||
jne looping ; if n & 6 != 0 do looping again
|
||||
xor eax, eax
|
||||
ret
|
||||
Loading…
Add table
Add a link
Reference in a new issue