Another update from ingydotnet^djgoku

This commit is contained in:
Ingy döt Net 2015-11-18 06:14:39 +00:00
parent 91df62d461
commit 948b86eafa
7604 changed files with 108452 additions and 22726 deletions

View file

@ -0,0 +1,20 @@
* Loops/For with a specified step 12/08/2015
LOOPFORS CSECT
USING LOOPFORS,R12
LR R12,R15
BEGIN LA R3,MVC
SR R5,R5 index
LA R6,5 step 5
LA R7,25 to 25
LOOPI BXH R5,R6,ELOOPI for i=5 to 25 step 5
XDECO R5,XDEC
MVC 0(4,R3),XDEC+8
LA R3,4(R3)
NEXTI B LOOPI next i
ELOOPI XPRNT MVC,80
XR R15,R15
BR R14
MVC DC CL80' '
XDEC DS CL12
YREGS
END LOOPFORS

View file

@ -0,0 +1,3 @@
begin
for i := 3 step 2 until 9 do write( i )
end.

View file

@ -0,0 +1,4 @@
@echo off
for /l %%A in (1,2,10) do (
echo %%A
)

View file

@ -0,0 +1,2 @@
1 >:.55+,v
@_^#`9:+2<

View file

@ -1,6 +1,8 @@
open console
open monad io
for m s n | n > m = ()
| else = writen n $ for m s (n+s)
for m s n | n > m = do return ()
| else = do
putStrLn (show n)
for m s (n+s)
for 10 2 0
_ = for 10 2 0 ::: IO

View file

@ -0,0 +1,7 @@
defmodule Loops do
def for_step(n, step) do
IO.inspect Enum.take_every(1..n, step)
end
end
Loops.for_step(20, 3)

View file

@ -0,0 +1,2 @@
iex(1)> Stream.iterate(1, &(&1+2)) |> Enum.take(10)
[1, 3, 5, 7, 9, 11, 13, 15, 17, 19]

View file

@ -0,0 +1,21 @@
// range(iMax)
// range(iMin, iMax)
// range(iMin, iMax, dI)
function range() {
var lngArgs = arguments.length,
lngMore = lngArgs - 1;
iMin = lngMore ? arguments[0] : 1;
iMax = arguments[lngMore ? 1 : 0];
dI = lngMore > 1 ? arguments[2] : 1;
return lngArgs ? Array.apply(null, Array(
Math.floor((iMax - iMin) / dI) + 1
)).map(function (_, i) {
return iMin + (dI * i);
}) : [];
}
console.log(
range(2, 8, 2).join(', ') + ', who do we appreciate ?'
);

View file

@ -1,3 +1,3 @@
for i from 1 to 6 by 2 do
for i from 2 to 8 by 2 do
i;
end do;

View file

@ -0,0 +1,8 @@
fn main() {
let mut i = 2;
while i <= 8 {
print!("{}, ", i);
i += 2;
}
println!("who do we appreciate?!");
}

View file

@ -0,0 +1,8 @@
#![feature(step_by)]
fn main() {
for i in (2..8+1).step_by(2) {
print!("{}", i);
}
println!("who do we appreciate?!");
}

View file

@ -0,0 +1,9 @@
#[macro_use]
extern crate cfor;
fn main() {
cfor!(let mut i = 2; i <= 8; i+=2; {
println!("{}", i);
});
println!("Who do we appreciate?");
}

View file

@ -1,8 +0,0 @@
use std::iter::range_step_inclusive;
fn main() {
for i in range_step_inclusive(2, 8, 2) {
print!("{:d}, ", i);
}
println("who do we appreciate?!");
}

View file

@ -0,0 +1,3 @@
for i=1:2:10
printf("%d\n",i)
end

View file

@ -0,0 +1,3 @@
:For(I,0,100,5
:Disp I
:End