Skip to content

Instantly share code, notes, and snippets.

@chrisguitarguy
Last active August 29, 2015 14:21
Show Gist options
  • Select an option

  • Save chrisguitarguy/ce0c678455bec4efe43a to your computer and use it in GitHub Desktop.

Select an option

Save chrisguitarguy/ce0c678455bec4efe43a to your computer and use it in GitHub Desktop.
PMG 2015-05-13 dev "challenge"
(loop [rng (range 10)]
(when-let [i (first rng)]
(println (apply str (repeat i i)))
(recur (rest rng))))
package main
import (
"fmt"
"strings"
)
func main() {
for i := 1; i < 10; i++ {
fmt.Println(strings.Repeat(fmt.Sprintf("%d", i), i))
}
}
<?php
foreach (range(1, 9) as $i) {
echo implode('', array_fill(0, $i, $i)), PHP_EOL;
}
for i in range(1, 10):
print(str(i) * i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment