Initial commit
[0x.git] / php / j1.php
bloba4cf581e15180a7829e5684812f6aade7333ac1d
1 <style>
2 table {
3 display: inline-table;
4 margin: 20px;
5 font-size: xx-large;
6 border-collapse: collapse;
8 td {
9 border: 1px solid;
10 padding: 5px;
12 </style>
13 <?php
14 # take a hexadecimal number and return an html char entity!
15 function pointer2html($pointer) {
16 return "&#x" . $pointer . ";";
18 # the size of the `less' array is less than or equal to the size of the `more'
19 # array
20 function one_perm($less, $more) {
21 shuffle($more);
22 $thismuch_less = 0;
23 foreach ($less as $a_less) {
24 printf("<tr><td>%s</td><td>%s</td></tr>", pointer2html($a_less), pointer2html($more[$thismuch_less]), $more[$thismuch_less]);
25 $thismuch_less++;
29 $notpunctuation = array("5c",
30 "488",
31 "e5b",
32 "229a",
33 "2399",
34 "23cf",
35 "2581",
36 "2583",
37 "2585",
38 "25b3",
39 "25b8",
40 "2614",
41 "263a",
42 "2665",
43 "26a1",
44 "2708",
45 "270c",
46 "2739",
47 "274d",
48 "27ab");
49 $punctuation = array("21",
50 "22",
51 "27",
52 "28",
53 "29",
54 "2c",
55 "2e",
56 "3a",
57 "3f");
58 for ($i = 1; $i <= 20; $i++) {
59 print "<table>";
60 one_perm($punctuation, $notpunctuation);
61 print "</table>";