I'm now at 21!
Python on the TI-84+ CE, 915 bytes.
Code: from ti_system import *
import ti_plotlib as plt
from random import *
def deco():
dec=[" ","o","c"," ","*","<"," ","I"]
p=randint(0,7)
d=dec[p]
return d
plt.cls()
plt.text_at(1,"* ","center")
plt.text_at(2,"_/ \_ ","center")
plt.text_at(3,"\ / ","center")
plt.text_at(4,"/_/^\_\ ","center")
plt.text_at(10,"/-------------\ ","center")
plt.text_at(11,"[-------] ","center")
plt.text_at(12,"\_____/ ","center")
while not escape():
a="/{} {}\ "
b=a.format(deco(),deco())
plt.text_at(5,b,"center")
a="/{} {}{} \ "
b=a.format(deco(),deco(),deco())
plt.text_at(6,b,"center")
a="/{}{} {} {} \ "
b=a.format(deco(),deco(),deco(),deco())
plt.text_at(7,b,"center")
a="/ {} {}{} {} {}\ "
b=a.format(deco(),deco(),deco(),deco(),deco())
plt.text_at(8,b,"center")
a="/{} {} {}{} {} {} \ "
b=a.format(deco(),deco(),deco(),deco(),deco(),deco())
plt.text_at(9,b,"center")
Screenshot :
Shel script (482 bytes):
Code: #!/bin/sh
for (( ;; ))
do
d () {
a=$((RANDOM %= 8))
b=("." "O" "C" "." "+" "<" "." "I")
d=${b[$a]}
echo $d
}
clear
echo " *"
echo " _/ \_"
echo " \ /"
echo " /_/^\_\ "
echo " /$(d) $(d)\ "
echo " /$(d) $(d)$(d) \ "
echo " /$(d)$(d) $(d) $(d) \ "
echo " / $(d) $(d)$(d) $(d) $(d)\ "
echo " /$(d) $(d) $(d)$(d) $(d) $(d) \ "
echo " /-------------\ "
echo " [_______]"
echo " \_____/"
sleep .5
done
screenshot:
C (700 bytes)(looks similar to the shell script):
Code: #include<stdio.h>
#include<time.h>
#include<stdlib.h>
#include<unistd.h>
char* te() {
char* list[7]={".","+","C",".","O","*"," "};
char* f=list[((rand())%7)];
return f;
}
int main(void)
{
srandom(time(NULL));
for (;;){
system("clear");
printf(" *\n _/ \\_\n \\ /\n /_/^\\_\\ \n%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s"," /",te()," ",te(),"\\ \n"," /",te()," ",te(),te()," \\ \n"," /",te(),te()," ",te()," ",te()," \\ \n"," / ",te()," ",te(),te()," ",te()," ",te(),"\\ \n"," /",te()," ",te()," ",te(),te()," ",te()," ",te()," \\ \n /-------------\\ \n [_______]\n \\_____/\n");
sleep(1);}}
C++ (650 bytes):
Code: #include <iostream>
#include <ctime>
#include <cstdlib>
#include <unistd.h>
using namespace std;
char o(){
char l[7]={'.','+','C','.','O','*',' '};
int a=(rand() % 7);char d=l[a];return d;}
int main() {
srand((int) time(0));
for(;;){
cout << " *\n _/ \\_\n \\ /\n /_/^\\_\\ \n /"<<o()<<" "<<o()<<"\\\n /"<<o()<<" "<<o()<<o()<<" \\\n /"<<o()<<o()<<" "<<o()<<" "<<o()<<" \\\n / "<<o()<<" "<<o()<<o()<<" "<<o()<<" "<<o()<<"\\\n /"<<o()<<" "<<o()<<" "<<o()<<o()<<" "<<o()<<" "<<o()<<" \\\n /-------------\\ \n [_______]\n \\_____/\n";
sleep(1);system("clear");}
return 0;
}
C# (1177 bytes):Code: using System;
using System.Threading;
namespace Tree
{class bla{ static string b(){
string[] l={".","+","C",".","O","*"," "};
Random Random = new Random();int a=(Random.Next()%7);string d=l[a];return d;}
static void Main(string[] args)
{for (;;){Console.Clear();Console.Write(" *\n _/ \\_\n \\ /\n /_/^\\_\\ \n /");Console.Write(b());Console.Write(" ");Console.Write(b());Console.Write("\\\n /");Console.Write(b());Console.Write(" ");Console.Write(b());Console.Write(b());Console.Write(" \\\n /");Console.Write(b());Console.Write(b());Console.Write(" ");Console.Write(b());Console.Write(" ");Console.Write(b());Console.Write(" \\\n / ");Console.Write(b());Console.Write(" ");Console.Write(b());Console.Write(b());Console.Write(" ");Console.Write(b());Console.Write(" ");Console.Write(b());Console.Write("\\\n /");Console.Write(b());Console.Write(" ");Console.Write(b());Console.Write(" ");Console.Write(b());Console.Write(b());Console.Write(" ");Console.Write(b());Console.Write(" ");Console.Write(b());Console.Write(" \\\n /-------------\\ \n [_______]\n \\_____/\n");Thread.Sleep(500);}}}}
Go (596 bytes):
Code: package main
import (
"fmt"
"math/rand"
"time"
)
func d() string{
list:=[7]string{".","+","C",".","O","*"," "};
f:=list[rand.Intn(7)];
return f;
}
func main() {
for {
rand.Seed(time.Now().UTC().UnixNano());
fmt.Print(" *\n _/ \\_\n \\ /\n /_/^\\_\\ \n /"+d()+" "+d()+"\\ \n /"+d()+" "+d()+d()+" \\ \n /"+d()+d()+" "+d()+" "+d()+" \\ \n / "+d()+" "+d()+d()+" "+d()+" "+d()+"\\ \n /"+d()+" "+d()+" "+d()+d()+" "+d()+" "+d()+" \\ \n /-------------\\ \n [_______]\n \\_____/\n");
time.Sleep(500 * time.Millisecond);
}
}
Kotlin (639 bytes):
Code: package org.kotlinlang.play
import kotlin.random.Random
fun d(): String {
var a: List<String> = listOf(".","+","C",".","O","*"," ");
val r = Random(System.nanoTime());
var q: Int = (0..6).random(r)
var f: String =a[q];
return f;
}
fun main() {
while (1!=2){
print(" *\n _/ \\_\n \\ /\n /_/^\\_\\ \n /"+d()+" "+d()+"\\ \n /"+d()+" "+d()+d()+" \\ \n /"+d()+d()+" "+d()+" "+d()+" \\ \n / "+d()+" "+d()+d()+" "+d()+" "+d()+"\\ \n /"+d()+" "+d()+" "+d()+d()+" "+d()+" "+d()+" \\ \n /-------------\\ \n [_______]\n \\_____/\n");
Thread.sleep(500);
}
}
Nim (530 bytes):
Code: import random, times, os
randomize()
proc d(): string =
let a = rand(7)
var b: array[0..7, string]
b = [".","O","C",".","+","<",".","I"]
let c = b[a]
result = c
while 1 != 2:
echo " *\n _/ \\_\n \\ /\n /_/^\\_\\ \n /",d()," ",d(),"\\ \n /",d()," ",d(),d()," \\ \n /",d(),d()," ",d()," ",d()," \\ \n / ",d()," ",d(),d()," ",d()," ",d(),"\\ \n /",d()," ",d()," ",d(),d()," ",d()," ",d()," \\ \n /-------------\\ \n [_______]\n \\_____/\n"
sleep(1)
Perl (496 bytes):
Code: #!/usr/bin/perl
sub d() {
$a=int(rand(7));
@b=(".","O","C",".","+","<",".","I");
$c=$b[$a];
return $c;
}
while(1!=2){
system("clear");
print " *\n _/ \\_\n \\ /\n /_/^\\_\\ \n /".d()." ".d()."\\ \n /".d()." ".d().d()." \\ \n /".d().d()." ".d()." ".d()." \\ \n / ".d()." ".d().d()." ".d()." ".d()."\\ \n /".d()." ".d()." ".d().d()." ".d()." ".d()." \\ \n /-------------\\ \n [_______]\n \\_____/\n";
sleep(1);}
Ruby (386 bytes ):
Code: a = [".","O","C",".","+","<",".","I","e"]
b = " *\n _/ \\_\n \\ /\n /_/^\\_\\ \n / d\\ \n /q de \\ \n /dd e q \\ \n / d ed q d\\ \n /d e qd e d \\ \n /-------------\\ \n [_______]\n \\_____/\n"
while 1!=2 do
puts b.gsub("d", a[(rand() * 8).to_i]).gsub("e", a[(rand() * 7).to_i]).gsub("q", a[(rand() * 7).to_i])
end
Moonscript (345 bytes):
Code: d = ->
a={".","+","C",".","O","*"," "}
b=math.random(1,7)
c=a[b]
return c
print(" *\n _/ \\_\n \\ /\n /_/^\\_\\ \n /",d(),"\\ \n /",d(),d(),"\\ \n /",d(),d(),d(),"\\ \n /",d(),d(),d(),d(),"\\ \n /",d(),d(),d(),d(),d(),"\\ \n /-------------\\ \n [_______]\n \\_____/\n")
Swift (381 bytes):
Code: func d() -> String {
var a = [".","+","C",".","O","*"," "]
let b = Int.random(in: 0..<7)
return a[b]
}
print(" *\n _/ \\_\n \\ /\n /_/^\\_\\ \n /",d(),"\\ \n /",d(),d(),"\\ \n /",d(),d(),d(),"\\ \n /",d(),d(),d(),d(),"\\ \n /",d(),d(),d(),d(),d(),"\\ \n /-------------\\ \n [_______]\n \\_____/\n")
bash (474 bytes):
Code: for (( ;; ))
do
d () {
a=$((RANDOM %= 8))
b=("." "O" "C" "." "+" "<" "." "I")
d=${b[$a]}
echo $d
}
clear
echo " *"
echo " _/ \_"
echo " \ /"
echo " /_/^\_\ "
echo " /$(d) $(d)\ "
echo " /$(d) $(d)$(d) \ "
echo " /$(d)$(d) $(d) $(d) \ "
echo " / $(d) $(d)$(d) $(d) $(d)\ "
echo " /$(d) $(d) $(d)$(d) $(d) $(d) \ "
echo " /-------------\ "
echo " [_______]"
echo " \_____/"
sleep .5
done
squirrel (463 bytes):
Code: function d(){
local a = [".","+","C",".","O","*"," "];
local b = rand()%7;
return a[b];
}
srand(time());
while (1!=2) {
print(" *\n _/ \\_\n \\ /\n /_/^\\_\\ \n /"+d()+" "+d()+"\\ \n /"+d()+" "+d()+d()+" \\ \n /"+d()+d()+" "+d()+" "+d()+" \\ \n / "+d()+" "+d()+d()+" "+d()+" "+d()+"\\ \n /"+d()+" "+d()+" "+d()+d()+" "+d()+" "+d()+" \\ \n /-------------\\ \n [_______]\n \\_____/\n");
}
pike (563 bytes):
Code: string d(){
array(string) a;
a = ({".","O","C",".","+","<",".","I","e"});
return a[random(7)];}
int main()
{
GTK.setup_gtk();
GTK.Alert(" *\n _/ \\_\n \\ /\n /_/^\\_\\ \n /%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",d()," ",d(),"\\ \n /",d()," ",d(),d()," \\ \n /",d(),d()," ",d()," ",d()," \\ \n / ",d()," ",d(),d()," ",d()," ",d(),"\\ \n /",d()," ",d()," ",d(),d()," ",d()," ",d()," \\ \n /-------------\\ \n [_______]\n \\_____/\n");
return -1;
}
rust (551 bytes):
Code: fn d() -> char{
let a = ['.','+','C','.','O','*',' '];
let b: usize = rand::random::<usize>()%7;
return a[b];
}
fn main() {
print!(" *\n _/ \\_\n \\ /\n /_/^\\_\\ \n /{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",d()," ",d(),"\\ \n /",d()," ",d(),d()," \\ \n /",d(),d()," ",d()," ",d()," \\ \n / ",d()," ",d(),d()," ",d()," ",d(),"\\ \n /",d()," ",d()," ",d(),d()," ",d()," ",d()," \\ \n /-------------\\ \n [_______]\n \\_____/\n");
}
eC (564 bytes):
Code: import "ecere";
class A : Application
{
char* d(){
static char* a[] = {".","O","C",".","+","<",".","I"};
char* b = a[random()%7];
return b;
}
void Main()
{
DateTime time;
srandom(time.GetLocalTime());
Print(" *\n _/ \\_\n \\ /\n /_/^\\_\\ \n /",d()," ",d(),"\\ \n /",d()," ",d(),d()," \\ \n /",d(),d()," ",d()," ",d()," \\ \n / ",d()," ",d(),d()," ",d()," ",d(),"\\ \n /",d()," ",d()," ",d(),d()," ",d()," ",d()," \\ \n /-------------\\ \n [_______]\n \\_____/\n");
}
}
D (508 bytes):
Code: import std.stdio;
import std.random;
auto d(){
auto rnd = Random(unpredictableSeed);
auto d = [".","O","C",".","+","<",".","I"].choice(rnd);
return d;}
void main()
{
write(" *\n _/ \\_\n \\ /\n /_/^\\_\\ \n /",d()," ",d(),"\\ \n /",d()," ",d(),d()," \\ \n /",d(),d()," ",d()," ",d()," \\ \n / ",d()," ",d(),d()," ",d()," ",d(),"\\ \n /",d()," ",d()," ",d(),d()," ",d()," ",d()," \\ \n /-------------\\ \n [_______]\n \\_____/\n");
}
Fantom (488 bytes):
Code: class Tree
{
static Str d()
{
Str[] a:=[".","O","C",".","+","<",".","I","e"]
return a[Int.random(0..6)]
}
static Void main()
{
echo(" *\n _/ \\_\n \\ /\n /_/^\\_\\ \n /"+d()+" "+d()+"\\ \n /"+d()+" "+d()+d()+" \\ \n /"+d()+d()+" "+d()+" "+d()+" \\ \n / "+d()+" "+d()+d()+" "+d()+" "+d()+"\\ \n /"+d()+" "+d()+" "+d()+d()+" "+d()+" "+d()+" \\ \n /-------------\\ \n [_______]\n \\_____/\n")
}
}
Haxe (566 bytes):
Code: import Random;
class Main {
static public function d():String {
var a;
var b;
a = [".","O","C",".","+","<",".","I","e"];
b = a[Random.int(0,6)];
return b;
}
static public function main():Void {
trace(" *\n _/ \\_\n \\ /\n /_/^\\_\\ \n /"+d()+" "+d()+"\\ \n /"+d()+" "+d()+d()+" \\ \n /"+d()+d()+" "+d()+" "+d()+" \\ \n / "+d()+" "+d()+d()+" "+d()+" "+d()+"\\ \n /"+d()+" "+d()+" "+d()+d()+" "+d()+" "+d()+" \\ \n /-------------\\ \n [_______]\n \\_____/\n");
}
}
Odin (637 bytes):
Code: package main
import "core:fmt"
import "core:math/rand"
import "core:time"
d :: proc() -> string {
n := time.now();
seed := u64(time.diff({}, n));
state := rand.Rand{};
rand.init(&state, seed);
a := [8]string{".","O","C",".","+","<",".","I"};
return a[rand.uint32(&state)%7];
}
main :: proc() {
fmt.print(" *\n _/ \\_\n \\ /\n /_/^\\_\\ \n /",d()," ",d(),"\\ \n /",d()," ",d(),d()," \\ \n /",d(),d()," ",d()," ",d()," \\ \n / ",d()," ",d(),d()," ",d()," ",d(),"\\ \n /",d()," ",d()," ",d(),d()," ",d()," ",d()," \\ \n /-------------\\ \n [_______]\n \\_____/\n");
}
The worst version possible in JavaScript (1505 bytes):
Code: function deco(){
p = Math.floor((Math.random() * 8) + 1);
var dec=[" ","o","c"," ","*","<"," ","I"];
var d=dec[p];
return d}
document.write("ERROR: CHRISTMAS TIME");
document.write(String.raw`<br>
* <br>
_/ \_ <br>
\ / <br>
/_/^\_\ <br>`.fixed());
a=String.raw` /1 2\ <br>`;
b=a.replace("1",deco());
c=b.replace("2",deco());
d=c.fixed();
document.write(d);
a=String.raw` /1 23 \ <br>`;
b=a.replace("1",deco());
c=b.replace("2",deco());
d=c.replace("3",deco());
e=d.fixed();
document.write(e);
a=String.raw` /12 3 4 \ <br>`;
b=a.replace("1",deco());
c=b.replace("2",deco());
d=c.replace("3",deco());
e=d.replace("4",deco());
f=e.fixed();
document.write(f);
a=String.raw` / 1 23 4 5\ <br>`;
b=a.replace("1",deco());
c=b.replace("2",deco());
d=c.replace("3",deco());
e=d.replace("4",deco());
f=e.replace("5",deco());
g=f.fixed();
document.write(g);
a=String.raw` /1 2 34 5 6 \ <br>`;
b=a.replace("1",deco());
c=b.replace("2",deco());
d=c.replace("3",deco());
e=d.replace("4",deco());
f=e.replace("5",deco());
g=f.replace("6",deco());
h=g.fixed();
document.write(h);
document.write(String.raw`/-------------\<br> [_____]<br> \_____/`.fixed());