Logo

Programming-Idioms

This method sets the internal board to the given 2D array aBoard.
New implementation

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating material.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
with Ada.Text_IO;
use Ada.Text_IO;
for I in 1 .. 10 loop
  Put_Line ("Hello");
end loop;
#include <stdio.h>
for (int i = 0; i < 10; i++) {
    printf("%d", "Hello\n");
}
let rec n_hellos
    (n : int)
  : unit =
  if n = 0 then
    ()
  else
    (print_endline "Hello";
    n_hellos (n-1))

n_hello_worlds 10
(dotimes [_ 10]
  (println "Hello"))
IDENTIFICATION DIVISION.
PROGRAM-ID. hello 10 times.
PROCEDURE DIVISION.
PERFORM 10 TIMES
   DISPLAY "Hello"
END-PERFORM
STOP RUN.
#include <iostream>
using namespace std;
for (int i = 0; i < 10; ++i)
  cout << "Hello\n";
#include <cstdio>
char* a {"Hello"};
for (int i {}; i != 10; ++i)
    printf("%s\n", a);
#include <iostream>
std::string a {"Hello"};
char const* p {a.data()};
for (int i {}; i != 10; ++i)
    printf("%s\n", p);
using System;
using System.Linq;
Console.WriteLine( string.Concat(Enumerable.Repeat("Hello\n", 10)) );
using System;
using System.Linq;
Console.WriteLine(string.Join(Environment.NewLine, Enumerable.Repeat("Hello", 10)));
using System;
for (int i = 0; i < 10; i++)
{
    Console.WriteLine("Hello");
}
import std.stdio : writeln;
import std.range : iota;
import std.algorithm.iteration : each;
iota(0,10).each!(a => "Hello".writeln);
import std.stdio;
foreach(i; 0..10)
  writeln("Hello");
print("Hello\n" * 10);
for (var i = 0; i < 10; i++)
  print("Hello");
1..10 |> Enum.each(fn _ -> IO.puts "Hello" end)
lists:foreach(
  fun(_) ->
    io:format("Hello~n")
  end, lists:seq(1, 10)).
program main
  implicit none
  integer :: i
  do i=1,10
    write (*,'(A)') "Hello"
  end do
end program main
import "fmt"
import "strings"
fmt.Println(strings.Repeat("Hello\n", 10))
import "fmt"
for range 10 {
	fmt.Println("Hello")
}
import "fmt"
for i := 0; i < 10; i++ {
	fmt.Println("Hello")
}
10.times {
    println 'Hello'
}​
import Control.Monad
replicateM_ 10 $ putStrLn "Hello"
for (let i = 0; i < 10; i++) {
  console.log("Hello");
}
[...Array(10)].forEach(() => console.log('Hello'))
let count = 0;
while (count < 10) {
  count++; 
  console.log('Hello');
};
console.log( 'Hello\n'.repeat(10) )
import static java.lang.System.out;
int i = 0;
while (i++ < 10) out.println("Hello");
for(int i=0;i<10;i++)
  System.out.println("Hello");
import static java.lang.System.out;
for (int i = 0; i++ < 10; out.println("Hello"));
System.out.print("Hello\n".repeat(10));
import static java.lang.System.out;
int i = 0;
do out.println("Hello");
while (i++ < 10);
import static java.util.stream.IntStream.range;
range(0, 10).forEach(x -> out.println("Hello"));
import static java.lang.System.out;
import static java.util.stream.Stream.generate;
generate(() -> "Hello%n")
    .limit(10)
    .forEach(out::printf);
for(x in 1..10) {
     println("Hello")
}
(0..9).forEach {
    println("Hello")
}
repeat(10) {
    println("Hello")
}
(loop repeat 10 do (write-line "Hello"))
print(string.rep("Hello\n", 10))
local i = 0
repeat
	i = i + 1
	print("Hello")
until i == 10
for i=1, 10 do
	print('Hello')
end
print(("Hello\n"):rep(10))
for (NSInteger i=0;i<10;i++){
NSLog(@"Hello");
}
foreach(range(1, 10) as $i)
  echo 'Hello'. PHP_EOL;
for ($i = 0; $i < 10; $i++) {
    echo 'Hello' . PHP_EOL;
}
var
  i: integer;
begin
  for i:=1 to 10 do
    WriteLn('Hello');
end;
print "Hello\n" for 1 .. 10;
say "Hello" for 1 .. 10;
print "Hello\n" x 10;
:- initialization(main).
main :- loop(10).

loop(0).
loop(N) :- N>0, write('Hello') , nl, N1 = N - 1, loop(N1).
def f(count=10):
    print('Hello')
    if count == 1:
        return
    f(count - 1)
f()
i = 0
while i < 10:
    print('Hello')
    i += 1
from itertools import repeat
from os import linesep
print(*repeat('Hello', 10), sep=linesep)
print("Hello\n"*10)
print(*('Hello',) * 10, sep='\n')
for _ in range(10):
    print("Hello")
puts "Hello\n" * 10
10.times { puts 'Hello' }
10.times do
  puts "Hello"
end
for _ in 0..10 { println!("Hello"); }
print!("{}", "Hello\n".repeat(10));
(0 until 10).foreach( _ => println("Hello"))
println("Hello\n"*10)
(do ((i 0 (+ i 1)))
    ((= i 10))
  (display "Hello")
  (newline))
(for-each (lambda (x) (display "Hello\n")) (iota 10))
(define (hellos i)
        (if (> i 0)    
            (begin
                (display "Hello")
                (newline)
                (hellos (- i 1)))))
(hellos 10)
10 timesRepeat: [Transcript showln: 'Hello'].
SudokuSolver >> board: aBoard
    board := aBoard.
Imports System
For x = 1 To 10
    Console.WriteLine("Hello")
Next x