-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.php
executable file
·50 lines (50 loc) · 1.58 KB
/
index.php
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>E-NFA to DFA</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/css/materialize.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/js/materialize.min.js"></script>
</head>
<body>
<?php $json = json_decode(file_get_contents("result.json")) ?>
<div class="container">
<h3 class="center-align">Determinant Finate Automata</h3>
<div class="divider"></div>
<div class="card horizontal">
<table class="striped responsive-table">
<thead>
<tr>
<th></th>
<th>States</th>
<?php foreach ($json->alphabet as $alphabet): ?>
<th><?php echo $alphabet ?></th>
<?php endforeach ?>
</tr>
</thead>
<tbody>
<?php foreach ($json->result as $state): ?>
<tr>
<td class="right-align" style="width: 1%; white-space: nowrap;">
<?php
if ($json->start_state === $state->from)
echo '-> ';
foreach ($json->final_state as $f_state)
if ($f_state === $state->from)
echo '* '
?>
</td>
<td><?php echo $state->from ?></td>
<?php foreach ($state->to as $to_state): ?>
<td><?php echo $to_state ?></td>
<?php endforeach ?>
</tr>
<?php endforeach ?>
</tbody>
</table>
</div>
</div>
</body>
</html>