Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $soal = "Soal 4";
- include 'tplLogic1.php';
- if (isset($_POST['submit'])) {
- $r = $_POST['range'];
- if ($r%2 == 0) {
- $r+=1;
- }
- echo "<table>";
- for($y=1;$y<=$r;$y++) {
- echo "<tr>";
- for($x=1;$x<=$r;$x++) {
- if ($x==$y || $x==$r-($y-1) || $x==round($r/2) || $y==round($r/2)) {
- echo "<td>*</td>";
- } else {
- echo "<td></td>";
- }
- }
- echo "</tr>";
- }
- echo "</table>";
- }
Add Comment
Please, Sign In to add comment