{"id":25319697,"url":"https://github.com/aghajari/pseudocode","last_synced_at":"2025-09-10T08:40:44.908Z","repository":{"id":98252958,"uuid":"417680694","full_name":"Aghajari/PseudoCode","owner":"Aghajari","description":"Simple PseudoCode Reader, Parser and Compiler!","archived":false,"fork":false,"pushed_at":"2021-10-31T17:00:08.000Z","size":610,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T19:37:52.071Z","etag":null,"topics":["pseudocode"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aghajari.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-10-16T01:15:28.000Z","updated_at":"2023-11-11T11:44:58.000Z","dependencies_parsed_at":"2023-05-18T23:00:28.809Z","dependency_job_id":null,"html_url":"https://github.com/Aghajari/PseudoCode","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Aghajari/PseudoCode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aghajari%2FPseudoCode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aghajari%2FPseudoCode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aghajari%2FPseudoCode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aghajari%2FPseudoCode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aghajari","download_url":"https://codeload.github.com/Aghajari/PseudoCode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aghajari%2FPseudoCode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274433838,"owners_count":25284427,"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","status":"online","status_checked_at":"2025-09-10T02:00:12.551Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["pseudocode"],"created_at":"2025-02-13T20:54:40.412Z","updated_at":"2025-09-10T08:40:44.891Z","avatar_url":"https://github.com/Aghajari.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PseudoCode\n[JD Says:](https://users.csc.calpoly.edu/~jdalbey/SWE/pdl_std.html) Pseudocode is a kind of structured english for describing algorithms. It allows the designer to focus on the logic of the algorithm without being distracted by details of language syntax.  At the same time, the pseudocode needs to be complete.  It describe the entire logic of the algorithm so that implementation becomes a rote mechanical task of translating line by line into source code.\n\u003cbr\u003e\nHere we go, A simple PseudoCode Reader, parser and compiler! We can develop this and after testing it get it's real source code in many different programming languages specially C and Java, Yay!\n\n![Preview](./images/PseudoCode.gif)\n\nYou can download the jar file from [here](./AXPseudoCode.jar) and test it right now!\n\u003cbr\u003e\u003cb\u003eNote:\u003c/b\u003e Don't forget to enter `exit` at the end of your PseudoCode.\n\n```python\njava -jar AXPseudoCode.jar\n\nEnter your PseudoCode here and enter exit at the end...\n--------------------------------------------------------\nprint \"Enter 5 integers to get the average\"\nread x[5]\nsum = sum(x)\nprint \"Sum = \" sum \", Average = \" sum / x.length\nexit\n----------------\nWait a moment...\n----------------\n----------------\nLet's start :)\n----------------\nEnter 5 integers to get the average\n1 2 3 4 5\nSum = 15, Average = 3\n----------------\nDONE\n----------------\n```\n## IF\nBinary choice on a given Boolean condition is indicated by the use of four keywords: IF, THEN, ELSE, and ENDIF. The general form is:\n```python\nprint \"Enter an integer\"\nread n\nIF n \u003e 0\n   print \"+\"\nELSE IF n \u003c 0\n   print \"-\"\nELSE\n   print \"0\"\n```\nOpening/Closing statement (by Then, EndIf or {}) isn't necessary.\n\n## WHILE\nThe WHILE construct is used to specify a loop with a test at the top. The beginning and ending of the loop are indicated by two keywords WHILE and ENDWHILE. The general form is:\n```python\nSET i to 0\nWHILE i \u003c 10\n   i++\n   print i\n```\nOpening/Closing statement (by ENDWHILE or {}) isn't necessary.\n\n## REPEAT-UNTIL\nThis loop is similar to the WHILE loop except that the test is performed at the bottom of the loop instead of at the top. Two keywords, REPEAT and UNTIL are used. The general form is:\n```python\nsum = 0\nn = 0\nREPEAT\n   print \"Enter an integer\"\n   read n\n   sum += n\nUNTIL n != 0\nprint \"SUM = \" \u0026 sum\n```\nYou can also use DO, WHILE instead of REPEAT, UNTIL.\n\n## FOR\nThis loop is a specialized construct for iterating a specific number of times, often called a \"counting\" loop.  Two keywords, FOR and ENDFOR are used. The general forms are:\n\n``` python\nFOR i = 0 to 10\n   print i\n   \nFOR i = 10 to 0 step -1\n   print i\n   \nFOR i in range(10, 20)\n   print i\n   \nx = [5, 4, 3, 2, 1]\nFOR EACH i on x\n   print i * 2\n```\nOpening/Closing statement (by ENDFOR or {}) isn't necessary.\n\n## TYPES\nSupports `%s`, `%d`, `%f`, `%b`, `%c`, ... or just write it's type like `BOOL` or `boolean`, `String`, `integer` or `int`, `double`, ...\n```python\nprint \"Enter your name and age : \"\nread %s:name, %d:age\nprint \"Hello \" name \", Your Age is \" age\n```\n\n## DEFAULTS\n```python\nSET a to 24\nSUBTRACT 10 from a \nADD 15 to a\nprint a\n// a = 29\n```\n\n## SAMPLES\n\n- An algorithm to reverse array, for example [1, 2, 3, 4, 5] to [5, 4, 3, 2, 1]\n```python\nprint “Please enter 5 integers”\nread x[5]\n\nreverse(x, 0, x.length - 1)\nprint x\n\nAlgorithm swap(x[], j, i)\n\ntemp = x[j]\nx[j] = x[i]\nx[i] = temp\n\nAlgorithm reverse(A[], start, end)\n\nif (start \u003e= end)\n return\nelse\n swap(A, start, end)\n reverse(A, start + 1, end - 1)\n```\n\n- An algorithm to sum digits of a number, for example 123 =\u003e 1 + 2 + 3\n```python\nprint “Please enter a positive integer”\nread m\nn = m\nsum = 0\nr = 0\nwhile (n != 0)\n  r = n mod 10\n  sum = sum + r\n  n = n / 10\nprint “sum of digits of ” m “ = “ sum\n```\n\n- An algorithm to get gcd of n numbers\n``` python\nprint \"Enter the number of integers\"\nread n\nprint \"Enter \" n \" integers\"\nread x[n]\nprint \"GCD = \" GCD(x)\n```\n\n## Author\nAmir Hossein Aghajari\n\nLicense\n=======\n\n    Copyright 2021 Amir Hossein Aghajari\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n\u003cbr\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cimg width=\"64\" alt=\"LCoders | AmirHosseinAghajari\" src=\"https://user-images.githubusercontent.com/30867537/90538314-a0a79200-e193-11ea-8d90-0a3576e28a18.png\"\u003e\n  \u003cbr\u003e\u003ca\u003eAmir Hossein Aghajari\u003c/a\u003e • \u003ca href=\"mailto:amirhossein.aghajari.82@gmail.com\"\u003eEmail\u003c/a\u003e • \u003ca href=\"https://github.com/Aghajari\"\u003eGitHub\u003c/a\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faghajari%2Fpseudocode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faghajari%2Fpseudocode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faghajari%2Fpseudocode/lists"}