[Question]
  [
Generate a 4x12 grid of letters / spaces:
Each die should appear precisely once, location randomly chosen. Locations should be approximate a uniform random permutation of the dice. Display a random (again, approximately uniform) face of each die. Left-justify the face in the 3-character window. For example,
```
A  E  A  A
E  C  D  E
D  A  Qu E
E  A  H  D
```
Is a non-randomized board in the format I want. Trailing space is allowed.
The dice: 
```
A  A  E  E  G  N
E  L  R  T  T  Y
A  O  O  T  T  W
A  B  B  J  O  O
E  H  R  T  V  W
C  I  M  O  T  U
D  I  S  T  T  Y
E  I  O  S  S  T
D  E  L  R  V  Y
A  C  H  O  P  S
H  I  M  N  Qu U
E  E  I  N  S  U
E  E  G  H  N  W
A  F  F  K  P  S
H  L  N  N  R  Z
D  E  I  L  R  X
```
Amusing fact: there is only 1 K in the set. What other letter exclusively shares that die?
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so the program with the shortest bytecount wins!
  
[Answer]
## GolfScript, 116 bytes
Since the scoring is in bytes, I figure that means we can use *all* bytes in the solution. Going outside the printable ASCII set allows a somewhat shorter solution than [Peter Taylor's](https://codegolf.stackexchange.com/a/4861), at the cost of making the code harder to display here. Without the unprintable data, my code looks like this:
```
'57 BYTES OF BINARY DATA HERE'256base 26base 6/{;9.?rand}${6rand=65+.81='  u '2/=}%8/n*
```
It's pretty similar to Peter Taylor's solution, and I admit to shamelessly borrowing bits of it (such as the `.81=' u '2/=` trick), although I think I managed to shorten his shuffle slightly, even after spending an extra ~~char~~ byte for better randomness.
The binary string in the beginning of the script contains unprintable characters, and so cannot be directly pasted here. Instead, I'll provide the script as a hex dump:
```
0000000: 2701 8302 7c56 97d5 ec9c 52e3 462e 44d7  '...|V....R.F.D.
0000010: a8d2 81c9 6115 fc80 4da4 6cd3 b06f a6d8  ....a...M.l..o..
0000020: 4e7e 2029 12a9 f331 0b83 3481 de36 81e2  N~ )...1..4..6..
0000030: 41b4 534d dee8 13f7 ccfd 2732 3536 6261  A.SM......'256ba
0000040: 7365 2032 3662 6173 6520 362f 7b3b 392e  se 26base 6/{;9.
0000050: 3f72 616e 647d 247b 3672 616e 643d 3635  ?rand}${6rand=65
0000060: 2b2e 3831 3d27 2020 7520 2732 2f3d 7d25  +.81='  u '2/=}%
0000070: 382f 6e2a                                8/n*
```
On Linux, or any system with the `xxd` utility installed, this hex dump can be turned back into a working 116-byte GolfScript program by passing it through `xxd -r`.
**Edit:** Replaced `999rand` with `9.?rand` for *much* better randomness. The shuffle should now be about as close to perfect as the underlying RNG allows.
[Answer]
## Python 2.7, ~~253 229~~ 215 chars
```
from random import*
j=0
for x in map(choice,sample("AAEEGN ELRTTY AOOTTW ABBJOO EHRTVW CIMOTU DISTTY EIOSST DELRVY ACHOPS HIMNQU EEINSU EEGHNW AFFKPS HLNNRZ DEILRX".split(),16)):j+=1;print x+' u'[x=='Q']+'\n'[j%4:],
```
Most of the characters are just the dice themselves. I didnt want to spend too much time trying to reduce it too much
minor edit: removed 2 unnecessary bytes (extra spaces)
edit2: down to 229
edit3: down to 215
[Answer]
## GolfScript (141 139 137 charsbytes)
Of which 94 expand to the string containing the dice. Figure doesn't include the unnecessary newline inserted to make it wrap so that the code can be seen without scrolling:
```
'Y
ISY
XIAOOW
VYAAEEGNABBJOOEHRTVWCIMOTUEIOSSTACHOPSHIMNQUEEINSUEEGHNWAFFKPSHLNNRZ'n/'TTELRD'*
6/{[6rand=99rand\]}%${1=.81='  u '2/=}%8/n*
```
[Answer]
## Ruby, ~~201~~ 197 chars
```
%W(AAEEGN ELRTTY AOOTTW ABBJOO EHRTVW CIMOTU DISTTY EIOSST DELRVY ACHOPS HIMNQU EEINSU EEGHNW AFFKPS HLNNRZ DEILRX).sample(16).map{|c|c[rand 6]}.each_slice(4){|x|puts x.join("  ").gsub(/Q ?/,"Qu")}
```
(and it's a one-liner)
Edit 1: Used %W() to avoid the .split and a pair of quotes.
Edit 2: Made it to spec (two spaces between each output column)
[Answer]
## Powershell, 234 characters
```
$d=(0..15|%{@{'AAEEGNELRTTYAOOTTWABBJOOEHRTVWCIMOTUDISTTYEIOSSTDELRVYACHOPSHIMNQUEEINSUEEGHNWAFFKPSHLNNRZDEILRX'[6*$_+(random)%6]=random}.GetEnumerator()}|sort Value|%{$_.Key})
0..3|%{($d[($_*4)..($_*4+3)])-join"   "-replace'Q ','Qu'}
```
Here's the same code with extra whitespace, in an attempt at improving readability :-)
```
#########################################
# roll the 16 dice and shuffle them     #
#########################################
$d=(
        0..15 | % {
                    @{
                       'AAEEGNELRTTYAOOTTWABBJOOEHRTVWCIMOTUDISTTYEIOSSTDELRVYACHOPSHIMNQUEEINSUEEGHNWAFFKPSHLNNRZDEILRX'[6*$_+(random)%6]=random
                     }.GetEnumerator() 
                  } | sort Value | % {
                                        $_.Key
                                     }
    )
############################################
# add the 16 results to the 4 by 4 grid    #
############################################
0..3 | % {
            ($d[($_*4)..($_*4+3)]) -join "   " -replace 'Q ','Qu'
         }
```
I'm not aware of a built in `shuffle` feature in powershell, so I turned each result into a key-value pair - the key equalling a dice result and the value equalling a random number. Then it was just a case of sorting these pairs by the value then outputting the keys.
[Answer]
## Perl, 179 chars
```
@d=(Qu,map"$_ ",HIMNUAAEEGNELRTTYAOOTTWABBJOOEHRTVWCIMOTUDISTTYEIOSSTDELRVYACHOPSEEINSUEEGHNWAFFKPSHLNNRZDEILRX
=~/./g);print+(splice@d,6*int rand@d/6,6)[rand 6],@d%24?$":$/while@d
```
Here's a verbose version of the program:
```
my $fullset = "HIMNUAAEEGNELRTTYAOOTTWABBJOOEHRTVWCIMOTUDISTTY"
           . "EIOSSTDELRVYACHOPSEEINSUEEGHNWAFFKPSHLNNRZDEILRX";
my @dice = ("Qu");
push @dice, "$_ " for split //, $fullset;
while (@dice) {
    my @die = splice @dice, 6 * (int rand @dice / 6), 6;
    print $die[rand 6];
    print @dice % 24 ? " " : "\n";
}
```
[Answer]
# [Vyxal](https://github.com/Lyxal/Vyxal), 85 bytes
```
«3꘍Ẋʀɖ>¯ɖ\4ȧḊ#⅛F>ẇ#₂⟑†ql~-ṡ²<vŻ%)∆₆U÷↵ʁʀeµṘbD{⇧½⁰ṙ⟩ĊI3≥⁰?λ«16/v℅Ṗ℅4ẇƛ÷W‛  j;⁋⇧‛Q ‛QuV
```
[Don't try it Online!](http://lyxal.pythonanywhere.com?flags=&code=%C2%AB3%EA%98%8D%E1%BA%8A%CA%80%C9%96%3E%C2%AF%C9%96%5C4%C8%A7%E1%B8%8A%23%E2%85%9BF%3E%E1%BA%87%23%E2%82%82%E2%9F%91%E2%80%A0ql%7E-%E1%B9%A1%C2%B2%3Cv%C5%BB%25%29%E2%88%86%E2%82%86U%C3%B7%E2%86%B5%CA%81%CA%80e%C2%B5%E1%B9%98bD%7B%E2%87%A7%C2%BD%E2%81%B0%E1%B9%99%E2%9F%A9%C4%8AI3%E2%89%A5%E2%81%B0%3F%CE%BB%C2%AB16%2Fv%E2%84%85%E1%B9%96%E2%84%854%E1%BA%87%C6%9B%C3%B7W%E2%80%9B%20%20j%3B%E2%81%8B%E2%87%A7%E2%80%9BQ%20%E2%80%9BQuV&inputs=&header=&footer=) Because it breaks the interpreter trying to handle 16! permutations of the dice at once. Would work given enough memory + time though. [Try this one that doesn't shuffle online!](http://lyxal.pythonanywhere.com?flags=&code=%C2%AB3%EA%98%8D%E1%BA%8A%CA%80%C9%96%3E%C2%AF%C9%96%5C4%C8%A7%E1%B8%8A%23%E2%85%9BF%3E%E1%BA%87%23%E2%82%82%E2%9F%91%E2%80%A0ql%7E-%E1%B9%A1%C2%B2%3Cv%C5%BB%25%29%E2%88%86%E2%82%86U%C3%B7%E2%86%B5%CA%81%CA%80e%C2%B5%E1%B9%98bD%7B%E2%87%A7%C2%BD%E2%81%B0%E1%B9%99%E2%9F%A9%C4%8AI3%E2%89%A5%E2%81%B0%3F%CE%BB%C2%AB16%2Fv%E2%84%854%E1%BA%87%C6%9B%C3%B7W%E2%80%9B%20%20j%3B%E2%81%8B%E2%87%A7%E2%80%9BQ%20%E2%80%9BQuV&inputs=&header=&footer=)
```
«...«                           # Compressed string
     16/                        # Into 16 pieces
        v℅                      # Random choice from each
          Ṗ℅                    # Shuffle
            4ẇ                  # Split into four pieces
              ƛ      ;          # Foreach...
               ÷W               # To list of characters
                 ‛  j           # Joined by double spaces 
                      ⁋⇧        # Joined by newlines and uppercased
                        ‛Q ‛QuV # Replace `Q ` with `Qu`
```
[Answer]
# [Perl 5](https://www.perl.org/), 157 bytes
```
@d{JobaotwHTVErHnZlRIXDeLtYrDELVyDItsHOPCafKPsIeUneagWeHnQUHImCIOUtEOsI=~s/[a-z]/\U$&$&/gr=~/.{6}/g}++;print$_=(/./g)[rand 6],/Q/?u:$",++$-%4?$":$/for keys%d
```
[Try it online!](https://tio.run/##BcHdCoIwGADQVxGZUWh9N@WFIQYqbBWokfZjEguXRDZjW4RJvbqd82SinvX9ouyWzYU26o23WSgwP9Ybsg/YWh1EEK6zNiBK4ij26XUVS8JSzmi1Y5gnKSYPn0SpCiNJ3J@EnI4/BZxSNEADqIT7g0lnf6H6mub8KW5cobM7hAlUo1xQXmp2YUEC3stBumWaaGxMPaQ7CK6N0O6slUbZ938 "Perl 5 – Try It Online")
## Explanation
This solution builds up the dice from the long string, replacing occurrences of lowercase letters with two of their uppercase companions (`s/[a-z]/\U$&$&/gr`) resulting in an ordering of 16 sets of 6 characters (`/.{6}/g`) which are then used as hash keys and set to `1` (`@d{...}++`). Since keys aren't stored in a particular order in Perl, this gives the ordering of the dice the required randomness.
Then for each of the `keys` in `%d`, `print` a `rand`omly selected char from the list, either `u` or `$"` (which defaults to space) depending on whether or not the randomly selected letter was `Q`, and either `$"` or `$/` (which defaults to newline) depending on whether or not we're working on a multiple of 4.
I quite enjoyed playing with the ordering to maximise saved characters, making sure that each dice ends with a letter that the next starts with and keeping other doubles in the middles of each set of 6. 68 bytes of data, but the decoding is a little expensive. Maybe it'll help someone else though!
[Answer]
# Batch 252 bytes
Note: script = 243 bytes + 9 bytes required to invoke script with Delayed expansion enabled from cmd.exe:
```
Cmd/Von/Cboggle.bat
```
**boggle.bat**
```
@Set c=0&For %%G in (AAEEGN ELRTTY AOOTTW ABBJOO EHRTVW CIMOTU DISTTY EIOSST DELRVY ACHOPS HIMNQU EEINSU EEGHNW AFFKPS HLNNRZ DEILRX)Do @Set D=%%G&Set/ac+=1&For /f %%i in ('Set/A!random!%%6')Do @<nul Set/p=!D:~%%i,1! &If !c!==4 (Echo(&Set c=0)
```
]