cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

              var correctCnt = 0; // 正解数カウンタ
var correctRate = 0; // 正解率
var TEST_COUNT = 9999; // 実験回数
for(var i = 0; i < TEST_COUNT; i += 1) {
  var correctArr = _.shuffle([true, false, false]); // ドアの向こうの並び方
  var shuffledArr = _.shuffle([0, 1, 2]);
  var ans = shuffledArr[0]; // 左から何番目のドアを開くか
  // 挑戦者がshuffleaArr[0]を回答する
  // shuffledArr[1]がハズレなら司会者がそのドアを開け、挑戦者は回答をshuffledArr[2]に変更。shuffledArr[1]がアタリなら司会者はshuffledArr[2]を開けるので挑戦者はshuffledArr[1]に回答を変更
  ans = !correctArr[shuffledArr[1]] ? 
  if(correctArr[ans]) {
    correctCnt += 1;    
correctRate = Math.round(correctCnt * 100 / TEST_COUNT);

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.


Loading ..................