[Question]
  [
You know—they look like this:
[![](https://i.stack.imgur.com/t4uJx.jpg)](https://i.stack.imgur.com/t4uJx.jpg)
[source](http://covers8.com/sound-equalizer-rhythm-music-beats/)
The goal is to draw a music beats illustration like the following:
```
=     =      =
=  =  =      =          =
== = ==   =  ==     = ====
== ====  == ===   = = =======
======== == ====  = ========= =
=================================
```
The rules are:
* The width of the illustration is 33 symbols, but if you need—any trailing spaces exceeding this width are allowed.
* Each column is made of equals signs (`=`).
* Each column has a **random height** (the height of the next column shouldn’t depend in any way on the height of the previous column), varying from 1 to 6. It’s also fine if it’s at least *possible* to get some input with no strict math probability (i.e. some inputs could appear more rarely than others).
* A column *can’t* float above the bottom and have gaps in it.
* Since every column has the minimal height of 1, the last row can’t have any gaps either—it always consists of 33 equals signs.
* Since it’s possible to have no columns with the height of 6 (it’s all random after all): in this case you don’t need to have a top line made of spaces. Applies to any edge cases of this nature: if suddenly your code provided no columns with the height greater than 1, you don’t need to have additional lines made of spaces above the bottom line.
* **You don’t take any input**.
  
[Answer]
# [Dyalog APL](http://goo.gl/9KrKoM), 14 [bytes](http://meta.codegolf.stackexchange.com/a/9429/43319)
```
⊖⍉↑'='⍴¨⍨?33⍴6
```
### Explanation
`33⍴6` 33 repetitions of 6
`?` random integer in range [1,*n*] for each of the 33 6s
`'='⍴¨⍨` equality symbol repeated each of those number of times
`↑` convert list of lists to table of rows
`⍉` transpose rows into columns, columns into rows
`⊖` flip upside down
### Example runs
Input is indented six spaces:
```
      ⊖⍉↑'='⍴¨⍨?33⍴6
=          ==        =      ==   
= =    =   ==      ====     ==   
= = = ===  ==  === ==== =  ===  =
= = ===== ==== === ==== = ====  =
=== ============== ==== ====== ==
=================================
      ⊖⍉↑'='⍴¨⍨?33⍴6
         =  =  =    =    =       
  =      =  =  ==  == == =  =    
 === == ==  =  === =======  =    
==== == ==  ====== ==========   =
==== ============= ========== = =
=================================
      ⊖⍉↑'='⍴¨⍨?33⍴6
             =    =   =  =       
         =   =    =   = == =     
=      = =   =    ==  = ==== === 
= = =  = =   =    ==  = ==== ====
=====  = == ==  ============ ====
=================================
```
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 13 bytes
And I [outgolfed Jelly](https://codegolf.stackexchange.com/a/85068/48934).
```
j_.tm*hO6\=33
```
[Try it online!](http://pyth.herokuapp.com/?code=j_.tm%2ahO6%5C%3D33&debug=0)
```
j_.tm*hO6\=33
    m      33  for 33 times:
       O6          yield a random number in [0,1,2,3,4,5].
      h            add one.
     *   \=        repeat "=" that number of times.
  .t           transpose, filling with whitespace
 _             reverse
j              join by newlines.
```
[Answer]
# JavaScript (ES6), 116 bytes
```
(a=Array(33).fill``.map(_=>[,,,,,,].fill` `.fill('=',Math.random()*6)))[0].map((x,i)=>a.map(x=>x[i]).join``).join`
`
```
![Snippet preview](https://i.stack.imgur.com/o3CW1.png)
Check it out in the animated snippet below:
```
F = () => (a=Array(33).fill``.map(_=>[,,,,,,].fill` `.fill('=',Math.random()*6)))[0].map((x,i)=>a.map(x=>x[i]).join``).join`
`
var interval;
G = () => output.innerHTML = F().split('\n').map((r, i) => `<span id="row-${6-i}">${r}</span>`).join('\n');
A = () => {
  clearInterval(interval);
  if (auto.checked) {
    speed.disabled = false;
    interval = setInterval(G, speed.value);
  } else {
    speed.disabled = true;
  }
}
S = () => {
  if (stylized.checked) {
    output.classList.add('stylized');
  } else {
    output.classList.remove('stylized');
  }
}
generate.onclick = G;
auto.onchange = speed.onchange = A;
stylized.onchange = S;
G();
A();
S();
```
```
#output {
  background: #000;
  color: #9fff8a;
  overflow: hidden;
  padding: 1em;
  line-height: 1;
}
#output.stylized {
  line-height: 0.25;
  font-size: 2em;
  margin: 0.5em 0 0 0;
  padding: 0.5em;
}
.stylized #row-1 { color: #9fff8a; }
.stylized #row-2 { color: #c5ff8a; }
.stylized #row-3 { color: #e0ff8a; }
.stylized #row-4 { color: #ffe88a; }
.stylized #row-5 { color: #ffc28a; }
.stylized #row-6 { color: #ff8a8a; }
```
```
<button id="generate">Generate</button>
<label>Auto: <input id="auto" type="checkbox" checked/></label>
<label>Speed: <select id="speed">
  <option value="25">25</option>
  <option value="50">50</option>
  <option value="100" selected>100</option>
  <option value="200">200</option>
  <option value="400">400</option>
  <option value="600">600</option>
  <option value="800">800</option>
  <option value="1000">1000</option>
</select></label>
<label>Stylized: <input id="stylized" type="checkbox" checked/></label>
<pre id="output"></pre>
```
[Answer]
# Jelly, 14 bytes
```
6x33X€”=ẋz⁶Ṛj⁷
```
[Try it here.](http://jelly.tryitonline.net/#code=NngzM1jigqzigJ094bqLeuKBtuG5mmrigbc&input=)
[Answer]
# C, 87 bytes
```
f(x,y){for(y=6;y--;){srand(time(0));for(x=33;x--;)putchar("= "[rand()%6<y]);puts("");}}
```
Call as `f();`. This answer relies on the fact that six consecutive calls to `time(0)` return the same result (in seconds). This is virtually always true, but probably worth mentioning.
[Answer]
## Cheddar, ~~68~~ 65 bytes (non-competing)
```
->(1:33).map(->IO.sprintf("%6s","="*Math.rand(1,7))).turn().vfuse
```
O\_O Cheddar is actually doing good! Uses `sprintf` and `turn` to do a bulk of the work. `vfuse` is vertical-fuse meaning it joins the array but vertically. This is very golfy but also rather fast. Version is prerelease v[1.0.0-beta.10](https://github.com/cheddar-lang/Cheddar/releases/tag/v1.0.0-beta.10), which post-dates the challenge.
## Explanation
```
->           // Anonymous function
  (1:33)     // Range 1-33 inclusive
  .map(->    // Loop through the above range
    IO.sprintf("%6s",       // `sprintf` from C/C++
      "="*Math.rand(1,7)    // Repeat `=` a random time from [1,7)
    )
  ).turn().vfuse     // Turn it 90deg, and fuse it vertically
```
Some example runs:
[![enter image description here](https://i.stack.imgur.com/13iNL.png)](https://i.stack.imgur.com/13iNL.png)
[Answer]
# [05AB1E](http://github.com/Adriandmen/05AB1E), 22 bytes
No auto joining, no automatic filling while transposing, osabie is doomed on this one. Code:
```
33F6ð×6L.R'=×ðñ})ø€J¶ý
```
Uses the **CP-1252** encoding. [Try it online!](http://05ab1e.tryitonline.net/#code=MzNGNsOww5c2TC5SJz3Dl8Oww7F9KcO44oKsSsK2w70&input=).
[Answer]
# Python 2, 95 bytes
```
from random import*
x=map(randrange,[6]*33)
for y in range(6):print''.join('= '[z>y]for z in x)
```
[Answer]
# Python 3, 115 bytes
Python never even had a chance...
```
from random import*
for k in zip(*[[' ']*(6-len(j))+j for j in[randint(1,6)*['=']for i in[0]*33]]):print(*k,sep='')
```
**How it works**
```
from random import*    Import everything in the random module
randint(1,6)*['=']     Create a list containing a random number in [1,6] of '='...
...for i in[0]*33      ...33 times...
[...]                  ...and store in a list X
for j in...            For all lists j in X...
[' ']*(6-len(j))+j     ...create a list containing j padded with the correct number of
                       spaces to give a height of 6...
[...]                  ...and store in a list Y
Y now contains a list for each output line, but transposed.
for k in zip(*...):...  For all lists k in the transpose of Y...
print(*k,sep='')        Print all elements in k with no separating space
```
[Try it on Ideone](https://ideone.com/qOjFec)
[Answer]
# MATL, ~~20~~ ~~19~~ ~~18~~ 17 bytes
*1 byte saved thanks to @Luis*
```
33l2$r6*6:>!~61*c
```
[**Try it Online**](http://matl.tryitonline.net/#code=MzNsMiRyNio2Oj4hfjYxKmM&input=)
[Answer]
# SpecaBAS - 76 bytes
```
1 FOR x=1 TO 33: r=1+INT(RND*6): FOR y=7-r TO 6: ?AT y,x;"=": NEXT y: NEXT x
```
Prints an equal sign at the relevant screen coordinate.
[![enter image description here](https://i.stack.imgur.com/5hvKl.png)](https://i.stack.imgur.com/5hvKl.png)
with a spot of colour and a `GOTO` loop it becomes
[![enter image description here](https://i.stack.imgur.com/l59rD.gif)](https://i.stack.imgur.com/l59rD.gif)
[Answer]
# K4, 18 bytes
Essentially a port of the APL solution (unsurprisingly).
```
+-6$(33?1+!6)#'"="
```
[Answer]
# C#, ~~200~~ 117 bytes
```
()=>{var s="";int x,y=6;for(;y-->0;){var r=new Random();for(x=33;x-->0;)s+="= "[r.Next(6)<y?1:0];s+='\n';}return s;};
```
I move to @Lynn [algorithm](https://codegolf.stackexchange.com/questions/85061/illustrate-music-beats/85078#85078) and save 83 bytes!
C# lambda without input and where output is a string. [Try it online](https://dotnetfiddle.net/0F7K3b).
Code:
```
()=>{
    var s="";int x,y=6;
    for(;y-->0;){
        var r=new Random();
        for(x=33;x-->0;)
            s+="= "[r.Next(6)<y?1:0];
        s+='\n';
    }return s;
};
```
[Answer]
## Haskell, 164 Bytes
Being a purely functional language, Haskell was doomed from the start. I did it anyway and it turns out, that the necessary overhead is actually not that large.
```
import System.Random
import Data.List
f r n|r>n=' '|0<1='='
s=do
g<-newStdGen
mapM_ putStrLn$transpose$map(\n->map(f$mod n 6)[0..5])(take 33(randoms g)::[Int])
```
**Usage:**
```
s
```
**Explanation:**
```
import System.Random
```
to be able to use `newStdGen` and `randoms`
```
import Data.List
```
to be able to use `transpose`
```
f r n|r>n=' '|0<1='='
```
defines a function that prints a space if its first argument is larger than the second and a `=` otherwise. It is called with `map (f m) [0..5]` on a given number `m` and the list `[0,1,2,3,4,5]`. (See below)
```
s=do
g<-newStdGen
```
Creates a new standard random number generator
```
(take 33(randoms g)::[Int])
```
takes 33 random integers.
```
map(\n->map(f$mod n 6)[0..5])
```
Calculates `m = n % 6` and maps `(f m)` to the list `[0,1,2,3,4,5]`, which results in one of `"======", " =====", ..., " ="`. These lines are mapped to the list of the 33 random integers resulting in a table. (A table in Haskell is a list of lists)
```
transpose$
```
switches columns and rows of the table
```
mapM_ putStrLn$
```
prints every line in the table
[Answer]
## CJam, 19 bytes
```
{5mrS*6'=e]}33*]zN*
```
[Try it online!](http://cjam.aditsu.net/#code=%7B5mrS*6'%3De%5D%7D33*%5DzN*)
### Explanation
```
{       e# 33 times...
  5mr   e#   Push a random number in [0 1 2 3 4 5].
  S*    e#   Create a string with that many spaces.
  6'=e] e#   Pad to length 6 with =.
}33*    
]       e# Wrap all 33 strings in a list.
z       e# Transpose that list.
N*      e# Join the lines with linefeeds.
```
[Answer]
# Mathematica, 78 bytes
```
StringRiffle[(PadLeft[Array["="&,#+1],6," "]&/@5~RandomInteger~33),"
",""]&
```
Anonymous function. Takes no input and returns a string as output. The Unicode character is U+F3C7, representing `\[Transpose]`.
[Answer]
# R, 102 bytes
```
m=rep(" ",33);for(i in 1:6){n=ifelse(m=="=",m,sample(c(" ","="),33,T,c(6-i,i)));m=n;cat(n,"\n",sep="")}
```
### Explanation
`m=rep(" ",33)` init an empty vector for the upcoming loop
`n=ifelse(m=="=",m,sample(c(" ","="),33,T,c(6-i,i)))` If there's an `=` in the row above, then make sure the spot below also has an `=`; otherwise randomly pick. Random picks are weighted to make sure that a) the bottom row is all `=` and b) you get a neat shape to the whole thing.
`cat(n,"\n",sep="")` output that row to the console with a newline at the end and no spaces between elements!
[Answer]
# PHP, ~~95~~ ~~92~~ 89 bytes
```
<?php for(;++$i<34;)for($j=6,$e=' ';$j--;)$a[$j].=$e=rand(0,$j)?$e:'=';echo join("
",$a);
```
Pretty happy with this one actually. For a while I had a version that in theory could generate any input but in practise would generate only solid blocks of = but this is both shorter and equally distributed!  
Generates 7 undefined something notices whenever you run it but that's fine.
edit: well I just learned that join is an alias of implode, so that's nice.
[Answer]
# J, 18 bytes
```
|.|:'='#~"0>:?33#6
```
Very simple stuff. With a bugfix from miles!
[Answer]
## Perl, 64 bytes
```
@f=$_="="x33;s/=/rand>.4?$&:$"/ge,@f=($_.$/,@f)while@f<6;print@f
```
### Usage
```
perl -e '@f=$_="="x33;s/=/rand>.3?$&:$"/ge,@f=($_.$/,@f)while@f<6;print@f'
  = =           =  ==      =    =
  = =         ===  ==      =    =
= = =         ===  ==      =    =
= = =   = =   ===  ===   = =    =
= = == =====  === ====   ===  = =
=================================
```
---
## Perl, 68 bytes
Alternative version that relies on ANSI escape codes to move the cursor around, first dropping down 6 lines, then writing the original line (all the `=`s), moving up a line and printing the replaced string (`s/=/rand>.4?$&:$"/ge`) repeatedly until it makes no more substitutions. This can end up writing more than six lines, but it is eventually replaced with an empty line.
**Note: `\x1b`s are actually the ASCII `Esc` character.**
```
print"\x1bc\x1b[6B",$_="="x33;print"\x1b[1A\x1b[33D$_"while s/=/rand>.4?$&:$"/ge
```
[Answer]
# Ruby, ~~102~~ ~~99~~ ~~84~~ 83 bytes
```
s='
'*203;33.times{|j|a=(' '*rand(6)).ljust 6,'=';6.times{|i|s[i*34+j]=a[i]}};$><<s
```
New and significantly shorter approach, where I start with string full of newlines.
Older version...
```
s='';204.times do|i|s+=->i{i%34==0?"\n":i>170?'=':s[i-34]=='='?'=':rand(2)==1?'=':' '}[i]end;puts s
```
...gave output with leading new line. My first submission in Ruby, using similar approach to @Barbarossa's one, but in single loop.
What I liked in Ruby while working on this program:
* `.times` loop
* `rand()` which is pretty short
* stacking ternary operators without parentheses
I didn't like (mainly in terms of golfing):
* ~~mandatory `$` for global variables~~ not so mandatory in `.times` loop
* ~~`do` and `end` keywords~~ which can be replaced with single-line block
* `0` is not falsy
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 12 bytes
```
Ｆ³³⁺×=⁺¹‽⁶¶⟲
```
Beats Pyth by 1 byte!
Link is to verbose version of code.
[Try it online!](https://tio.run/##S85ILErOT8z5/98tv0jD2FhTIaAoM69EIyCntFgjJDM3tVhDyVZJx1A7KDEvJT9Xw0xTU0cpJk9JU5MrKL8ksST1////ujll/3V1U1LLUouS8osz0yoB "Charcoal – Try It Online")
[Answer]
# JavaScript, 179 bytes
Still working on golfing this a bit. I like this since it's straightforward.
```
n=>{a=Array(33).fill(0).map(n=>Math.floor(Math.random()*6)+1);r=Array(6).fill("");r.map((e,m)=>{a.map(n=>{if (n<=m+1){r[m]+="="}else r[m]+=" "})});return r.join('\n');}
```
Usage:
```
>q=n=>{a=Array(33).fill(0).map(n=>{return Math.floor(Math.random() * 6)+1});
r=Array(6).fill("");r.map((e,m)=>{a.map(n=>{if (n<=m+1){r[m]+="="}else r[m]+=" "})});return r.join('\n');}
>q();
           = =  =   =    = =     
=   =    = = =  =  == =  = =  =  
= = =  = === ====  ====  = = === 
= = =  = === ==========  ======= 
= === ===========================
=================================
```
[Answer]
# Forth, 190 bytes
I had to create my own [PRNG](http://ideone.com/6aEScs), an xor-shift taken from [here](http://excamera.com/sphinx/article-xorshift.html). The word `f` is the word you would call multiple times to see the output.
```
variable S utime S !
: L lshift xor ;
: R S @ dup 13 L dup 17 rshift xor dup 5 L dup S ! 6 mod ;
: f
33 0 DO R LOOP
1 -5 DO
33 0 DO
I PICK J + 0< 1+ IF ." =" ELSE SPACE THEN
LOOP CR
LOOP
; f
```
[**Try it online**](http://ideone.com/CWQRAk) - Note that the system time is one of two values based on which server (or something) is running the code. Other than that, they don't change in the online IDE for some reason. So you'll only see two possible outputs. You can manually set the seed by changing `utime` to an integer.
### Ungolfed
```
variable seed                   \ seed with time
utime seed !
: RNG                           \ xor-shift PRNG
seed @
dup 13 lshift xor
dup 17 rshift xor
dup 5 lshift xor
dup seed !
6 mod                           \ between 0 and 6, exclusive
;
: f 33 0 DO RNG LOOP            \ push 33 randoms
    1 -5 DO                     \ for (J = -6; J <  0; J++)
        33 0 DO                 \ for (I =  0; I < 33; I++)
            I PICK J + 0< 1+ IF \ if  (stack[I] < J)
                61 EMIT         \ print "="
            ELSE
                32 EMIT         \ print " "
            THEN
        LOOP
        CR                      \ print "\n"
    LOOP
; f
```
[**Ungolfed online**](http://ideone.com/0tkCSN)
[Answer]
# JavaScript, 165 Bytes
```
// function that fills a column with a specified number of = signs
m=l=>Array(6).fill``.map((e,i)=>i<l?"=":" ");
// fill an array of 33 length with columns of random number of = signs
a=Array(33).fill``.map(e=>m(Math.ceil(Math.random()*6)));
// transponse the rows and columns and print to console
a[0].map((c,i)=>a.map(r=>r[5-i])).map(r=>console.log(r.join``))
```
The newlines are unnecessary but they make it easier to see what's going on. Not the most optimal solution, but it makes sense to me at least.
]