<!DOCTYPE html>
<html>
<head>
  <title>bc.game Crash - Game Verification Script by bcgame</title>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <meta name="robots" content="noindex, nofollow">
  <meta name="googlebot" content="noindex, nofollow">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js"></script>
  <link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/bulma/0.6.2/css/bulma.min.css">
  <link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.9-1/crypto-js.min.js"></script>
  
  <style>
    *, body, button, input, textarea, select {
      text-rendering: optimizeLegibility;
      -moz-osx-font-smoothing: grayscale;
    }

    body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {
      margin:0;
      padding:0;
    }
    table {
      border-collapse:collapse;
      border-spacing:0;
    }
    fieldset,img {
      border:0;
    }
    address,caption,cite,code,dfn,em,strong,th,var {
      font-style:normal;
      font-weight:normal;
    }
    ol,ul {
      list-style:none;
    }
    caption,th {
      text-align:left;
    }
    h1,h2,h3,h4,h5,h6 {
      font-size:100%;
      font-weight:normal;
    }
    q:before,q:after {
      content:'';
    }
    abbr,acronym { border:0;}
  </style>
  <style type="text/css">
    table {
        table-layout: fixed;
    }

    table thead tr th:first-child {
        width: 80%;
    }

    table tbody tr td {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .is-first {
        background-color: rgba(195, 111, 24, 0.2);
    }

    .is-over-median {
        color: #44B39D;
    }

    .is-at-median {
        color: #3B3C3D;
    }

    .is-under-median {
        color: #BF4A67;
    }
  </style>
</head>

<body>
  <section class="section">
    <div class="container">
      <h1 class="title">bc.game Crash - Game Verification Script</h1>
      <h2 class="subtitle">Third party script used to verify games on crash game.</h2>
    </div>
    <hr>
    <div class="container">
      <div class="field">
        <p class="control has-icons-left">
          <input class="input" type="text" id="game_hash_input" placeholder="Game's hash (SHA256)">
          <span class="icon is-small is-left"><i class="fa fa-key"></i></span>
        </p>
      </div>
      <div class="field">
        <p class="control has-icons-left">
          <input class="input" type="number" id="game_amount_input" min="1" max="100000" step="1" placeholder="Amount of games" value="10">
          <span class="icon is-small is-left"><i class="fa fa-hashtag"></i></span>
        </p>
      </div>
      <div class="field is-grouped">
        <p class="control">
          <a class="button is-primary" id="game_verify_submit">Verify</a>
        </p>
      </div>
    </div>
    <hr>
    <div class="container">
      <table class="table is-striped is-fullwidth is-hoverable is-narrow" style="display:table">
        <thead>
          <tr>
            <th><b>Game's hash</b></th>
            <th><b>Bust</b></th>
          </tr>
        </thead>
        <tbody id="game_verify_table"></tbody>
      </table>
    </div>
  </section>
    <script type="text/javascript">
      var isVerifying = false;
      $('#game_verify_submit').on('click', () => {
        if (isVerifying) return;
        isVerifying = true;
        $('#game_hash_input').parent().addClass('is-loading');
        $('#game_verify_submit').addClass('is-loading');
        $('#game_hash_input, #game_amount_input, #game_verify_submit').attr('disabled', 'disabled');
        $('#game_verify_table').html('');

        let prevHash = null;
        for (let i = 0; i < $('#game_amount_input').val(); i++) {
          let hash = String(prevHash ? CryptoJS.SHA256(String(prevHash)) : $('#game_hash_input').val());
          let bust = gameResult(hash);

          setTimeout(function() {
            addTableRow(hash, bust, i)
          }, i * 1);

          prevHash = hash;
        }
      });

      $('#game_amount_input').on('keyup', () => {
        if ($('#game_amount_input').val() >= 10000) {
          if ($('#game_verify_warning').length) return;
          $('#game_verify_submit').parent().append(
            $('<span/>').attr({
              'id': 'game_verify_warning',
              'class': 'tag is-warning'
            }).text("Verifying a huge amount of games may consume more ressources from your CPU")
          );
        } else {
          if ($('#game_verify_warning').length) {
            $('#game_verify_warning').remove();
          }
        }
      });

      const addTableRow = (hash, bust, index) => {
        $('<tr/>').attr({
          'class': index === 0 ? 'is-first' : null
        }).append(
          $('<td/>').text(hash)
        ).append(
          $('<td/>').text(bust).attr({
            'class': bust === 1.98 ? 'is-at-median' : bust > 1.98 ? 'is-over-median' : 'is-under-median'
          })
        ).appendToWithIndex($('#game_verify_table'), index);

        if (index >= $('#game_amount_input').val() - 1) {
          $('#game_hash_input').parent().removeClass('is-loading');
          $('#game_verify_submit').removeClass('is-loading');
          $('#game_hash_input, #game_amount_input, #game_verify_submit').removeAttr("disabled");
          isVerifying = false;
        }
      };

      const gameResult = (seed) => {
        const nBits = 52; // number of most significant bits to use

        // 1. r = 52 most significant bits
        seed = seed.slice(0, nBits / 4);
        const r = parseInt(seed, 16);

        // 2. X = r / 2^52
        let X = r / Math.pow(2, nBits); // uniformly distributed in [0; 1)

        // 3. X = 99 / (1-X)
        X = 99 / (1 - X);

        // 4. return max(trunc(X), 100)
        const result = Math.floor(X);
        return Math.max(1, result / 100);
      };

      $.fn.appendToWithIndex = function(to, index) {
        if (!to instanceof jQuery) {
          to = $(to);
        };
        if (index === 0) {
          $(this).prependTo(to)
        } else {
          $(this).insertAfter(to.children().eq(index - 1));
        }
      };

      var hash_url = window.location.search
      if ((/\?hash=/).test(hash_url)) {
        var hash = hash_url.replace(/\?hash=/, '')
        $('#game_hash_input').val(hash)
        $('#game_verify_submit').click()
      }
    </script>
    <script>
      // tell the embed parent frame the height of the content
      if (window.parent && window.parent.parent) {
        window.parent.parent.postMessage(["resultsFrame", {
          height: document.body.getBoundingClientRect().height,
          slug: "nwu2ffkv"
        }], "*")
      }
    </script>
</body>

</html> 

HTML Online Editor & Compiler

Write, Run & Share HTML code online using OneCompiler's HTML online Code editor for free. It's one of the robust, feature-rich online Code editor for HTML language, running on the latest version HTML5. Getting started with the OneCompiler's HTML compiler is simple and pretty fast. The editor shows sample boilerplate code when you choose language as HTML. You can also specify the stylesheet information in styles.css tab and scripts information in scripts.js tab and start coding.

About HTML

HTML(Hyper Text Markup language) is the standard markup language for Web pages, was created by Berners-Lee in the year 1991. Almost every web page over internet might be using HTML.

Syntax help

Fundamentals

  • Any HTML document must start with document declaration <!DOCTYPE html>
  • HTML documents begin with <html> and ends with </html>
  • Headings are defined with <h1> to <h6> where <h1> is the highest important heading and <h6> is the least important sub-heading.
  • Paragrahs are defined in <p>..</p> tag.
  • Links are defined in <a> tag.

    Example:

    <a href="https://onecompiler.com/html">HTML online compiler</a>
    
  • Images are defined in <img> tag, where src attribute consists of image name.
  • Buttons are defined in <button>..</button> tag
  • Lists are defined in <ul> for unordered/bullet list and <ol> for ordered/number list, and the list items are defined in <li>.

HTML Elements and Attributes

  • HTML element is everything present from start tag to end tag.
  • The text present between start and end tag is called HTML element content.
  • Anything can be a tagname but it's preferred to put the meaningful title to the content present as tag name.
  • Do not forget the end tag.
  • Elements with no content are called empty elements.
  • Elements can have attributes which provides additional information about the element.
  • In the below example, href is an attribute and a is the tag name.

    Example:

    <a href="https://onecompiler.com/html">HTML online compiler</a>
    

CSS

CSS(cascading style sheets) describes how HTML elements will look on the web page like color, font-style, font-size, background color etc.

Example:

Below is a sample style sheet which displays heading in green and in Candara font with padding space of 25px.

body{
  padding: 25px;
}
.title {
	color: #228B22;
	font-family: Candara;
}

HTML Tables

  • HTML Tables are defined in <table> tag.
  • Table row should be defined in <tr> tag
  • Table header should be defined in <th> tag
  • Table data should be defined in <td> tag
  • Table caption should be defined in <caption> tag

HTML-Javascript

  • Javascript is used in HTML pages to make them more interactive.
  • <script> is the tag used to write scripts in HTML
  • You can either reference a external script or write script code in this tag.

Example

<script src="script.js"></script>