-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
56 lines (49 loc) · 2.91 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
id: home
layout: default
title: "24 Game Solution"
---
<div class="page-content">
<!-- Solving the card game Twenty Four. -->
<div class="app">
<div style="padding-top: 20px; text-align: center;">
<button type="button" onclick="deal()" id="dealBtn">DEAL</button>
</div>
<div style="padding-top: 20px; text-align: center;">
<input type="text" class="number" id="n1" value="">
<input type="text" class="number" id="n2" value="">
<input type="text" class="number" id="n3" value="">
<input type="text" class="number" id="n4" value="">
</div>
<div style="padding-top: 20px; text-align: center;">
<button type="button" onclick="solve()" id="dealBtn">SOLVE</button>
</div>
<div style="padding-top: 20px; text-align: center;">
<textarea readonly disabled="disabled" id="solutionsText"></textarea>
</div>
</div>
<div class="description">
<h3 id="the-card-game">The Card Game</h3>
<p>24 is a card game that I often play. From <a href="http://en.wikipedia.org/wiki/24_Game">Wikipedia</a>:</p>
<blockquote>
The 24 Game is an arithmetical card game in which the object is to find a way to manipulate four integers so that the end result is 24. Addition, subtraction, multiplication, or division, and sometimes other operations, may be used to make four digits from one to nine equal 24. For example, card with the numbers 4,7,8,8, a possible solution is the following: (7-(8/8))*4=24.
</blockquote>
<h3 id="to-use">To Use</h3>
<p>"Deal" button will draw 4 random cards using the ranks and suits below. Users can also input any number in the input fields (non-numbers will be ignored). "Solve" button will show all possible solutions.</p>
<code>
<p>Ranks: Ace = 1, 2-10 normal, JQK not used<br />
Suits: 'c' = Clubs, 'd' = Diamonds, 'h' = Hearts,<br />'s' = Spades</p>
</code>
<h3 id="notes--issues">Notes & Issues</h3>
<ul>
<li><strong>Click <a href="{{ site.github }}/issues/new">here</a> for issues and suggestions.</strong></li>
<li>Python solution available <a href="https://github.com/dsoegijono/code-bits/blob/master/solvers/twentyfour.py">here</a></li>
</ul>
</div>
<div class="clear"></div>
<div style="width: 100%; text-align: center; padding: 20px 0;">
<iframe src="https://dsoegijono.github.io/github-buttons/github-btn.html?user=dsoegijono&repo=twentyfour&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
<iframe src="http://dsoegijono.github.io/github-buttons/github-btn.html?user=dsoegijono&repo=twentyfour&type=fork&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="95" height="20"></iframe>
<iframe src="http://dsoegijono.github.io/github-buttons/github-btn.html?user=dsoegijono&type=follow&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="165" height="20"></iframe>
</div>
</div>