Skip to content

Commit

Permalink
Changed <samp> to <pre>
Browse files Browse the repository at this point in the history
Changed the <samp> tags to <pre> in all phrases tags.
This was done in order to reflect in a better way the continuos spaces found in some phrases,
  • Loading branch information
CaeSpock authored Feb 15, 2018
1 parent 452b474 commit f94e2f0
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 30 deletions.
18 changes: 9 additions & 9 deletions caesar1.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,30 @@
echo "</tr>\n";
echo "<tr>\n";
echo " <td class=\"table-dark text-right\">$l_alphabet:</td>\n";
echo " <td><samp>";
echo " <td><pre>";
for ($i=65; $i<=90; $i++) {
echo chr($i);
}
echo "</samp></td>\n";
echo "</pre></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <td class=\"table-dark text-right\">$l_newalphabet:</td>\n";
echo " <td><samp>";
echo " <td><pre>";
for ($i=65; $i<=90; $i++) {
$position=$i;
if ($i>(90-$enckey)) { $position=($i+$enckey-(26+$enckey)); }
$letter=$position+$enckey;
echo chr($letter);
}
echo "</samp></td>\n";
echo "</pre></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <td class=\"bg-warning text-right\"><strong>$l_phrase:</strong></td>\n";
echo " <td><samp>$phrase</samp></td>";
echo " <td><pre>$phrase</pre></td>";
echo "</tr>\n";
echo "<tr>\n";
echo " <td class=\"bg-success text-right\"><strong>$l_newphrase:</strong></td>\n";
echo " <td><samp>";
echo " <td><pre>";
$counter=0;
while ($counter < strlen($phrase)) {
$position = ord($phrase[$counter]);
Expand All @@ -62,11 +62,11 @@
echo chr($position);
$counter++;
}
echo "</samp></td>\n";
echo "</pre></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <td class=\"bg-danger text-right\"><strong>$l_inverted:</strong></td>\n";
echo " <td><samp>";
echo " <td><pre>";
$counter=0;
while ($counter < strlen($phrase)) {
$position = ord($phrase[$counter]);
Expand All @@ -80,7 +80,7 @@
echo chr($position);
$counter++;
}
echo "</samp></td>\n";
echo "</pre></td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</div>\n";
Expand Down
19 changes: 9 additions & 10 deletions caesar2.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,30 @@
echo "</tr>\n";
echo "<tr>\n";
echo " <td class=\"table-dark text-right\">$l_alphabet:</td>\n";
echo " <td><samp>";
echo " <td><pre>";
for ($i=65; $i<=90; $i++) {
echo chr($i);
}
echo "</samp></td>\n";
echo "</pre></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <td class=\"table-dark text-right\">$l_newalphabet:</td>\n";
echo " <td><samp>";
echo " <td><pre>";
for ($i=65; $i<=90; $i++) {
$position=$i;
if ($i>(90-$enckey)) { $position=($i+$enckey-(26+$enckey)); }
$letter=$position+$enckey;
echo chr($letter);
}
echo "</samp></td>\n";
echo "</pre></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <td class=\"bg-warning text-right\"><strong>$l_phrase:</strong></td>\n";
echo " <td><samp>$phrase</samp></td>";
echo " <td><pre>$phrase</pre></td>";
echo "</tr>\n";
echo "<tr>\n";
echo " <td class=\"bg-success text-right\"><strong>$l_newphrase:</strong></td>\n";
echo " <td><samp>";
echo " <td><pre>";
$counter=0;
$enckeyesimo = 0;
while ($counter < strlen($phrase)) {
Expand All @@ -73,11 +73,11 @@
$counter++;
$enckeyesimo++;
}
echo "</samp></td>\n";
echo "</pre></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <td class=\"bg-danger text-right\"><strong>$l_inverted:</strong></td>\n";
echo " <td><samp>";
echo " <td><pre>";
$counter=0;
$enckeyesimo = 0;
while ($counter < strlen($phrase)) {
Expand All @@ -92,13 +92,12 @@
}
echo chr($position);
} else {
// echo "<font color=\"red\">#</font>";
$enckeyesimo = -1;
}
$counter++;
$enckeyesimo++;
}
echo "</samp></td>\n";
echo "</pre></td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</div>\n";
Expand Down
14 changes: 7 additions & 7 deletions rot13.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,30 @@
echo "</tr>\n";
echo "<tr>\n";
echo " <td class=\"table-dark text-right\">$l_alphabet:</td>\n";
echo " <td><samp>";
echo " <td><pre>";
for ($i=65; $i<=90; $i++) {
echo chr($i);
}
echo "</samp></td>\n";
echo "</pre></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <td class=\"table-dark text-right\">$l_newalphabet:</td>\n";
echo " <td><samp>";
echo " <td><pre>";
for ($i=65; $i<=90; $i++) {
$position=$i;
if ($i>65+12) { $position=$i-26; }
$letter=$position+13;
echo chr($letter);
}
echo "</samp></td>\n";
echo "</pre></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <td class=\"bg-warning text-right\"><strong>$l_phrase:</strong></td>\n";
echo " <td><samp>$phrase</samp></td>";
echo " <td><pre>$phrase</pre></td>";
echo "</tr>\n";
echo "<tr>\n";
echo " <td class=\"bg-success text-right\"><strong>$l_newphrase:</strong></td>\n";
echo " <td><samp>";
echo " <td><pre>";
$counter=0;
while ($counter < strlen($phrase)) {
$position = ord($phrase[$counter]);
Expand All @@ -53,7 +53,7 @@
echo chr($position);
$counter++;
}
echo "</samp></td>\n";
echo "</pre></td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</div>\n";
Expand Down
8 changes: 4 additions & 4 deletions trasposition.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
echo "</tr>\n";
echo "<tr>\n";
echo " <td class=\"bg-success text-right\"><strong>$l_newphrase:</strong></td>\n";
echo " <td><samp>";
echo " <td><pre>";
$columns = $enckey;
while ($columns >= 1) {
$rows = 1;
Expand All @@ -83,7 +83,7 @@
}
$columns--;
}
echo "</samp></td>\n";
echo "</pre></td>\n";
echo "</tr>\n";
while ((strlen($phrase) % $enckey) != 0) {
$phrase .= " ";
Expand All @@ -105,7 +105,7 @@
}
echo "<tr>\n";
echo " <td class=\"bg-danger text-right\"><strong>$l_inverted:</strong></td>\n";
echo " <td><samp>";
echo " <td><pre>";
$rows = 1;
$columns = 1;
$counter = 0;
Expand All @@ -124,7 +124,7 @@
}
$counter++;
}
echo "</samp></td>\n";
echo "</pre></td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</div>\n";
Expand Down

0 comments on commit f94e2f0

Please sign in to comment.