こちらの YouTubeで利用したサンプルプログラムです。
JavaScriptでおみくじプログラムを作ってみよう
https://www.youtube.com/watch?v=AJC4Ap0XsYI&feature=youtu.be
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>おみくじ</title>
<style>
body {
background-color: rgb(181, 241, 153);
}
p {
text-align: center;
font-size: 2em;
margin-top: 100px;
}
</style>
</head>
<body>
<script>
// 大吉・吉・中吉・小吉・末吉・凶・大凶
let kujis = ['大吉', '吉', '吉', '吉', '中吉', '中吉', '小吉', '小吉', '小吉', '末吉', '末吉', '凶', '凶', '大凶'];
//console.log(kujis[0]);
let kuji = Math.floor(Math.random() * kujis.length);
//console.log(kuji);
document.write('<p>あなたの今年の運勢は、' + kujis[kuji] + 'です</p>');
</script>
</body>
</html>