<commit_before>!!!

- @hyphenate_data_attrs = false
- size = 50

%html
  %head
    :css
      body {
        background-color: linen;
      }
      #left {
        float: left;
        margin-right: 20px;
      }
      .square {
        margin: 3px;
        background: #ddd;
      }
      .ball {
        width: #{size}px;
        height: #{size}px;
        border-radius: #{size/2}px;
        border: 1px solid black;
      }

    :javascript
      window.onload = function () {
        var n;
        for (n = 0; n < 81; n++) {
          var elm = document.getElementById("b" + n);
          ku_show_setup(elm);
          elm.onclick = function(event) {
            var target = event.target;
            if (target.ku_showing_solved) {
              ku_show_setup(target);
            }
            else {
              ku_show_solved(target);
            }
          }
        }
      }

      function ku_all(func) {
        var n;
        for (n = 0; n < 81; n++) {
          var elm = document.getElementById("b" + n);
          func(elm);
        }
      }

      function ku_show_setup_all() {
        ku_all(ku_show_setup);
      }

      function ku_show_solved_all() {
        ku_all(ku_show_solved);
      }

      function ku_show_setup(elm) {
        elm.style.background = elm.dataset.setup_color;
        elm.ku_showing_solved = false;
      }

      function ku_show_solved(elm) {
        elm.style.background = elm.dataset.solved_color;
        elm.ku_showing_solved = true;
      }

      function ku_new_puzzle() {
        window.location.href = '#{url "/"}' + '?level=' + document.getElementById("level").value;
      }

  %body
    #left
      %table{style: "margin-bottom: 5px"}
        - 3.times do |row|
          %tr
            - 3.times do |col|
              %td
                %table.square
                  - 3.times do |sub_row|
                    %tr
                      - 3.times do |sub_col|
                        - n = ((row*3)+sub_row)*9 + col*3 + sub_col
                        %td
                          .ball{id: "b#{n}", data: {setup_color: colors[n][:setup] || "#f8f8f8", solved_color: colors[n][:solved]}}

      %button{onclick: "ku_show_setup_all()"}
        Setup
      %button{onclick: "ku_show_solved_all()"}
        Solved
      %button{onclick: "ku_new_puzzle()"}
        New

      Difficulty:
      %select{id: "level"}
        - WebSudoku::LEVELS.each do |text, number|
          %option{value: number, selected: number == level}
            = text

    %div{style: "padding-top: 3px"}
      = markdown :"../README"
      SpudoKu is hosted on
      #{link_to("Heroku", "http://www.heroku.com/")},
      and hackable on
      #{link_to("GitHub", "https://github.com/tommay/spudoku")}.
<commit_msg>More descriptive button text.<commit_after>!!!

- @hyphenate_data_attrs = false
- size = 50

%html
  %head
    :css
      body {
        background-color: linen;
      }
      #left {
        float: left;
        margin-right: 20px;
      }
      .square {
        margin: 3px;
        background: #ddd;
      }
      .ball {
        width: #{size}px;
        height: #{size}px;
        border-radius: #{size/2}px;
        border: 1px solid black;
      }

    :javascript
      window.onload = function () {
        var n;
        for (n = 0; n < 81; n++) {
          var elm = document.getElementById("b" + n);
          ku_show_setup(elm);
          elm.onclick = function(event) {
            var target = event.target;
            if (target.ku_showing_solved) {
              ku_show_setup(target);
            }
            else {
              ku_show_solved(target);
            }
          }
        }
      }

      function ku_all(func) {
        var n;
        for (n = 0; n < 81; n++) {
          var elm = document.getElementById("b" + n);
          func(elm);
        }
      }

      function ku_show_setup_all() {
        ku_all(ku_show_setup);
      }

      function ku_show_solved_all() {
        ku_all(ku_show_solved);
      }

      function ku_show_setup(elm) {
        elm.style.background = elm.dataset.setup_color;
        elm.ku_showing_solved = false;
      }

      function ku_show_solved(elm) {
        elm.style.background = elm.dataset.solved_color;
        elm.ku_showing_solved = true;
      }

      function ku_new_puzzle() {
        window.location.href = '#{url "/"}' + '?level=' + document.getElementById("level").value;
      }

  %body
    #left
      %table{style: "margin-bottom: 5px"}
        - 3.times do |row|
          %tr
            - 3.times do |col|
              %td
                %table.square
                  - 3.times do |sub_row|
                    %tr
                      - 3.times do |sub_col|
                        - n = ((row*3)+sub_row)*9 + col*3 + sub_col
                        %td
                          .ball{id: "b#{n}", data: {setup_color: colors[n][:setup] || "#f8f8f8", solved_color: colors[n][:solved]}}

      %button{onclick: "ku_show_setup_all()"} Show Setup
      %button{onclick: "ku_show_solved_all()"} Show Solution
      %button{onclick: "ku_new_puzzle()"} New Puzzle

      Difficulty:
      %select{id: "level"}
        - WebSudoku::LEVELS.each do |text, number|
          %option{value: number, selected: number == level}
            = text

    %div{style: "padding-top: 3px"}
      = markdown :"../README"
      SpudoKu is hosted on
      #{link_to("Heroku", "http://www.heroku.com/")},
      and hackable on
      #{link_to("GitHub", "https://github.com/tommay/spudoku")}.

{'fraction_non_alphanumeric': 0.13495934959349593, 'fraction_numerical': 0.009033423667570008, 'mean_word_length': 1.537121906507791, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '298552', 'n_tokens_mistral': 1914, 'n_tokens_neox': 1802, 'n_words': 344}