Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                正解する確率は<span id="monitor"></span>%です




                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);