{"slug":"linear-eq","tier":1,"subject":"algebra","title":"Linear Eq Ref","description":"Reference card for linear equation forms.","files":[{"filename":"LINEAR.py","content":"def p(s):print(s)\ndef o1():\n p(\"=STANDARD=\")\n p(\"ax+b=0\")\n p(\"x=-b/a\")\ndef o2():\n p(\"=SLOPE-INT=\")\n p(\"y=mx+b\")\n p(\"m=slope\")\n p(\"b=y-int\")\ndef o3():\n p(\"=POINT-SL=\")\n p(\"y-y1=m(x-x1)\")\ndef menu():\n while True:\n  p(\"=LINEAR=\")\n  p(\"1:STANDARD\")\n  p(\"2:SLOPE-INT\")\n  p(\"3:POINT-SL\")\n  p(\"0:EXIT\")\n  c=input(\"?>\")\n  if c==\"1\":o1()\n  elif c==\"2\":o2()\n  elif c==\"3\":o3()\n  elif c==\"0\":break\nmenu()"}],"testCases":[{"id":"standard-form","inputs":["1","0"],"expectedContains":["ax+b=0"]},{"id":"slope-int-form","inputs":["2","0"],"expectedContains":["y=mx+b"]}],"usage":"Reference card for the three forms of a linear equation. No inputs — each menu option prints the form and the key identifier.\n\n- `1:STANDARD` — `ax+b=0`, so `x=−b/a`.\n- `2:SLOPE-INT` — `y=mx+b` with `m` = slope, `b` = y-intercept.\n- `3:POINT-SL` — `y−y₁ = m(x−x₁)`.\n- `0:EXIT` — leave.","example":{"problem":"A test asks you to write the equation of the line through (2, 5) with slope 3. You forget which form to use.","walkthrough":"1. Run `LINEAR`.\n2. Pick `3:POINT-SL`.\n3. Screen shows: `y-y1=m(x-x1)`.\n\nPlug in: y − 5 = 3(x − 2). Optional: expand to slope-intercept form y = 3x − 1. ✓"}}