September Morn Update
This commit is contained in:
parent
4e2d22a71d
commit
aac6731f2c
6856 changed files with 141342 additions and 21127 deletions
|
|
@ -25,4 +25,6 @@ upon a specific condition, if your language allows it.
|
|||
* [[Loops/N plus one half]]
|
||||
* [[Loops/Nested]]
|
||||
* [[Loops/While]]
|
||||
* [[Loops/with multiple ranges]]
|
||||
* [[Loops/Wrong ranges]]
|
||||
<br><br>
|
||||
|
|
|
|||
6
Task/Loops-Continue/Befunge/loops-continue-1.bf
Normal file
6
Task/Loops-Continue/Befunge/loops-continue-1.bf
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
1>:56+\`#v_@
|
||||
+v %5:.:<
|
||||
1>#v_55+,v
|
||||
^ <
|
||||
>" ,",,v
|
||||
^ <
|
||||
6
Task/Loops-Continue/Befunge/loops-continue-2.bf
Normal file
6
Task/Loops-Continue/Befunge/loops-continue-2.bf
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
1>:56+\`#v_@
|
||||
+v5:,8.:<
|
||||
1>%#v_55+,v
|
||||
^ <
|
||||
>" ,",v
|
||||
^ ,<
|
||||
|
|
@ -1,7 +1,9 @@
|
|||
(do ((i 1 (1+ i))) ((> i 10))
|
||||
(do ((i 1 (1+ i)))
|
||||
((> i 10))
|
||||
(format t "~a~:[, ~;~%~]" i (zerop (mod i 5))))
|
||||
|
||||
(do ((i 1 (1+ i))) ((> i 10))
|
||||
(do ((i 1 (1+ i)))
|
||||
((> i 10))
|
||||
(write i)
|
||||
(when (zerop (mod i 5))
|
||||
(terpri)
|
||||
|
|
@ -9,7 +11,8 @@
|
|||
(write-string ", ")
|
||||
end)
|
||||
|
||||
(do ((i 1 (1+ i))) ((> i 10))
|
||||
(do ((i 1 (1+ i)))
|
||||
((> i 10))
|
||||
(write i)
|
||||
(if (zerop (mod i 5))
|
||||
(terpri)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
(loop for i from 1 to 10
|
||||
do (write i)
|
||||
if (zerop (mod i 5)) do (terpri)
|
||||
else do (write-string ", "))
|
||||
if (zerop (mod i 5))
|
||||
do (terpri)
|
||||
else
|
||||
do (write-string ", "))
|
||||
|
||||
(loop for i from 1 to 10 do
|
||||
(block continue
|
||||
|
|
|
|||
20
Task/Loops-Continue/Neko/loops-continue.neko
Normal file
20
Task/Loops-Continue/Neko/loops-continue.neko
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/**
|
||||
Loops/Continue in Neko
|
||||
Tectonics:
|
||||
nekoc loops-continue.neko
|
||||
neko loops-continue
|
||||
*/
|
||||
|
||||
var index = 0;
|
||||
|
||||
while index < 10 {
|
||||
index += 1;
|
||||
$print(index);
|
||||
if $not($istrue(index % 5)) {
|
||||
$print("\n");
|
||||
|
||||
continue;
|
||||
|
||||
}
|
||||
$print(", ");
|
||||
}
|
||||
11
Task/Loops-Continue/Objeck/loops-continue.objeck
Normal file
11
Task/Loops-Continue/Objeck/loops-continue.objeck
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
class Continue {
|
||||
function : Main(args : String[]) ~ Nil {
|
||||
for(i := 1; i <= 10; i += 1;) {
|
||||
if(i = 5) {
|
||||
"{$i}, "->PrintLine();
|
||||
continue;
|
||||
};
|
||||
"{$i}, "->Print();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
fn main() {
|
||||
for i in 1..10+1 {
|
||||
for i in 1..=10 {
|
||||
print!("{}", i);
|
||||
if i % 5 == 0 {
|
||||
print!("\n");
|
||||
println!();
|
||||
continue;
|
||||
}
|
||||
print!(", ");
|
||||
|
|
|
|||
10
Task/Loops-Continue/Smalltalk/loops-continue.st
Normal file
10
Task/Loops-Continue/Smalltalk/loops-continue.st
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
1 to: 10 do: [ :i |
|
||||
[ :continue |
|
||||
i % 5 = 0 ifTrue: [
|
||||
Transcript show: i; cr.
|
||||
continue value ].
|
||||
Transcript
|
||||
show: i;
|
||||
show: ', '.
|
||||
] valueWithExit.
|
||||
]
|
||||
20
Task/Loops-Continue/Spin/loops-continue.spin
Normal file
20
Task/Loops-Continue/Spin/loops-continue.spin
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
con
|
||||
_clkmode = xtal1 + pll16x
|
||||
_clkfreq = 80_000_000
|
||||
|
||||
obj
|
||||
ser : "FullDuplexSerial.spin"
|
||||
|
||||
pub main | i
|
||||
ser.start(31, 30, 0, 115200)
|
||||
|
||||
repeat i from 1 to 10
|
||||
ser.dec(i)
|
||||
if i // 5
|
||||
ser.str(string(", "))
|
||||
next
|
||||
ser.str(string(13,10))
|
||||
|
||||
waitcnt(_clkfreq + cnt)
|
||||
ser.stop
|
||||
cogstop(0)
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
for i in 1...10 {
|
||||
print(i)
|
||||
if i%5 == 0 {
|
||||
println()
|
||||
print(i, terminator: "")
|
||||
if i % 5 == 0 {
|
||||
print()
|
||||
continue
|
||||
}
|
||||
print(", ")
|
||||
print(", ", terminator: "")
|
||||
}
|
||||
|
|
|
|||
12
Task/Loops-Continue/VBA/loops-continue.vba
Normal file
12
Task/Loops-Continue/VBA/loops-continue.vba
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
Public Sub LoopContinue()
|
||||
Dim value As Integer
|
||||
For value = 1 To 10
|
||||
Debug.Print value;
|
||||
If value Mod 5 = 0 Then
|
||||
'VBA does not have a continue statement
|
||||
Debug.Print
|
||||
Else
|
||||
Debug.Print ",";
|
||||
End If
|
||||
Next value
|
||||
End Sub
|
||||
Loading…
Add table
Add a link
Reference in a new issue