September Morn Update

This commit is contained in:
Ingy döt Net 2019-09-12 10:33:56 -07:00
parent 4e2d22a71d
commit aac6731f2c
6856 changed files with 141342 additions and 21127 deletions

View file

@ -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>

View file

@ -0,0 +1,6 @@
1>:56+\`#v_@
+v %5:.:<
1>#v_55+,v
^ <
>" ,",,v
^ <

View file

@ -0,0 +1,6 @@
1>:56+\`#v_@
+v5:,8.:<
1>%#v_55+,v
^ <
>" ,",v
^ ,<

View file

@ -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)

View file

@ -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

View 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(", ");
}

View 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();
};
}
}

View file

@ -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!(", ");

View 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.
]

View 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)

View file

@ -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: "")
}

View 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