{"id":67,"date":"2026-01-16T16:49:43","date_gmt":"2026-01-16T16:49:43","guid":{"rendered":"https:\/\/theroyalscode.com\/students\/a_alhallak\/?p=67"},"modified":"2026-01-16T16:49:43","modified_gmt":"2026-01-16T16:49:43","slug":"free-friday-1-16-2026","status":"publish","type":"post","link":"https:\/\/theroyalscode.com\/students\/a_alhallak\/2026\/01\/16\/free-friday-1-16-2026\/","title":{"rendered":"free friday 1\/16\/2026"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"512\" src=\"https:\/\/theroyalscode.com\/students\/a_alhallak\/wp-content\/uploads\/2026\/01\/image-2-1024x512.png\" alt=\"\" class=\"wp-image-68\" srcset=\"https:\/\/theroyalscode.com\/students\/a_alhallak\/wp-content\/uploads\/2026\/01\/image-2-1024x512.png 1024w, https:\/\/theroyalscode.com\/students\/a_alhallak\/wp-content\/uploads\/2026\/01\/image-2-300x150.png 300w, https:\/\/theroyalscode.com\/students\/a_alhallak\/wp-content\/uploads\/2026\/01\/image-2-768x384.png 768w, https:\/\/theroyalscode.com\/students\/a_alhallak\/wp-content\/uploads\/2026\/01\/image-2-1536x768.png 1536w, https:\/\/theroyalscode.com\/students\/a_alhallak\/wp-content\/uploads\/2026\/01\/image-2.png 1903w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>I&#8217;ve worked on a long boring essay about Ken Mcwhatever. thats one of the things that i worked on, i also worked on a paper about calculating slope for my math class.<\/p>\n\n\n\n<p>for your class: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import re\n \ndef to_fraction(n):\n    s = str(n)\n \n    if \".\" not in s:\n        return s\n \n    whole, dec = s.split(\".\")\n    denom = 10 ** len(dec)\n    num = int(whole) * denom + int(dec)\n \n    def gcd(a, b):\n        while b:\n            a, b = b, a % b\n        return a\n \n    g = gcd(num, denom)\n    num \/\/= g\n    denom \/\/= g\n \n    return str(num) + \"\/\" + str(denom)\n \n \ndef format_number(n):\n    return to_fraction(n)\n \ndef parse_slope(line):\n    cleaned = line.replace(\" \", \"\")\n    match = re.search(r\"y=\\(?(-?\\d+\/?\\d*)\\)?x\", cleaned)\n    if not match:\n        return None\n    slope_str = match.group(1)\n    if \"\/\" in slope_str:\n        num, den = map(int, slope_str.split(\"\/\"))\n        return num \/ den\n    return float(slope_str)\n\n \ndef parallel_line_steps(point, slope):\n    x1, y1 = point\n    m = slope\n \n    steps = &#91;]\n    steps.append(\"1. Use point-slope form:\")\n    steps.append(\"   y - y1 = m(x - x1)\")\n \n    steps.append(\"\\n2. Substitute the point ({}, {}) and slope m = {}:\".format(\n        x1, y1, format_number(m)\n    ))\n    steps.append(\"   y - {} = {}(x - {})\".format(\n        y1, format_number(m), x1\n    ))\n \n    distributed = m * (-x1)\n    steps.append(\"\\n3. Distribute the slope:\")\n    steps.append(\"   y - {} = {}x + {}\".format(\n        y1, format_number(m), format_number(distributed)\n    ))\n \n    b = y1 - m * x1\n    steps.append(\"\\n4. Add {} to both sides to isolate y:\".format(y1))\n    steps.append(\"   y = {}x + {}\".format(\n        format_number(m), format_number(b)\n    ))\n \n    steps.append(\"\\nFinal equation of the parallel line:\")\n    steps.append(\"   y = {}x + {}\".format(\n        format_number(m), format_number(b)\n    ))\n \n    return \"\\n\".join(steps)\n \n \n# -------------------------\n# Two-point line steps\n# -------------------------\n \ndef two_point_line_steps(p1, p2):\n    x1, y1 = p1\n    x2, y2 = p2\n \n    steps = &#91;]\n    steps.append(\"1. Use the slope formula:\")\n    steps.append(\"   m = (y2 - y1) \/ (x2 - x1)\")\n \n    if x2 == x1:\n        return \"This is a vertical line: x = {}\".format(x1)\n \n    m = (y2 - y1) \/ (x2 - x1)\n \n    steps.append(\"\\n2. Substitute the points ({}, {}) and ({}, {}):\".format(\n        x1, y1, x2, y2\n    ))\n    steps.append(\"   m = ({} - {}) \/ ({} - {}) = {}\".format(\n        y2, y1, x2, x1, format_number(m)\n    ))\n \n    b = y1 - m * x1\n \n    steps.append(\"\\n3. Plug slope and one point into y = mx + b:\")\n    steps.append(\"   {} = {}({}) + b\".format(\n        y1, format_number(m), x1\n    ))\n \n    steps.append(\"\\n4. Solve for b:\")\n    steps.append(\"   b = {}\".format(format_number(b)))\n \n    steps.append(\"\\nFinal equation of the line:\")\n    steps.append(\"   y = {}x + {}\".format(\n        format_number(m), format_number(b)\n    ))\n \n    return \"\\n\".join(steps)\n \n \n# -------------------------\n# Menu\ndef menu():\n    print(\"\\nMath Line Calculator\")\n    print(\"--------------------\")\n    print(\"1. Parallel line through a point\")\n    print(\"2. Line through two points\")\n    print(\"3. Exit\")\n    return input(\"Choose an option (1-3): \")\n \nchoice = menu()\n \nif choice == \"1\":\n    print(\"\\n--- Parallel Line Mode ---\")\n    x = float(input(\"Enter x-coordinate of the point: \"))\n    y = float(input(\"Enter y-coordinate of the point: \"))\n    line = input(\"Enter the line equation (example: y = (-1\/2)x + 6): \")\n \n    slope = parse_slope(line)\n    if slope is None:\n        print(\"\\nThat equation does not have a slope.\")\n    else:\n        print(\"\\nWorking it out...\\n\")\n        print(parallel_line_steps((x, y), slope))\n \nelif choice == \"2\":\n    print(\"\\n--- Two-Point Line Mode ---\")\n    x1 = float(input(\"Enter x1: \"))\n    y1 = float(input(\"Enter y1: \"))\n    x2 = float(input(\"Enter x2: \"))\n    y2 = float(input(\"Enter y2: \"))\n \n    print(\"\\nWorking it out...\\n\")\n    print(two_point_line_steps((x1, y1), (x2, y2)))\n \nelif choice == \"3\":\n    print(\"\\nGoodbye!\")\n \nelif choice == \"67\":\n    print(\"\\nbro what\")\n \nelse:\n    print(\"\\nInvalid choice.\")<\/code><\/pre>\n\n\n\n<p>it&#8217;s an old thing ive been having fun with,<\/p>\n\n\n\n<p>it can calculate slope. i finished it today, i attempted to make it write the exact steps but i got lazy.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve worked on a long boring essay about Ken Mcwhatever. thats one of the things that i worked on, i [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-67","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/theroyalscode.com\/students\/a_alhallak\/wp-json\/wp\/v2\/posts\/67","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theroyalscode.com\/students\/a_alhallak\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theroyalscode.com\/students\/a_alhallak\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_alhallak\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_alhallak\/wp-json\/wp\/v2\/comments?post=67"}],"version-history":[{"count":1,"href":"https:\/\/theroyalscode.com\/students\/a_alhallak\/wp-json\/wp\/v2\/posts\/67\/revisions"}],"predecessor-version":[{"id":69,"href":"https:\/\/theroyalscode.com\/students\/a_alhallak\/wp-json\/wp\/v2\/posts\/67\/revisions\/69"}],"wp:attachment":[{"href":"https:\/\/theroyalscode.com\/students\/a_alhallak\/wp-json\/wp\/v2\/media?parent=67"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_alhallak\/wp-json\/wp\/v2\/categories?post=67"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_alhallak\/wp-json\/wp\/v2\/tags?post=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}