]/[Prolog], this problem would be [trivial] to solve.\r\n\r\n

4.6 The [standard approach].

\r\n\r\n

We know what a Lion is from [ISO] 4711/X.123. Since [CCITT] have specified a Lion to be a [particular option] of a [cat] we will have to wait for a [harmonized standard] to appear. $20,000,000 have been [fund]ed for [initial investigations] into this [standard development].\r\n\r\n

[linear search|4.7 Linear search.]

\r\n\r\n

Stand in the top left hand [corner] of the Sahara Desert. Take one [step] east. Repeat until you have found the lion, or you reach the right hand edge. If you reach the right hand [edge], take one step southwards, and proceed towards the left hand edge. When you finally reach the lion, put it the cage. If the lion should happen to eat you before you manage to get it in the cage, press the [reset button], and try again.\r\n

Optionally, [experienced programmer]s will place a [pink elephant] in [Johannesburg] as a [sentinel value]. (thanks [ariels])\r\n \r\n

[Dijkstra's algorithm |4.8 The Dijkstra approach:]

\r\n\r\n

The way the problem reached me was: catch a wild lion in the Sahara\r\nDesert. [Another way of stating the problem] is:\r\n\r\n

\r\n       [Axiom] 1: Sahara [elem] deserts\r\n       Axiom 2: Lion elem Sahara\r\n       Axiom 3: NOT(Lion elem cage)\r\n
\r\n

We observe the following invariant:\r\n\r\n

       P1:     C(L) v not(C(L))\r\n
\r\n

where C(L) means: the value of \"L\" is in the cage.\r\n\r\n

Establishing C initially is trivially accomplished with the statement\r\n\r\n

       ;cage := {}\r\nNote 0:\r\n[This is easily implemented] by opening the door to the \r\ncage and shaking out any lions that happen to be there \r\ninitially.\r\n(End of note 0.)\r\n
\r\n

The obvious [program structure] is then:\r\n

\r\n       ;cage:={}\r\n       ;do NOT (C(L)) ->\r\n               ;\"approach lion under [invariance] of P1\"\r\n               ;if P(L) ->\r\n                       ;\"insert lion in cage\"\r\n                [] not P(L) ->\r\n                       ;skip\r\n               ;fi\r\n       ;od\r\n\r\nwhere P(L) means: the value of L is within arm's reach.\r\n\r\nNote 1:\r\nAxiom 2 ensures that the [loop termination|loop terminates].\r\n(End of note 1.)\r\n\r\nExercise 0:\r\nRefine the step \"Approach lion under invariance of P1\".\r\n(End of exercise 0.)\r\n\r\nNote 2:\r\nThe program is [robust] in the sense that it will lead to\r\n[abortion] if the value of L is \"lioness\".\r\n(End of note 2.)\r\n\r\nRemark 0: This may be a new sense of the word \"robust\" for you.\r\n(End of remark 0.)\r\n\r\nNote 3:\r\n\r\nFrom observation we can see that the above program leads to the\r\n[desired goal]. It goes without saying that we therefore do not \r\nhave to [run] it.\r\n(End of note 3.)\r\n(End of approach.) \r\n(End of document)\r\n
\r\n\r\n         
\r\n\r\n

You can find an infinity of variations on the above [theme] floating around in the [cyberspace] (and probably in [dead tree] format too), but some of them tend to wear the concept a bit [thin]...

","type":"writeup","writeuptype":"idea","node_id":1478484}],"type":"e2node"},"user":{"info_authorsince_off":0,"can_vote":0,"votesafety":0,"can_cool":0,"coolsleft":0,"is_editor":0,"node_id":"779713","is_guest":1,"coolsafety":0,"title":"Guest User"},"type":"e2node","categories":[]},"newWriteups":[{"notnew":false,"writeuptype":"person","node_id":"2213472","parent":{"type":"e2node","node_id":2213471,"title":"Martin Bot"},"author":{"node_id":977360,"title":"Glowing Fish","type":"user"},"title":"Martin Bot (person)","is_junk":false,"is_log":false},{"notnew":false,"writeuptype":"fiction","node_id":"2213473","author":{"title":"Swift","node_id":1251226,"type":"user"},"parent":{"type":"e2node","title":"We Own the Skies","node_id":2213474},"is_log":false,"title":"We Own the Skies (fiction)","is_junk":false},{"notnew":false,"writeuptype":"thing","node_id":"2213469","author":{"type":"user","node_id":1117836,"title":"drownzsurf"},"parent":{"node_id":2205541,"title":"distro hopping","type":"e2node"},"is_junk":false,"is_log":false,"title":"distro hopping (thing)"},{"author":{"node_id":977360,"title":"Glowing Fish","type":"user"},"parent":{"title":"YouTube Community Guidelines","node_id":2213465,"type":"e2node"},"is_log":false,"is_junk":false,"title":"YouTube Community Guidelines (thing)","notnew":false,"writeuptype":"thing","node_id":"2213466"},{"is_log":false,"is_junk":false,"title":"No Me Either (poetry)","author":{"title":"lostcauser","node_id":1992599,"type":"user"},"parent":{"node_id":2213461,"title":"No Me Either","type":"e2node"},"node_id":"2213460","writeuptype":"poetry","notnew":false},{"writeuptype":"review","notnew":false,"node_id":"2213459","parent":{"title":"The Fall of the Towers","node_id":1679687,"type":"e2node"},"author":{"node_id":977360,"title":"Glowing Fish","type":"user"},"is_junk":false,"is_log":false,"title":"The Fall of the Towers (review)"},{"writeuptype":"fiction","notnew":false,"node_id":"2213454","parent":{"node_id":2213455,"title":"Hello, Thinker","type":"e2node"},"author":{"node_id":1251226,"title":"Swift","type":"user"},"is_junk":false,"title":"Hello, Thinker (fiction)","is_log":false},{"parent":{"type":"e2node","title":"A Hornet's Nest in the Back of a Barn","node_id":2213449},"author":{"node_id":1992599,"title":"lostcauser","type":"user"},"title":"A Hornet's Nest in the Back of a Barn (poetry)","is_log":false,"is_junk":false,"writeuptype":"poetry","notnew":false,"node_id":"2213448"},{"notnew":false,"writeuptype":"thing","node_id":"2208061","author":{"node_id":1153472,"title":"etouffee","type":"user"},"parent":{"type":"e2node","node_id":2208060,"title":"From some far memory"},"title":"From some far memory (thing)","is_log":false,"is_junk":false},{"node_id":"2213441","writeuptype":"poetry","notnew":false,"is_junk":false,"is_log":false,"title":"The Chocolate Room (poetry)","author":{"type":"user","title":"lostcauser","node_id":1992599},"parent":{"node_id":2213442,"title":"The Chocolate Room","type":"e2node"}},{"author":{"type":"user","node_id":1251226,"title":"Swift"},"parent":{"title":"Dick Kickem Lifts the Gay Way","node_id":2213439,"type":"e2node"},"is_junk":false,"is_log":false,"title":"Dick Kickem Lifts the Gay Way (fiction)","writeuptype":"fiction","notnew":false,"node_id":"2213438"},{"is_junk":false,"is_log":false,"title":"Maui (thing)","parent":{"node_id":12024,"title":"Maui","type":"e2node"},"author":{"type":"user","title":"Pandeism Fish","node_id":1902455},"node_id":"2213436","notnew":false,"writeuptype":"thing"},{"node_id":"2213435","notnew":false,"writeuptype":"thing","is_log":false,"is_junk":false,"title":"mirzabeig dynamical system (thing)","author":{"type":"user","node_id":1797883,"title":"raincomplex"},"parent":{"type":"e2node","title":"mirzabeig dynamical system","node_id":2213434}},{"is_junk":false,"is_log":false,"title":"Joseph Ducreux (person)","author":{"title":"Jet-Poop","node_id":6339,"type":"user"},"parent":{"title":"Joseph Ducreux","node_id":2023993,"type":"e2node"},"node_id":"2213433","notnew":false,"writeuptype":"person"},{"is_log":false,"title":"World and Life Views, Emerging From Religion, Philosophy and Perception of Nature (thing)","is_junk":false,"node_id":"2213427","notnew":false,"author":{"title":"Pandeism Fish","node_id":1902455,"type":"user"},"parent":{"type":"e2node","node_id":2213432,"title":"World and Life Views, Emerging From Religion, Philosophy and Perception of Nature"},"writeuptype":"thing"},{"author":{"title":"Glowing Fish","node_id":977360,"type":"user"},"parent":{"node_id":25493,"title":"Paradise","type":"e2node"},"is_log":false,"is_junk":false,"title":"Paradise (review)","writeuptype":"review","notnew":false,"node_id":"2213429"},{"node_id":"2213422","notnew":false,"writeuptype":"poetry","is_junk":false,"is_log":false,"title":"Long Hair (poetry)","parent":{"type":"e2node","node_id":35250,"title":"Long Hair"},"author":{"type":"user","title":"Oolong","node_id":1017738}},{"writeuptype":"poetry","notnew":false,"node_id":"2213395","parent":{"node_id":2213393,"title":"knowing many, loving none","type":"e2node"},"author":{"node_id":1153472,"title":"etouffee","type":"user"},"is_log":false,"is_junk":false,"title":"knowing many, loving none (poetry)"},{"author":{"title":"Finky","node_id":2212534,"type":"user"},"parent":{"type":"e2node","title":"Ball's Pyramid","node_id":2197262},"is_junk":false,"is_log":false,"title":"Ball's Pyramid (thing)","writeuptype":"thing","notnew":false,"node_id":"2213418"},{"is_log":false,"title":"I Will Kill Your Imaginary Friend for $200 (review)","is_junk":false,"author":{"title":"Glowing Fish","node_id":977360,"type":"user"},"parent":{"type":"e2node","node_id":2213415,"title":"I Will Kill Your Imaginary Friend for $200"},"node_id":"2213416","notnew":false,"writeuptype":"review"},{"notnew":false,"writeuptype":"thing","node_id":"2213360","parent":{"type":"e2node","title":"The Pandeism Anthology Project goes to war with Amazon.com","node_id":2213409},"author":{"type":"user","node_id":1902455,"title":"Pandeism Fish"},"is_log":false,"title":"The Pandeism Anthology Project goes to war with Amazon.com (thing)","is_junk":false},{"notnew":false,"writeuptype":"thing","node_id":"2213408","author":{"type":"user","title":"JD","node_id":1455010},"parent":{"type":"e2node","title":"February 28, 2026","node_id":2213405},"title":"February 28, 2026 (thing)","is_junk":false,"is_log":true},{"node_id":"2213406","notnew":false,"writeuptype":"personal","title":"old excerpt from my grandpas emails to his brothers (personal)","is_log":false,"is_junk":false,"parent":{"type":"e2node","title":"old excerpt from my grandpas emails to his brothers","node_id":2213407},"author":{"type":"user","node_id":2201248,"title":"lilah june"}},{"node_id":"2213402","notnew":false,"writeuptype":"poetry","is_log":false,"is_junk":false,"title":"The Leaves Don't Know What November Is (poetry)","author":{"node_id":1992599,"title":"lostcauser","type":"user"},"parent":{"type":"e2node","title":"The Leaves Don't Know What November Is","node_id":2213403}},{"is_log":false,"is_junk":false,"title":"Marlene Remembers, Marlene Laughs (fiction)","parent":{"type":"e2node","node_id":2213400,"title":"Marlene Remembers, Marlene Laughs"},"author":{"title":"lostcauser","node_id":1992599,"type":"user"},"node_id":"2213399","notnew":false,"writeuptype":"fiction"},{"node_id":"2213398","notnew":false,"writeuptype":"definition","title":"Paper Towns (definition)","is_junk":false,"is_log":false,"parent":{"node_id":1991895,"title":"Paper Towns","type":"e2node"},"author":{"type":"user","node_id":2212534,"title":"Finky"}},{"notnew":false,"writeuptype":"idea","node_id":"2213390","parent":{"type":"e2node","title":"buycott","node_id":2213389},"author":{"node_id":1180811,"title":"mauler","type":"user"},"is_junk":false,"title":"buycott (idea)","is_log":false},{"notnew":false,"author":{"type":"user","title":"lostcauser","node_id":1992599},"parent":{"title":"Fill in the Blanks","node_id":2213384,"type":"e2node"},"writeuptype":"fiction","is_junk":false,"title":"Fill in the Blanks (fiction)","is_log":false,"node_id":"2213383"},{"is_junk":false,"title":"Like stars, blazing beacons of light in the emptiness of space (personal)","is_log":false,"node_id":"2213378","notnew":false,"parent":{"node_id":2213382,"title":"Like stars, blazing beacons of light in the emptiness of space","type":"e2node"},"author":{"node_id":2049451,"title":"relentless","type":"user"},"writeuptype":"personal"},{"author":{"type":"user","title":"O-Swirl","node_id":1132040},"parent":{"type":"e2node","node_id":2213381,"title":"Electro Convulsive Treatment"},"is_junk":false,"title":"Electro Convulsive Treatment (thing)","is_log":false,"writeuptype":"thing","notnew":false,"node_id":"2213379"},{"is_junk":false,"is_log":false,"title":"Boys Will Lie (poetry)","author":{"type":"user","title":"lostcauser","node_id":1992599},"parent":{"title":"Boys Will Lie","node_id":2213374,"type":"e2node"},"node_id":"2213375","notnew":false,"writeuptype":"poetry"},{"writeuptype":"personal","notnew":false,"node_id":"2213369","parent":{"type":"e2node","node_id":2213370,"title":"An Old Coffee Can and a Libbyland Dinner"},"author":{"title":"lostcauser","node_id":1992599,"type":"user"},"is_log":false,"is_junk":false,"title":"An Old Coffee Can and a Libbyland Dinner (personal)"},{"node_id":"2213364","writeuptype":"log","notnew":false,"is_log":true,"is_junk":false,"title":"February 21, 2026 (log)","parent":{"node_id":2213362,"title":"February 21, 2026","type":"e2node"},"author":{"title":"passalidae","node_id":2178478,"type":"user"}},{"node_id":"2213357","writeuptype":"poetry","notnew":false,"is_log":false,"title":"I Would Like To Be Only a Bright Red Coat (poetry)","is_junk":false,"parent":{"node_id":2213358,"title":"I Would Like To Be Only a Bright Red Coat","type":"e2node"},"author":{"node_id":1992599,"title":"lostcauser","type":"user"}},{"node_id":"2213355","title":"It always spits before it rains (personal)","is_junk":false,"is_log":false,"writeuptype":"personal","notnew":false,"author":{"type":"user","title":"Hazelnut","node_id":1708694},"parent":{"type":"e2node","title":"It always spits before it rains","node_id":2213350}},{"is_junk":false,"title":"leetcode (opinion)","is_log":false,"parent":{"title":"leetcode","node_id":2213354,"type":"e2node"},"author":{"type":"user","node_id":2049451,"title":"relentless"},"node_id":"2213351","notnew":false,"writeuptype":"opinion"},{"author":{"node_id":2212534,"title":"Finky","type":"user"},"parent":{"title":"Kyawthuite","node_id":2213353,"type":"e2node"},"is_log":false,"title":"Kyawthuite (thing)","is_junk":false,"notnew":false,"writeuptype":"thing","node_id":"2213352"},{"author":{"type":"user","title":"lilah june","node_id":2201248},"parent":{"node_id":2213349,"title":"maybe i'll be mauled","type":"e2node"},"is_log":false,"title":"maybe i'll be mauled (log)","is_junk":false,"writeuptype":"log","notnew":false,"node_id":"2213259"},{"writeuptype":"fiction","notnew":false,"node_id":"2213347","author":{"type":"user","node_id":1992599,"title":"lostcauser"},"parent":{"type":"e2node","title":"Better the Bones of the Lions You Know","node_id":2213346},"title":"Better the Bones of the Lions You Know (fiction)","is_log":false,"is_junk":false}],"coolnodes":[{"wu_author":"surturz","coolwriteups_id":1283204,"writeupCooled":3,"parentNode":1283173,"latest_cool":"2026-03-14 06:32:03","parentTitle":"Bahasa Melayu"},{"coolwriteups_id":1909160,"parentNode":1909146,"writeupCooled":6,"wu_author":"Glowing Fish","parentTitle":"Portland, Oregon and the Missing Oak Savannah","latest_cool":"2026-03-13 07:16:48"},{"parentNode":1248900,"writeupCooled":2,"wu_author":"e2reneta","coolwriteups_id":1248901,"parentTitle":"due diligence","latest_cool":"2026-03-12 21:16:00"},{"latest_cool":"2026-03-12 11:04:42","parentTitle":"YouTube Community Guidelines","coolwriteups_id":2213466,"wu_author":"Glowing Fish","writeupCooled":1,"parentNode":2213465},{"wu_author":"p03","writeupCooled":3,"parentNode":1461106,"latest_cool":"2026-03-12 05:48:23","parentTitle":"Why do we always whisper in the dark?","coolwriteups_id":1461830},{"wu_author":"lostcauser","writeupCooled":3,"parentNode":2213442,"latest_cool":"2026-03-12 02:52:29","parentTitle":"The Chocolate Room","coolwriteups_id":2213441},{"parentNode":2213461,"wu_author":"lostcauser","writeupCooled":1,"parentTitle":"No Me Either","latest_cool":"2026-03-11 19:12:22","coolwriteups_id":2213460},{"wu_author":"Footprints","writeupCooled":30,"coolwriteups_id":1407014,"parentNode":1407002,"latest_cool":"2026-03-11 07:20:18","parentTitle":"The Raven (The Edgar Allan Porn version)"},{"coolwriteups_id":1309394,"parentTitle":"Hammurabi","latest_cool":"2026-03-11 06:34:00","parentNode":123905,"wu_author":"giantfish","writeupCooled":1},{"latest_cool":"2026-03-11 03:04:44","parentTitle":"The Fall of the Towers","wu_author":"Glowing Fish","writeupCooled":1,"parentNode":1679687,"coolwriteups_id":2213459},{"parentTitle":"Hello, Thinker","latest_cool":"2026-03-10 17:38:41","parentNode":2213455,"writeupCooled":1,"wu_author":"Swift","coolwriteups_id":2213454},{"wu_author":"lostcauser","writeupCooled":2,"coolwriteups_id":2213448,"parentNode":2213449,"latest_cool":"2026-03-10 17:36:37","parentTitle":"A Hornet's Nest in the Back of a Barn"},{"parentNode":2208060,"writeupCooled":1,"coolwriteups_id":2208061,"wu_author":"etouffee","parentTitle":"From some far memory","latest_cool":"2026-03-10 16:14:19"},{"parentNode":14771,"writeupCooled":6,"coolwriteups_id":1034568,"wu_author":"QXZ","parentTitle":"Mountain Dew","latest_cool":"2026-03-10 07:31:17"},{"writeupCooled":1,"wu_author":"Tem42","parentNode":2185609,"latest_cool":"2026-03-10 03:05:22","parentTitle":"Vegan Mayo","coolwriteups_id":2185610},{"parentNode":579509,"coolwriteups_id":2212232,"wu_author":"cruxfau","writeupCooled":1,"parentTitle":"No Smoking","latest_cool":"2026-03-09 23:26:32"},{"coolwriteups_id":2098687,"writeupCooled":3,"wu_author":"Auspice","parentNode":2098686,"latest_cool":"2026-03-09 18:24:51","parentTitle":"Pharmacology and the NOC"},{"latest_cool":"2026-03-09 18:06:32","parentTitle":"Limit all games to one frame per second","coolwriteups_id":852103,"wu_author":"fondue","writeupCooled":2,"parentNode":852093},{"parentTitle":"Numbers Station","latest_cool":"2026-03-09 17:28:56","parentNode":575979,"coolwriteups_id":838131,"wu_author":"Uberfetus","writeupCooled":8},{"coolwriteups_id":1977164,"wu_author":"EnochRoot","writeupCooled":3,"parentNode":906951,"latest_cool":"2026-03-09 17:27:41","parentTitle":"Chocolat"},{"parentNode":2213389,"writeupCooled":4,"wu_author":"mauler","parentTitle":"buycott","latest_cool":"2026-03-09 10:49:32","coolwriteups_id":2213390},{"parentTitle":"World and Life Views, Emerging From Religion, Philosophy and Perception of Nature","latest_cool":"2026-03-08 07:50:39","parentNode":2213432,"wu_author":"Pandeism Fish","writeupCooled":1,"coolwriteups_id":2213427},{"latest_cool":"2026-03-08 07:49:24","parentTitle":"Joseph Ducreux","wu_author":"Jet-Poop","writeupCooled":3,"coolwriteups_id":2213433,"parentNode":2023993},{"parentNode":42755,"writeupCooled":2,"coolwriteups_id":910494,"wu_author":"r4v5","parentTitle":"Mandelbrot set","latest_cool":"2026-03-08 01:05:00"},{"latest_cool":"2026-03-07 17:23:50","parentTitle":"Tunnel in the Key of G","coolwriteups_id":1145567,"wu_author":"tandex","writeupCooled":10,"parentNode":1145537},{"latest_cool":"2026-03-07 13:14:13","parentTitle":"Maui","writeupCooled":1,"wu_author":"Pandeism Fish","coolwriteups_id":2213436,"parentNode":12024},{"parentNode":25493,"wu_author":"Glowing Fish","coolwriteups_id":2213429,"writeupCooled":1,"parentTitle":"Paradise","latest_cool":"2026-03-07 03:34:22"},{"parentTitle":"Marie Antoinette","latest_cool":"2026-03-07 02:57:53","parentNode":138165,"wu_author":"Evil Catullus","writeupCooled":5,"coolwriteups_id":880706},{"parentNode":1977251,"wu_author":"shaogo","writeupCooled":2,"coolwriteups_id":1977252,"parentTitle":"Horseradish Cottage Cheese","latest_cool":"2026-03-06 23:33:44"},{"parentTitle":"Turning coffee into words","latest_cool":"2026-03-06 21:59:22","parentNode":2105994,"coolwriteups_id":2105993,"wu_author":"IWhoSawTheFace","writeupCooled":3}],"architecture":"aarch64","staffpicks":[{"type":"e2node","node_id":"30082","title":"Finger picking"},{"title":"Nathan, This Is Unacceptable","node_id":"401546","type":"e2node"},{"type":"e2node","node_id":"643898","title":"Why do joints crack?"},{"type":"e2node","node_id":"599350","title":"Chopstick vs. Fork"},{"title":"food poisoning","node_id":"121530","type":"e2node"},{"title":"American Beauty","node_id":"138450","type":"e2node"},{"title":"The Wandering Jew","node_id":"117649","type":"e2node"},{"title":"Deals well with ambiguity: a savagely long writeup about why boys are not like girls and other things","node_id":"1509862","type":"e2node"},{"title":"grunts","node_id":"82903","type":"e2node"},{"type":"e2node","title":"electronegativity","node_id":"605249"},{"type":"e2node","node_id":"714262","title":"Looking, Looking"},{"node_id":"1055541","title":"Taoist alchemy","type":"e2node"},{"type":"e2node","title":"The Johnny Appleseed of LSD","node_id":"1210858"},{"type":"e2node","node_id":"785430","title":"Life of a government employee"},{"type":"e2node","title":"Automation Matron","node_id":"760725"}],"node_id":"1478480","hasMessagesNodelet":0,"node":{"type":"e2node","node_id":"1478480","title":"How To Catch a Lion in the Sahara Desert","createtime":1058820744},"assets_location":"https://s3-us-west-2.amazonaws.com/deployed.everything2.com/12f701fc1c860c10ddd3467bb16b07723732e55f","lastnode_id":null,"use_local_assets":"0","lastCommit":"12f701fc1c860c10ddd3467bb16b07723732e55f","guest":1,"developerNodelet":{},"nodetype":"e2node","user":{"title":"Guest User","chanop":false,"developer":true,"editor":false,"node_id":"779713","admin":false,"guest":true,"in_room":"0"},"reactPageMode":true,"nodeletorder":["sign_in","recommended_reading","new_writeups"],"display_prefs":{"vit_hidenodeinfo":0,"vit_hidemaintenance":0,"vit_hidenodeutil":0,"vit_hidelist":0,"num_newwus":"10","vit_hidemisc":0,"rtn_hideedc":0,"edn_hideutil":0,"nw_nojunk":false,"rtn_hidecwu":0,"edn_hideedev":0,"rtn_hidenws":0},"recaptcha":{"publicKey":"6LeF2BwsAAAAAMrkwFG7CXJmF6p0hV2swBxYfqc2","enabled":true},"pageheader":{}}