{"id":15049489,"url":"https://github.com/jdee/xmas","last_synced_at":"2025-04-10T02:13:04.042Z","repository":{"id":138590910,"uuid":"198378597","full_name":"jdee/xmas","owner":"jdee","description":"Restoration of a classic K\u0026R C program","archived":false,"fork":false,"pushed_at":"2019-07-26T16:01:15.000Z","size":13,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T02:12:55.739Z","etag":null,"topics":["c","k-and-r"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jdee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-23T07:41:12.000Z","updated_at":"2023-09-04T20:21:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"ede1cd8c-09a7-4eb1-830e-5e4cbdce7025","html_url":"https://github.com/jdee/xmas","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdee%2Fxmas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdee%2Fxmas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdee%2Fxmas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdee%2Fxmas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdee","download_url":"https://codeload.github.com/jdee/xmas/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248142903,"owners_count":21054671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","k-and-r"],"created_at":"2024-09-24T21:20:43.147Z","updated_at":"2025-04-10T02:13:03.993Z","avatar_url":"https://github.com/jdee.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is without a doubt one of the greatest computer programs ever written\nand will forever stand as a monument to skill and artistry in defiance of\nstandards, maintainability and productivity. Note the entire program is a\nsingle line of code.\n\nIt is regrettably difficult to compile K\u0026R C in 2019, so I've updated it to\nANSI C to build and run cleanly with GCC, Clang \u0026 Visual C.\n\nSome changes were necessary to compile. Others suppress warnings without\nresorting to compiler options or pragmata. All changes have been made in\nlimited ways to minimize the intrusion and preserve the opacity and spirit\nof the original code.\n\nThis surgery is limited to\n1. Some preprocessor directives and a typedef before main() for the purpose of\n   type conversion.\n2. Conversion of argument syntax from K\u0026R to ANSI.\n3. Conformity with the ANSI signature of main().\n4. Some stack variables at the start of main to facilitate type safety\n   and conformity.\n5. Explicitly casting the return value of main.\n\nJimmy Dee  \nJuly 23, 2019\n\nTo build and run, simply type:\n\nUnix:\n```bash\nmake hay\n```\n\nWindows:\n```\ncl xmas.c\nxmas\n```\nor use the Visual Studio Solution xmas.sln in the repo.\n\nThe original K\u0026R:\n```c\n/*\nLEAST LIKELY TO COMPILE SUCCESSFULLY:\n  Ian Phillipps, Cambridge Consultants Ltd., Cambridge, England\n\n  An appropriate program for December 25th, this consists primarily of\n  calls to main() combined by a lot of the ternary conditional (?:)\n  operators. Have you ever seen a more forceful return? The judges note\n  that this program looked like what you would get by pounding on the keys\n  of a type writer at random.\n\n  Note -- I have made a minor correction (for spelling) to line 47, where I\n  added a missing comma at column 59.\n*/\n\nmain(t,_,a)\nchar\n*\na;\n{\nreturn!\n\n0\u003ct?\nt\u003c3?\n\nmain(-79,-13,a+\nmain(-87,1-_,\nmain(-86, 0, a+1 )\n\n\n+a)):\n\n1,\nt\u003c_?\nmain(t+1, _, a )\n:3,\n\nmain ( -94, -27+t, a )\n\u0026\u0026t == 2 ?_\n\u003c13 ?\n\nmain ( 2, _+1, \"%s %d %d\\n\" )\n\n:9:16:\nt\u003c0?\nt\u003c-72?\nmain( _, t,\n\"@n'+,#'/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l,+,/n{n+,/+#n+,/#;\\\n#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l q#'+d'K#!/+k#;\\\nq#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw' i;# ){nl]!/n{n#'; \\\nr{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#\\\n\\\nn'wk nw' iwk{KK{nl]!/w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c ;;\\\n{nl'-{}rw]'/+,}##'*}#nc,',#nw]'/+kd'+e}+;\\\n#'rdq#w! nr'/ ') }+}{rl#'{n' ')# }'+}##(!!/\")\n:\nt\u003c-50?\n_==*a ?\nputchar(31[a]):\n\nmain(-65,_,a+1)\n:\nmain((*a == '/') + t, _, a + 1 )\n:\n\n0\u003ct?\n\nmain ( 2, 2 , \"%s\")\n:*a=='/'||\n\nmain(0,\n\nmain(-61,*a, \"!ek;dc i@bK'(q)-[w]*%n+r3#l,{}:\\nuwloca-O;m .vpbks,fxntdCeghiry\")\n\n,a+1);}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdee%2Fxmas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdee%2Fxmas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdee%2Fxmas/lists"}