NikitosKnyaz Posted Sunday at 07:10 PM Share Posted Sunday at 07:10 PM the program must be solved using cycles. starts with (1/2). Quote Link to comment Share on other sites More sharing options...
Barand Posted Sunday at 07:28 PM Share Posted Sunday at 07:28 PM Here's a cycle you can use to do your homework Quote Link to comment Share on other sites More sharing options...
NikitosKnyaz Posted Sunday at 07:37 PM Author Share Posted Sunday at 07:37 PM Seriously? Quote Link to comment Share on other sites More sharing options...
Barand Posted Sunday at 07:47 PM Share Posted Sunday at 07:47 PM If it's your homework assignment, yes. If it isn't, what have you tried so far? Quote Link to comment Share on other sites More sharing options...
jodunno Posted Monday at 11:56 AM Share Posted Monday at 11:56 AM you're supposed to recreate a paper with fake math problems? well, why don't you just scan it? maybe we can use html and svg to recreate the paper. You'll have to draw the svg arrows yourself, i have no time for that or the squiggly scribble. <html> <head> <title>paper tigers</title> <style> body { font-family: "Helvetica", "Open Sans", "Arial Narrow", sans-serif; } span.circled { padding: 1px; border: solid 1px #000000; border-radius: 50%; } div.textForm { display: inline-block; position: absolute; top: 3em; left: 16em; width: 8em; height: auto; } .invisibleInput { margin: 2px; width: 6em; height: 1.2em; border: solid 4px #000000; border-radius: 30%; } .htmlform { display: inline-block; text-indent: 1em; } .submit { display: inline-block; position: absolute; left: 2em; width: 3.5em; padding: 4px; border: solid 4px #000000; } .babold { font-weight: bold; } .parity { margin-left: 13em; font-family: "Arial Narrow", sans-serif; font-size: 0.9em; } .penned { font-family: "Comic Sans MS", "Open Sans", "Arial", sans-serif; color: #5c4ea1; } th, td { padding: 0px 3px; font-family: "Comic Sans MS", "Open Sans", "Arial", sans-serif; color: #5c4ea1; } .divider { margin: 0px; padding: 0px; width: 100%; height: 1px; background: #5c4ea1; } .th { font-weight: normal; } </style> </head> <body> <?php echo '<div class="textForm"><div class="babold htmlform">html form</div>'.PHP_EOL; echo '<div class="invisibleInput"></div>'.PHP_EOL; echo '<div class="babold submit">submit</div></div>'.PHP_EOL; $n = 3; $nm = $n-1; function numerator(int $n = 0, int $circled = 0) { if ($n === 1) { return 1; } $numerator = array (); $n*= 2; $nm = $n-1; for ($i = 1; $i < $n; $i+=2) { if ($circled && $i===$nm) { $numerator[] = '<span class="circled">'.$i.'</span>'; continue; } $numerator[] = $i; } return join('.', $numerator); } function denominator($n) { if ($n === 1) { return 2; } $denominator = array (); $n*= 2; for ($i = 2; $i <= $n; $i+=2) { $denominator[] = $i; } return join('.', $denominator); } echo '<p class="babold">limit fraction</p>'.PHP_EOL; echo '<p class="penned">N = 3</p>'.PHP_EOL; /* $_POST['n'] = 3 ///////////////////////////////////////////////////////////////////////*/ $numerators = array(); $denominators = array(); for ($i = 1; $i <= $n; $i++) { $numerators[] = numerator($i, 0); $denominators[] = denominator($i); } echo '<table>'; echo '<tbody>'; echo '<tr>'; echo '<td>S = </td>'; for ($i = 0; $i < $n; $i++) { echo '<td><table><tr><td>' . $numerators[$i] . '</td></tr><tr><td class="divider"></td></tr>' . '<tr><td>' . $denominators[$i] . '</td></tr></table>' . (($i===$nm) ? '</td><td>=</td>':'</td><td>+</td>').PHP_EOL; } echo '</tr>'; echo '</tbody></table>'.PHP_EOL; echo '<span class="babold parity">in each new fraction the number increases by "2".</span>'.PHP_EOL; /* $_POST['n'] = 4 ///////////////////////////////////////////////////////////////////////*/ $n = 4; $nm = $n-1; $numerators = array(); $denominators = array(); for ($i = 1; $i <= $n; $i++) { $numerators[] = numerator($i, 1); $denominators[] = denominator($i); } echo '<table>'; echo '<tbody><thead><th class="th">N = 4</th></thead>'; echo '<tr>'; echo '<td>S = </td>'; for ($i = 0; $i < $n; $i++) { echo '<td><table><tr><td>' . $numerators[$i] . '</td></tr><tr><td class="divider"></td></tr>' . '<tr><td>' . $denominators[$i] . '</td></tr></table>' . (($i===$nm) ? '':'</td><td>+</td>').PHP_EOL; } echo '</tr>'; echo '</tbody></table>'.PHP_EOL; /* $_POST['n'] = 5 ///////////////////////////////////////////////////////////////////////*/ $n = 5; $nm = $n-1; $numerators = array(); $denominators = array(); for ($i = 1; $i <= $n; $i++) { $numerators[] = numerator($i, 0); $denominators[] = denominator($i); } echo '<table>'; echo '<tbody><thead><th class="th">N = 5</th></thead>'; echo '<tr>'; echo '<td>S = </td>'; for ($i = 0; $i < $n; $i++) { echo '<td><table><tr><td>' . $numerators[$i] . '</td></tr><tr><td class="divider"></td></tr>' . '<tr><td>' . $denominators[$i] . '</td></tr></table>' . (($i===$nm) ? '':'</td><td>+</td>').PHP_EOL; } echo '</tr>'; echo '</tbody></table>'.PHP_EOL; ?> </body></html> and, honestly, this is the worst code that i could think of. I hope that you fail 🙂 cheating gets you nowehere, unless you're bodybuilding. The Arnold cheat is quite good. I gained 2 inches using the Arnold cheat. Quote Link to comment Share on other sites More sharing options...
Barand Posted Monday at 12:27 PM Share Posted Monday at 12:27 PM I gained four inches just by giving up rugby, squash and badminton. 1 Quote Link to comment Share on other sites More sharing options...
jodunno Posted Monday at 12:40 PM Share Posted Monday at 12:40 PM 11 minutes ago, Barand said: I gained four inches just by giving up rugby, squash and badminton. you, Sir, have a wonderful sense of humour. I like you 🙂 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.