A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
1
Task/Integer-sequence/0815/integer-sequence.0815
Normal file
1
Task/Integer-sequence/0815/integer-sequence.0815
Normal file
|
|
@ -0,0 +1 @@
|
|||
}:_:<:1:+%<:a:~$^:_:
|
||||
5
Task/Integer-sequence/0DESCRIPTION
Normal file
5
Task/Integer-sequence/0DESCRIPTION
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
Create a program that, when run, would display all integers from 1 to ∞ (or any relevant implementation limit), in sequence (i.e. 1, 2, 3, 4, etc) if given enough time.
|
||||
|
||||
An example may not be able to reach arbitrarily-large numbers based on implementations limits. For example, if integers are represented as a 32-bit unsigned value with 0 as the smallest representable value, the largest representable value would be 4,294,967,295. Some languages support arbitrarily-large numbers as a built-in feature, while others make use of a module or library.
|
||||
|
||||
If appropriate, provide an example which reflect the language implementation's common built-in limits as well as an example which supports arbitrarily large numbers, and describe the nature of such limitations—or lack thereof.
|
||||
6
Task/Integer-sequence/ALGOL-68/integer-sequence.alg
Normal file
6
Task/Integer-sequence/ALGOL-68/integer-sequence.alg
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
main:
|
||||
(
|
||||
FOR i DO
|
||||
printf(($g(0)","$,i))
|
||||
OD
|
||||
)
|
||||
4
Task/Integer-sequence/AWK/integer-sequence.awk
Normal file
4
Task/Integer-sequence/AWK/integer-sequence.awk
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
BEGIN {
|
||||
for( i=0; i != i + 1; i++ )
|
||||
print( i )
|
||||
}
|
||||
9
Task/Integer-sequence/Ada/integer-sequence-1.ada
Normal file
9
Task/Integer-sequence/Ada/integer-sequence-1.ada
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
with Ada.Text_IO;
|
||||
procedure Integers is
|
||||
Value : Integer := 1;
|
||||
begin
|
||||
loop
|
||||
Ada.Text_IO.Put_Line (Integer'Image (Value));
|
||||
Value := Value + 1;
|
||||
end loop;
|
||||
end Integers;
|
||||
7
Task/Integer-sequence/Ada/integer-sequence-2.ada
Normal file
7
Task/Integer-sequence/Ada/integer-sequence-2.ada
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
with Ada.Text_IO;
|
||||
procedure Positives is
|
||||
begin
|
||||
for Value in Positive'Range loop
|
||||
Ada.Text_IO.Put_Line (Positive'Image (Value));
|
||||
end loop;
|
||||
end Positives;
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
10 I% = 0
|
||||
20 PRINT I%: IF I% < 32767 THEN I% = I% + 1: GOTO 20
|
||||
3
Task/Integer-sequence/AutoHotkey/integer-sequence.ahk
Normal file
3
Task/Integer-sequence/AutoHotkey/integer-sequence.ahk
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
x=0
|
||||
Loop
|
||||
TrayTip, Count, % ++x
|
||||
4
Task/Integer-sequence/BASIC/integer-sequence-1.bas
Normal file
4
Task/Integer-sequence/BASIC/integer-sequence-1.bas
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
10 LET A = 0
|
||||
20 LET A = A + 1
|
||||
30 PRINT A
|
||||
40 GO TO 20
|
||||
2
Task/Integer-sequence/BASIC/integer-sequence-2.bas
Normal file
2
Task/Integer-sequence/BASIC/integer-sequence-2.bas
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
A = 0
|
||||
DO: A = A + 1: PRINT A: LOOP 1
|
||||
5
Task/Integer-sequence/BBC-BASIC/integer-sequence-1.bbc
Normal file
5
Task/Integer-sequence/BBC-BASIC/integer-sequence-1.bbc
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
*FLOAT 64
|
||||
REPEAT
|
||||
i += 1
|
||||
PRINT TAB(0,0) i;
|
||||
UNTIL FALSE
|
||||
9
Task/Integer-sequence/BBC-BASIC/integer-sequence-2.bbc
Normal file
9
Task/Integer-sequence/BBC-BASIC/integer-sequence-2.bbc
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
INSTALL @lib$+"HIMELIB"
|
||||
PROC_himeinit("")
|
||||
reg% = 1
|
||||
|
||||
PROC_hiputdec(reg%, "0")
|
||||
REPEAT
|
||||
SYS `hi_Incr`, ^reg%, ^reg%
|
||||
PRINT TAB(0,0) FN_higetdec(reg%);
|
||||
UNTIL FALSE
|
||||
1
Task/Integer-sequence/Bracmat/integer-sequence.bracmat
Normal file
1
Task/Integer-sequence/Bracmat/integer-sequence.bracmat
Normal file
|
|
@ -0,0 +1 @@
|
|||
0:?n&whl'out$(1+!n:?n)
|
||||
4
Task/Integer-sequence/Brainf---/integer-sequence-1.bf
Normal file
4
Task/Integer-sequence/Brainf---/integer-sequence-1.bf
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
++++++++++>>>+[[->>+<[+>->+<<---------------------------------------
|
||||
-------------------[>>-<++++++++++<[+>-<]]>[-<+>]<++++++++++++++++++
|
||||
++++++++++++++++++++++++++++++>]<[<]>>[-<+++++++++++++++++++++++++++
|
||||
++++++++++++++++++++++>]>]>[>>>]<<<[.<<<]<.>>>+]
|
||||
4
Task/Integer-sequence/Brainf---/integer-sequence-2.bf
Normal file
4
Task/Integer-sequence/Brainf---/integer-sequence-2.bf
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
++++++++++>>-[>+[->>+<[+>->+<<--------------------------------------
|
||||
--------------------[>>-<++++++++++<[+>-<]]>[-<+>]<+++++++++++++++++
|
||||
+++++++++++++++++++++++++++++++>]<[<]>>[-<++++++++++++++++++++++++++
|
||||
+++++++++++++++++++++++>]>]>[>>>]<<<[.<<<]<.>>-]
|
||||
6
Task/Integer-sequence/Brat/integer-sequence.brat
Normal file
6
Task/Integer-sequence/Brat/integer-sequence.brat
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
i = 1
|
||||
|
||||
loop {
|
||||
p i
|
||||
i = i + 1
|
||||
}
|
||||
1
Task/Integer-sequence/Burlesque/integer-sequence.blq
Normal file
1
Task/Integer-sequence/Burlesque/integer-sequence.blq
Normal file
|
|
@ -0,0 +1 @@
|
|||
1R@
|
||||
11
Task/Integer-sequence/C++/integer-sequence.cpp
Normal file
11
Task/Integer-sequence/C++/integer-sequence.cpp
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#include <iostream>
|
||||
#include <cstdint>
|
||||
|
||||
int main()
|
||||
{
|
||||
uint32_t i = 0;
|
||||
while(true)
|
||||
std::cout << ++i << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
9
Task/Integer-sequence/C/integer-sequence-1.c
Normal file
9
Task/Integer-sequence/C/integer-sequence-1.c
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
unsigned int i = 0;
|
||||
while (++i) printf("%u\n", i);
|
||||
|
||||
return 0;
|
||||
}
|
||||
14
Task/Integer-sequence/C/integer-sequence-2.c
Normal file
14
Task/Integer-sequence/C/integer-sequence-2.c
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#include <gmp.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
mpz_t i;
|
||||
mpz_init(i); /* zero now */
|
||||
|
||||
while (1) {
|
||||
mpz_add_ui(i, i, 1); /* i = i + 1 */
|
||||
gmp_printf("%Zd\n", i);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
29
Task/Integer-sequence/C/integer-sequence-3.c
Normal file
29
Task/Integer-sequence/C/integer-sequence-3.c
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#include <openssl/bn.h> /* BN_*() */
|
||||
#include <openssl/err.h> /* ERR_*() */
|
||||
#include <stdio.h> /* fprintf(), puts() */
|
||||
|
||||
void
|
||||
fail(const char *message)
|
||||
{
|
||||
fprintf(stderr, "%s: error 0x%08lx\n", ERR_get_error());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
BIGNUM i;
|
||||
char *s;
|
||||
|
||||
BN_init(&i);
|
||||
for (;;) {
|
||||
if (BN_add_word(&i, 1) == 0)
|
||||
fail("BN_add_word");
|
||||
s = BN_bn2dec(&i);
|
||||
if (s == NULL)
|
||||
fail("BN_bn2dec");
|
||||
puts(s);
|
||||
OPENSSL_free(s);
|
||||
}
|
||||
/* NOTREACHED */
|
||||
}
|
||||
5
Task/Integer-sequence/Clean/integer-sequence.clean
Normal file
5
Task/Integer-sequence/Clean/integer-sequence.clean
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
module IntegerSequence
|
||||
|
||||
import StdEnv
|
||||
|
||||
Start = [x \\ x <- [1..]]
|
||||
1
Task/Integer-sequence/Clojure/integer-sequence.clj
Normal file
1
Task/Integer-sequence/Clojure/integer-sequence.clj
Normal file
|
|
@ -0,0 +1 @@
|
|||
(map println (next (range)))
|
||||
35
Task/Integer-sequence/CoffeeScript/integer-sequence-1.coffee
Normal file
35
Task/Integer-sequence/CoffeeScript/integer-sequence-1.coffee
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
# This very limited BCD-based collection of functions
|
||||
# makes it easy to count very large numbers. All arrays
|
||||
# start off with the ones columns in position zero.
|
||||
# Using arrays of decimal-based digits to model integers
|
||||
# doesn't make much sense for most tasks, but if you
|
||||
# want to keep counting forever, this does the trick.
|
||||
|
||||
BcdInteger =
|
||||
from_string: (s) ->
|
||||
arr = []
|
||||
for c in s
|
||||
arr.unshift parseInt(c)
|
||||
arr
|
||||
|
||||
render: (arr) ->
|
||||
s = ''
|
||||
for elem in arr
|
||||
s = elem.toString() + s
|
||||
s
|
||||
|
||||
succ: (arr) ->
|
||||
arr = (elem for elem in arr)
|
||||
i = 0
|
||||
while arr[i] == 9
|
||||
arr[i] = 0
|
||||
i += 1
|
||||
arr[i] ||= 0
|
||||
arr[i] += 1
|
||||
arr
|
||||
|
||||
# To start counting from 1, change the next line!
|
||||
big_int = BcdInteger.from_string "199999999999999999999999999999999999999999999999999999"
|
||||
while true
|
||||
console.log BcdInteger.render big_int
|
||||
big_int = BcdInteger.succ big_int
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
> coffee foo.coffee | head -5
|
||||
199999999999999999999999999999999999999999999999999999
|
||||
200000000000000000000000000000000000000000000000000000
|
||||
200000000000000000000000000000000000000000000000000001
|
||||
200000000000000000000000000000000000000000000000000002
|
||||
200000000000000000000000000000000000000000000000000003
|
||||
|
|
@ -0,0 +1 @@
|
|||
(loop for i from 1 do (print i))
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
(defun pp (x) (pp (1+ (print x))))
|
||||
(funcall (compile 'pp) 1) ; it's less likely interpreted mode will eliminate tails
|
||||
7
Task/Integer-sequence/D/integer-sequence-1.d
Normal file
7
Task/Integer-sequence/D/integer-sequence-1.d
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import std.stdio, std.bigint;
|
||||
|
||||
void main() {
|
||||
BigInt i;
|
||||
while (true)
|
||||
writeln(++i);
|
||||
}
|
||||
36
Task/Integer-sequence/D/integer-sequence-2.d
Normal file
36
Task/Integer-sequence/D/integer-sequence-2.d
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
import std.stdio, std.traits, std.bigint, std.string;
|
||||
|
||||
void integerSequence(T)() if (isIntegral!T || is(T == BigInt)) {
|
||||
T now = 1;
|
||||
T max = 0;
|
||||
static if (!is(T == BigInt))
|
||||
max = T.max;
|
||||
|
||||
do
|
||||
write(now, " ");
|
||||
while (now++ != max);
|
||||
|
||||
writeln("\nDone!");
|
||||
}
|
||||
|
||||
void main() {
|
||||
writeln("How much time do you have?");
|
||||
writeln(" 0. I'm in hurry.");
|
||||
writeln(" 1. I've some time.");
|
||||
writeln(" 2. I'm on vacation.");
|
||||
writeln(" 3. I'm unemployed...");
|
||||
writeln(" 4. I'm immortal!");
|
||||
write("Enter 0-4 or nothing to quit: ");
|
||||
|
||||
string answer;
|
||||
readf("%s\n", &answer);
|
||||
|
||||
switch (answer.toLower()) {
|
||||
case "0": integerSequence!ubyte(); break;
|
||||
case "1": integerSequence!short(); break;
|
||||
case "2": integerSequence!uint(); break;
|
||||
case "3": integerSequence!long(); break;
|
||||
case "4": integerSequence!BigInt(); break;
|
||||
default: writeln("\nBye bye!"); break;
|
||||
}
|
||||
}
|
||||
4
Task/Integer-sequence/DWScript/integer-sequence.dwscript
Normal file
4
Task/Integer-sequence/DWScript/integer-sequence.dwscript
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
var i: Integer;
|
||||
|
||||
for i:=1 to High(i) do
|
||||
PrintLn(i);
|
||||
1
Task/Integer-sequence/Dc/integer-sequence.dc
Normal file
1
Task/Integer-sequence/Dc/integer-sequence.dc
Normal file
|
|
@ -0,0 +1 @@
|
|||
1[p1+lpx]dspx
|
||||
10
Task/Integer-sequence/Delphi/integer-sequence.delphi
Normal file
10
Task/Integer-sequence/Delphi/integer-sequence.delphi
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
program IntegerSequence;
|
||||
|
||||
{$APPTYPE CONSOLE}
|
||||
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
for i := 1 to High(i) do
|
||||
WriteLn(i);
|
||||
end.
|
||||
1
Task/Integer-sequence/E/integer-sequence.e
Normal file
1
Task/Integer-sequence/E/integer-sequence.e
Normal file
|
|
@ -0,0 +1 @@
|
|||
for i in int > 0 { println(i) }
|
||||
22
Task/Integer-sequence/Eiffel/integer-sequence.e
Normal file
22
Task/Integer-sequence/Eiffel/integer-sequence.e
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
class
|
||||
APPLICATION
|
||||
inherit
|
||||
ARGUMENTS
|
||||
create
|
||||
make
|
||||
feature {NONE} -- Initialization
|
||||
make
|
||||
-- Run application.
|
||||
do
|
||||
from
|
||||
number := 0
|
||||
until
|
||||
number = number.max_value
|
||||
loop
|
||||
print(number)
|
||||
print(", ")
|
||||
number := number + 1
|
||||
end
|
||||
end
|
||||
number:INTEGER_64
|
||||
end
|
||||
2
Task/Integer-sequence/Emacs-Lisp/integer-sequence.l
Normal file
2
Task/Integer-sequence/Emacs-Lisp/integer-sequence.l
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
(dotimes (i most-positive-fixnum)
|
||||
(message "%d" (1+ i)))
|
||||
1
Task/Integer-sequence/Erlang/integer-sequence.erl
Normal file
1
Task/Integer-sequence/Erlang/integer-sequence.erl
Normal file
|
|
@ -0,0 +1 @@
|
|||
F = fun(FF, I) -> io:format("~p~n", [I]), FF(FF, I + 1) end, F(F,0).
|
||||
6
Task/Integer-sequence/Euphoria/integer-sequence.euphoria
Normal file
6
Task/Integer-sequence/Euphoria/integer-sequence.euphoria
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
integer i
|
||||
i = 0
|
||||
while 1 do
|
||||
? i
|
||||
i += 1
|
||||
end while
|
||||
2
Task/Integer-sequence/Factor/integer-sequence.factor
Normal file
2
Task/Integer-sequence/Factor/integer-sequence.factor
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
USE: lists.lazy
|
||||
1 lfrom [ . ] leach
|
||||
12
Task/Integer-sequence/Fantom/integer-sequence.fantom
Normal file
12
Task/Integer-sequence/Fantom/integer-sequence.fantom
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
class Main
|
||||
{
|
||||
public static Void main()
|
||||
{
|
||||
i := 1
|
||||
while (true)
|
||||
{
|
||||
echo (i)
|
||||
i += 1
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Task/Integer-sequence/Fish/integer-sequence.fish
Normal file
2
Task/Integer-sequence/Fish/integer-sequence.fish
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
0>:n1+v
|
||||
^o" "<
|
||||
2
Task/Integer-sequence/Forth/integer-sequence.fth
Normal file
2
Task/Integer-sequence/Forth/integer-sequence.fth
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
: ints ( -- )
|
||||
0 begin 1+ dup cr u. dup -1 = until drop ;
|
||||
13
Task/Integer-sequence/Fortran/integer-sequence.f
Normal file
13
Task/Integer-sequence/Fortran/integer-sequence.f
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
program Intseq
|
||||
implicit none
|
||||
|
||||
integer, parameter :: i64 = selected_int_kind(18)
|
||||
integer(i64) :: n = 1
|
||||
|
||||
! n is declared as a 64 bit signed integer so the program will display up to
|
||||
! 9223372036854775807 before overflowing to -9223372036854775808
|
||||
do
|
||||
print*, n
|
||||
n = n + 1
|
||||
end do
|
||||
end program
|
||||
11
Task/Integer-sequence/GAP/integer-sequence.gap
Normal file
11
Task/Integer-sequence/GAP/integer-sequence.gap
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
InfiniteLoop := function()
|
||||
local n;
|
||||
n := 1;
|
||||
while true do
|
||||
Display(n);
|
||||
n := n + 1;
|
||||
od;
|
||||
end;
|
||||
|
||||
# Prepare some coffee
|
||||
InfiniteLoop();
|
||||
6
Task/Integer-sequence/GUISS/integer-sequence.guiss
Normal file
6
Task/Integer-sequence/GUISS/integer-sequence.guiss
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
Start,Programs,Accessories,Calculator,
|
||||
Button:[plus],Button:1,Button:[equals],Button:[plus],Button:1,Button:[equals],
|
||||
Button:[plus],Button:1,Button:[equals],Button:[plus],Button:1,Button:[equals],
|
||||
Button:[plus],Button:1,Button:[equals],Button:[plus],Button:1,Button:[equals],
|
||||
Button:[plus],Button:1,Button:[equals],Button:[plus],Button:1,Button:[equals],
|
||||
Button:[plus],Button:1,Button:[equals],Button:[plus],Button:1,Button:[equals]
|
||||
9
Task/Integer-sequence/Go/integer-sequence-1.go
Normal file
9
Task/Integer-sequence/Go/integer-sequence-1.go
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
for i := 1;; i++ {
|
||||
fmt.Println(i)
|
||||
}
|
||||
}
|
||||
13
Task/Integer-sequence/Go/integer-sequence-2.go
Normal file
13
Task/Integer-sequence/Go/integer-sequence-2.go
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"big"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func main() {
|
||||
one := big.NewInt(1)
|
||||
for i := big.NewInt(1);; i.Add(i, one) {
|
||||
fmt.Println(i)
|
||||
}
|
||||
}
|
||||
8
Task/Integer-sequence/Groovy/integer-sequence.groovy
Normal file
8
Task/Integer-sequence/Groovy/integer-sequence.groovy
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
// 32-bit 2's-complement signed integer (int/Integer)
|
||||
for (def i = 1; i > 0; i++) { println i }
|
||||
|
||||
// 64-bit 2's-complement signed integer (long/Long)
|
||||
for (def i = 1L; i > 0; i+=1L) { println i }
|
||||
|
||||
// Arbitrarily-long binary signed integer (BigInteger)
|
||||
for (def i = 1g; ; i+=1g) { println i }
|
||||
1
Task/Integer-sequence/Haskell/integer-sequence-1.hs
Normal file
1
Task/Integer-sequence/Haskell/integer-sequence-1.hs
Normal file
|
|
@ -0,0 +1 @@
|
|||
mapM_ print [1..]
|
||||
1
Task/Integer-sequence/Haskell/integer-sequence-2.hs
Normal file
1
Task/Integer-sequence/Haskell/integer-sequence-2.hs
Normal file
|
|
@ -0,0 +1 @@
|
|||
putStr $ unlines $ map show [1..]
|
||||
3
Task/Integer-sequence/Icon/integer-sequence.icon
Normal file
3
Task/Integer-sequence/Icon/integer-sequence.icon
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
procedure main()
|
||||
every write(seq(1)) # the most concise way
|
||||
end
|
||||
1
Task/Integer-sequence/J/integer-sequence-1.j
Normal file
1
Task/Integer-sequence/J/integer-sequence-1.j
Normal file
|
|
@ -0,0 +1 @@
|
|||
count=: (smoutput ] >:)^:_
|
||||
1
Task/Integer-sequence/J/integer-sequence-2.j
Normal file
1
Task/Integer-sequence/J/integer-sequence-2.j
Normal file
|
|
@ -0,0 +1 @@
|
|||
count=: (smoutput ] >:)@x:^:_
|
||||
5
Task/Integer-sequence/Java/integer-sequence-1.java
Normal file
5
Task/Integer-sequence/Java/integer-sequence-1.java
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
public class Count{
|
||||
public static void main(String[] args){
|
||||
for(long i = 1; ;i++) System.out.println(i);
|
||||
}
|
||||
}
|
||||
7
Task/Integer-sequence/Java/integer-sequence-2.java
Normal file
7
Task/Integer-sequence/Java/integer-sequence-2.java
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import java.math.BigInteger;
|
||||
|
||||
public class Count{
|
||||
public static void main(String[] args){
|
||||
for(BigInteger i = BigInteger.ONE; ;i = i.add(BigInteger.ONE)) System.out.println(i);
|
||||
}
|
||||
}
|
||||
4
Task/Integer-sequence/JavaScript/integer-sequence.js
Normal file
4
Task/Integer-sequence/JavaScript/integer-sequence.js
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
var i = 0;
|
||||
|
||||
while (true)
|
||||
document.write(++i + ' ');
|
||||
1
Task/Integer-sequence/Joy/integer-sequence.joy
Normal file
1
Task/Integer-sequence/Joy/integer-sequence.joy
Normal file
|
|
@ -0,0 +1 @@
|
|||
1 [0 >] [dup put succ] while pop.
|
||||
1
Task/Integer-sequence/K/integer-sequence-1.k
Normal file
1
Task/Integer-sequence/K/integer-sequence-1.k
Normal file
|
|
@ -0,0 +1 @@
|
|||
{`0:"\n",$x+:1;x}/1
|
||||
1
Task/Integer-sequence/K/integer-sequence-2.k
Normal file
1
Task/Integer-sequence/K/integer-sequence-2.k
Normal file
|
|
@ -0,0 +1 @@
|
|||
i:0; while[1;`0:"\n",$i+:1]
|
||||
1
Task/Integer-sequence/Lang5/integer-sequence.lang5
Normal file
1
Task/Integer-sequence/Lang5/integer-sequence.lang5
Normal file
|
|
@ -0,0 +1 @@
|
|||
0 do dup . 1 + loop
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
while 1
|
||||
i=i+1
|
||||
locate 1,1
|
||||
print i
|
||||
scan
|
||||
wend
|
||||
10
Task/Integer-sequence/Lua/integer-sequence.lua
Normal file
10
Task/Integer-sequence/Lua/integer-sequence.lua
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
i = 1
|
||||
|
||||
-- in the event that the number inadvertently wraps around,
|
||||
-- stop looping - this is unlikely with Lua's default underlying
|
||||
-- number type (double), but on platform without double
|
||||
-- the C type used for numbers can be changed
|
||||
while i > 0 do
|
||||
print( i )
|
||||
i = i + 1
|
||||
end
|
||||
1
Task/Integer-sequence/MATLAB/integer-sequence-1.m
Normal file
1
Task/Integer-sequence/MATLAB/integer-sequence-1.m
Normal file
|
|
@ -0,0 +1 @@
|
|||
a = 1; while (1) printf('%i\n',a); a=a+1; end;
|
||||
1
Task/Integer-sequence/MATLAB/integer-sequence-2.m
Normal file
1
Task/Integer-sequence/MATLAB/integer-sequence-2.m
Normal file
|
|
@ -0,0 +1 @@
|
|||
a = uint64(1); while (1) printf('%i\n',a); a=a+1; end;
|
||||
1
Task/Integer-sequence/MATLAB/integer-sequence-3.m
Normal file
1
Task/Integer-sequence/MATLAB/integer-sequence-3.m
Normal file
|
|
@ -0,0 +1 @@
|
|||
N = 2^30; printf('%d\n', 1:N);
|
||||
11
Task/Integer-sequence/ML-I/integer-sequence.ml
Normal file
11
Task/Integer-sequence/ML-I/integer-sequence.ml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
MCSKIP "WITH" NL
|
||||
"" Integer sequence
|
||||
"" Will overflow when it reaches implementation-defined signed integer limit
|
||||
MCSKIP MT,<>
|
||||
MCINS %.
|
||||
MCDEF DEMO WITHS NL AS <MCSET T1=1
|
||||
%L1.%T1.
|
||||
MCSET T1=T1+1
|
||||
MCGO L1
|
||||
>
|
||||
DEMO
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
x = 1;
|
||||
Monitor[While[True, x++], x]
|
||||
1
Task/Integer-sequence/Maxima/integer-sequence.maxima
Normal file
1
Task/Integer-sequence/Maxima/integer-sequence.maxima
Normal file
|
|
@ -0,0 +1 @@
|
|||
for i do disp(i);
|
||||
2
Task/Integer-sequence/Perl/integer-sequence.pl
Normal file
2
Task/Integer-sequence/Perl/integer-sequence.pl
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
my $i = 0;
|
||||
print ++$i, "\n" while 1;
|
||||
2
Task/Integer-sequence/PicoLisp/integer-sequence.l
Normal file
2
Task/Integer-sequence/PicoLisp/integer-sequence.l
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
(for (I 1 T (inc I))
|
||||
(printsp I) )
|
||||
4
Task/Integer-sequence/Prolog/integer-sequence-1.pro
Normal file
4
Task/Integer-sequence/Prolog/integer-sequence-1.pro
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
loop(I) :-
|
||||
writeln(I),
|
||||
I1 is I+1,
|
||||
loop(I1).
|
||||
5
Task/Integer-sequence/Prolog/integer-sequence-2.pro
Normal file
5
Task/Integer-sequence/Prolog/integer-sequence-2.pro
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
:- use_module(library(chr)).
|
||||
|
||||
:- chr_constraint loop/1.
|
||||
|
||||
loop(N) <=> writeln(N), N1 is N+1, loop(N1).
|
||||
4
Task/Integer-sequence/Python/integer-sequence-1.py
Normal file
4
Task/Integer-sequence/Python/integer-sequence-1.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
i=1
|
||||
while i:
|
||||
print(i)
|
||||
i += 1
|
||||
4
Task/Integer-sequence/Python/integer-sequence-2.py
Normal file
4
Task/Integer-sequence/Python/integer-sequence-2.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
from itertools import count
|
||||
|
||||
for i in count():
|
||||
print(i)
|
||||
48
Task/Integer-sequence/REXX/integer-sequence.rexx
Normal file
48
Task/Integer-sequence/REXX/integer-sequence.rexx
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*count all the protons, electrons, & whatnot in the universe, and then */
|
||||
/*keep counting. According to some pundits in-the-know, one version of */
|
||||
/*the big-bang theory is that the universe will collapse back to where */
|
||||
/*it started, and this computer program will be still counting. */
|
||||
/*┌────────────────────────────────────────────────────────────────────┐
|
||||
│ Count all the protons (and electrons!) in the universe, and then │
|
||||
│ keep counting. According to some pundits in-the-know, one version │
|
||||
│ of the big-bang theory is that the universe will collapse back to │
|
||||
│ where it started, and this computer program will still be counting.│
|
||||
│ │
|
||||
│ │
|
||||
│ According to Sir Author Eddington in 1938 at his Tamer Lecture at │
|
||||
│ Trinity Collecge (Cambridge), he postulated that there are exactly │
|
||||
│ │
|
||||
│ 136 ∙ 2^245 │
|
||||
│ │
|
||||
│ protons in the universe and the same number of electrons, which is │
|
||||
│ equal to around 1.57477e+79. │
|
||||
│ │
|
||||
│ Although, a modern extimate is around 10^80. │
|
||||
│ │
|
||||
│ │
|
||||
│ One estimate of the age of the universe is 13.7 billion years, │
|
||||
│ or 4.32e+17 seconds. This'll be a piece of cake. │
|
||||
└────────────────────────────────────────────────────────────────────┘*/
|
||||
numeric digits 1000000000 /*just in case the universe slows down. */
|
||||
|
||||
/*this version of a DO loop increments J*/
|
||||
do j=1 /*Sir Eddington's number, then a googol.*/
|
||||
say j /*first, destroy some electrons. */
|
||||
end
|
||||
say 42 /*(see below for explanation of 42.) */
|
||||
exit
|
||||
|
||||
/*This REXX program (as it will be limited to the NUMERIC DIGITS above, */
|
||||
/*will only count up to 1000000000000000000000000000000000000000000... */
|
||||
/*000000000000000000000000000000000000000000000000000000000000000000000 */
|
||||
/* ... for another (almost) one billion more zeroes (then subtract 1).*/
|
||||
|
||||
/*if we can count 1,000 times faster than the fastest PeeCee, and we */
|
||||
/*started at the moment of the big-bang, we'd be at only 1.72e+28, so */
|
||||
/*we still have a little ways to go, eh? */
|
||||
|
||||
/*To clarify, we'd be 28 zeroes into a million zeroes. If PC's get */
|
||||
/*1,000 times faster again, that would be 31 zeroes into a million. */
|
||||
|
||||
/*It only took Deep Thought 7.5 million years to come up with the */
|
||||
/*answer to everything (and it double-checked the answer). It was 42.*/
|
||||
3
Task/Integer-sequence/Racket/integer-sequence.rkt
Normal file
3
Task/Integer-sequence/Racket/integer-sequence.rkt
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#lang racket
|
||||
|
||||
(for ([i (in-naturals)]) (display (~a i "\n")))
|
||||
2
Task/Integer-sequence/Ruby/integer-sequence.rb
Normal file
2
Task/Integer-sequence/Ruby/integer-sequence.rb
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
i = 0
|
||||
puts(i += 1) while true
|
||||
1
Task/Integer-sequence/Scala/integer-sequence.scala
Normal file
1
Task/Integer-sequence/Scala/integer-sequence.scala
Normal file
|
|
@ -0,0 +1 @@
|
|||
Stream from 1 foreach println
|
||||
3
Task/Integer-sequence/Scheme/integer-sequence.ss
Normal file
3
Task/Integer-sequence/Scheme/integer-sequence.ss
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
(let loop ((i 1))
|
||||
(display i) (newline)
|
||||
(loop (+ 1 i)))
|
||||
5
Task/Integer-sequence/Smalltalk/integer-sequence.st
Normal file
5
Task/Integer-sequence/Smalltalk/integer-sequence.st
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
i := 0.
|
||||
[
|
||||
Stdout print:i; cr.
|
||||
i := i + 1
|
||||
] loop
|
||||
2
Task/Integer-sequence/Tcl/integer-sequence.tcl
Normal file
2
Task/Integer-sequence/Tcl/integer-sequence.tcl
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
package require Tcl 8.5
|
||||
while true {puts [incr i]}
|
||||
Loading…
Add table
Add a link
Reference in a new issue