Daily programming challenge #4 ASCII-ART

in #programming8 years ago

Difficulty: easy

Code a programm, which generates a Christmas tree as ASCII-Art.

EXAMPLE:


                               x
                              xxx
                             xxxxx
                            xxxxxxx
                           xxxxxxxxx
                          xxxxxxxxxxx
                         xxxxxxxxxxxxx
                              HH

NO ARRAYS ALLOWED!

Instead, use a while or for loop.

Extensions:
EXTENSION1:
Generate little Christmas tree balls. For this, use the Character "O". This should happen based on a set probability.

EXTENSION2:

Ask the user to input the probability of EXTENSION1.

EXTENSION3:

Make the tree move. For this, flush the Shell (on Linux Terminal) and regenerate another tree.

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 63635.72
ETH 2597.20
USDT 1.00
SBD 2.91