{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":718929920,"defaultBranch":"master","name":"monty","ownerLogin":"paschalugwu","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2023-11-15T04:34:07.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/106428248?v=4","public":true,"private":false,"isOrgOwned":false},"refInfo":{"name":"","listCacheKey":"v0:1700056347.0","currentOid":""},"activityList":{"items":[{"before":"e9603ca4c243bf1e3ee9f67b111ea22375e25398","after":"0d35dc27176ca9d79bbb7f8563c14eed0ada21c5","ref":"refs/heads/master","pushedAt":"2024-07-09T15:36:44.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"Update README.md","shortMessageHtmlLink":"Update README.md"}},{"before":"bc405298ab6f5fe6334f8ee2f39b16510e3eb3d2","after":"e9603ca4c243bf1e3ee9f67b111ea22375e25398","ref":"refs/heads/master","pushedAt":"2023-11-16T18:21:59.000Z","pushType":"push","commitsCount":2,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"Merge branch 'master' of https://github.com/paschalugwu/monty","shortMessageHtmlLink":"Merge branch 'master' of https://github.com/paschalugwu/monty"}},{"before":"6e2db3faa325666bcbdfe0c161c1d3017818603a","after":"bc405298ab6f5fe6334f8ee2f39b16510e3eb3d2","ref":"refs/heads/master","pushedAt":"2023-11-16T18:01:18.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"chore(readme): Update README.md with project details and task list\n\nUpdate the README.md file with information about the Monty Interpreter project. Provide an overview of the project, including its purpose and the Monty scripting language. Explain the data structures used in the project, such as the stack and instruction structures.\n\nInclude details on how to compile and run the code, specifying the required compiler options. Mention that the program should print output to stdout and error messages to stderr.\n\nDescribe the Monty Byte Code files, including their file extension, format, and how comments should be handled.\n\nExplain the functionality of the Monty program, including its usage and error handling for missing or invalid files, unknown instructions, and malloc failures.\n\nCreate a task list that outlines the different opcodes to be implemented, such as push, pall, pint, pop, swap, add, nop, sub, div, mul, mod, comments, pchar, pstr, rotl, rotr, stack, queue, and Brainf*ck script. Provide a brief description of each opcode and its functionality.\n\nAdd a task to implement a Brainf*ck script that adds two digits given by the user. Explain the step-by-step process of the script, including reading the digits, adding them together, and printing the result.\n\nAdd a task to implement a Brainf*ck script that multiplies two digits given by the user. Explain the step-by-step process of the script, including reading the digits, multiplying them together, and printing the result.\n\nAdd a task to implement a Brainf*ck script that multiplies two digits given by the user and prints the result followed by a new line. Explain the step-by-step process of the script, including reading the digits, multiplying them together, and printing the result with a new line.","shortMessageHtmlLink":"chore(readme): Update README.md with project details and task list"}},{"before":"6a00e524d78bc63f0901060670144a2fc7166464","after":"6e2db3faa325666bcbdfe0c161c1d3017818603a","ref":"refs/heads/master","pushedAt":"2023-11-16T14:50:15.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"New update of bytecodes","shortMessageHtmlLink":"New update of bytecodes"}},{"before":"87ba31a814ce9129637f8547be1d5725c4f5d51e","after":"6a00e524d78bc63f0901060670144a2fc7166464","ref":"refs/heads/master","pushedAt":"2023-11-16T14:41:59.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":" feat(add): Implement efficient add opcode\n\nImplement the _add function in monty.h to efficiently handle the add opcode. The function takes a pointer to the stack and the line count as arguments. It first checks if the stack is empty or if the stack has less than two elements (top and next). If either condition is true, it prints an error message indicating that the stack is too short and sets the status variable to EXIT_FAILURE . If the stack has at least two elements, it calculates the sum of the values of the top two elements by adding ((*stack)->next->n) and ((*stack)->n) . It then calls the pop function to remove the top element from the stack. Finally, it updates the value of the new top element ((*stack)->n) with the calculated result.","shortMessageHtmlLink":" feat(add): Implement efficient add opcode"}},{"before":"fb794626bb67f8198c5290763ad2ac08b5a8b3cf","after":"87ba31a814ce9129637f8547be1d5725c4f5d51e","ref":"refs/heads/master","pushedAt":"2023-11-16T13:57:42.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"chore(commit): Add efficient is_digit and isnumber functions\n\nAdd the is_digit and isnumber functions to the monty.h file. The is_digit function checks if a string is a digit. It returns 1 if the string is a digit and 0 if it is not. The isnumber function checks if a string is a number. It returns 1 if the string is a number and 0 if it is not.","shortMessageHtmlLink":"chore(commit): Add efficient is_digit and isnumber functions"}},{"before":"36410396241d1b91d6dab10491cf805698a4e851","after":"fb794626bb67f8198c5290763ad2ac08b5a8b3cf","ref":"refs/heads/master","pushedAt":"2023-11-16T13:17:35.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"feat(rotr): Implement efficient rotr opcode\n\nImplement the _rotr function in monty.h to efficiently handle the rotr opcode. The function takes a double pointer to the stack and the line count as arguments. It first checks if the stack is empty or contains only one element. If either condition is true, it returns. If the stack has more than one element, it creates two stack pointers, bottom and prev , and initializes bottom to the stack pointer. It then traverses the stack to find the last node, which will become the new top element. It updates the next and prev pointers of the last node ( bottom ) and the previous node ( prev ) accordingly. It breaks the link between the previous top elements and the new top element by setting the next pointer of the previous top element to NULL . Finally, it updates the stack pointer to point to the new top element.","shortMessageHtmlLink":"feat(rotr): Implement efficient rotr opcode"}},{"before":"47e15f9024244fd017460738aa6e1a0c9b7c729b","after":"36410396241d1b91d6dab10491cf805698a4e851","ref":"refs/heads/master","pushedAt":"2023-11-16T11:32:24.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"feat(rotl): Implement efficient rotl opcode\n\nImplement the _rotl function in monty.h to efficiently handle the rotl opcode. The function takes a double pointer to the stack and the line count as parameters. It first checks if the stack is empty or contains only one element. If either condition is true, it returns. If the stack has more than one element, it creates two stack pointers, left and right , and initializes them to the stack pointer. It then traverses the stack to find the last node. After that, it creates a circular linked list by updating the next and prev pointers. Finally, it updates the stack pointer and breaks the circular link to complete the rotation.","shortMessageHtmlLink":"feat(rotl): Implement efficient rotl opcode"}},{"before":"1c4022fe293ae9ed0ea46c8348ecd894352d744a","after":"47e15f9024244fd017460738aa6e1a0c9b7c729b","ref":"refs/heads/master","pushedAt":"2023-11-16T10:29:21.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"feat(pchar): Implement efficient pchar opcode\n\nImplement the _pchar function in monty.h to efficiently handle the pchar opcode. The function takes a pointer to the stack and the line count as arguments. It first checks if the stack is empty or if the stack pointer is NULL. If either condition is true, it prints an error message indicating that the stack is empty and sets the status variable to EXIT_FAILURE . It then checks if the integer value at the top of the stack is within the range of ASCII values. If the value is not in the ASCII table, it prints an error message indicating that the value is out of range and sets the status variable to EXIT_FAILURE . If the value is within the ASCII range, it uses the printf function to print the character corresponding to the ASCII value, followed by a new line.","shortMessageHtmlLink":"feat(pchar): Implement efficient pchar opcode"}},{"before":"921bff8df332b6db7c1e6876a05f1f16bcf1ff7c","after":"1c4022fe293ae9ed0ea46c8348ecd894352d744a","ref":"refs/heads/master","pushedAt":"2023-11-16T08:39:35.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"feat(mod): Implement mod opcode for Monty interpreter\n\n- The commit implements the mod opcode for the Monty interpreter.\n- The mod function takes a pointer to the stack and the line count as arguments.\n- It checks if the stack is empty or has less than two elements, printing an error message and setting the status variable to EXIT_FAILURE if true.\n- It also checks if the top element of the stack is 0, printing an error message and setting the status variable to EXIT_FAILURE if true.\n- If the stack has at least two elements and the top element is not 0, it calculates the remainder of the division of the second top element and the top element using the % operator.\n- The top element is then removed from the stack using the pop function.\n- Finally, the value of the new top element is updated with the calculated result.","shortMessageHtmlLink":"feat(mod): Implement mod opcode for Monty interpreter"}},{"before":"828181b35884ab3faa75050b5b3cb020c27dc45c","after":"921bff8df332b6db7c1e6876a05f1f16bcf1ff7c","ref":"refs/heads/master","pushedAt":"2023-11-16T08:37:52.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"feat(mod): Implement mod opcode for Monty interpreter\n\n- The commit implements the mod opcode for the Monty interpreter.\n- The mod function takes a pointer to the stack and the line count as arguments.\n- It checks if the stack is empty or has less than two elements, printing an error message and setting the status variable to EXIT_FAILURE if true.\n- It also checks if the top element of the stack is 0, printing an error message and setting the status variable to EXIT_FAILURE if true.\n- If the stack has at least two elements and the top element is not 0, it calculates the remainder of the division of the second top element and the top element using the % operator.\n- The top element is then removed from the stack using the pop function.\n- Finally, the value of the new top element is updated with the calculated result.","shortMessageHtmlLink":"feat(mod): Implement mod opcode for Monty interpreter"}},{"before":"6234660425fa4955774603c3db5a5a266489e74e","after":"828181b35884ab3faa75050b5b3cb020c27dc45c","ref":"refs/heads/master","pushedAt":"2023-11-16T08:37:09.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"feat(mod): Implement mod opcode for Monty interpreter\n\n- The commit implements the mod opcode for the Monty interpreter.\n- The mod function takes a pointer to the stack and the line count as arguments.\n- It checks if the stack is empty or has less than two elements, printing an error message and setting the status variable to EXIT_FAILURE if true.\n- It also checks if the top element of the stack is 0, printing an error message and setting the status variable to EXIT_FAILURE if true.\n- If the stack has at least two elements and the top element is not 0, it calculates the remainder of the division of the second top element and the top element using the % operator.\n- The top element is then removed from the stack using the pop function.\n- Finally, the value of the new top element is updated with the calculated result.","shortMessageHtmlLink":"feat(mod): Implement mod opcode for Monty interpreter"}},{"before":"91231dd42f955d882fb0ead18981e5346d6094f9","after":"6234660425fa4955774603c3db5a5a266489e74e","ref":"refs/heads/master","pushedAt":"2023-11-16T08:16:02.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"feat(mul): Implement efficient mul opcode\n\nImplement the _mul function in monty.h to efficiently handle the mul opcode. The function takes a pointer to the stack and the line count as arguments. It first checks if the stack is empty or if the stack has less than two elements (top and next). If either condition is true, it prints an error message indicating that the stack is too short and sets the status variable to EXIT_FAILURE . If the stack has at least two elements, it calculates the product of the values of the second top element and the top element by multiplying ((*stack)->next->n) and ((*stack)->n) . It then calls the pop function to remove the top element from the stack. Finally, it updates the value of the new top element ((*stack)->n) with the calculated result.","shortMessageHtmlLink":"feat(mul): Implement efficient mul opcode"}},{"before":"bc582b34f8965b64be88dd4d8a299c6e602c9e68","after":"91231dd42f955d882fb0ead18981e5346d6094f9","ref":"refs/heads/master","pushedAt":"2023-11-16T08:01:35.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"feat(div): Implement efficient div opcode\n\nImplement the _div function in monty.h to efficiently handle the div opcode. The function takes a pointer to the stack and the line count as arguments. It first checks if the stack is empty or if the stack has two elements (top and next). If either condition is true, it prints an error message indicating that the stack is too short and sets the status variable to EXIT_FAILURE . It then checks if the top element of the stack is 0. If it is, it prints an error message indicating division by zero and sets the status variable to EXIT_FAILURE . If the stack has at least two elements and the top element is not zero, it calculates the division of the second top element by the top element by dividing ((*stack)->next->n) by ((*stack)->n) . It then calls the _pop function to remove the top element from the stack. Finally, it updates the value of the new top element ( (*stack)->n ) with the calculated result.","shortMessageHtmlLink":"feat(div): Implement efficient div opcode"}},{"before":"8b5651034097a8d618807d060b8516b646199a59","after":"bc582b34f8965b64be88dd4d8a299c6e602c9e68","ref":"refs/heads/master","pushedAt":"2023-11-16T06:54:46.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"feat(sub): Implement efficient sub opcode\n\nImplement the _sub function in monty.h to efficiently handle the sub opcode. The function takes a pointer to the stack and the line count as arguments. It first checks if the stack is empty or if the stack has less than two elements (top and next). If either condition is true, it prints an error message indicating that the stack is too short and sets the status variable to EXIT_FAILURE . If the stack has at least two elements, it calculates the difference between the values of the top and second top elements by subtracting ((*stack)->n) from ((*stack)->next->n) . It then calls the pop function to remove the top element from the stack. Finally, it updates the value of the new top element ((*stack)->n) with the calculated result.","shortMessageHtmlLink":"feat(sub): Implement efficient sub opcode"}},{"before":"62d2e97da90587d5b0fe02060d3c65547e229ffc","after":"8b5651034097a8d618807d060b8516b646199a59","ref":"refs/heads/master","pushedAt":"2023-11-16T06:54:11.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"feat(sub): Implement efficient sub opcode\n\nImplement the _sub function in monty.h to efficiently handle the sub opcode. The function takes a pointer to the stack and the line count as arguments. It first checks if the stack is empty or if the stack has less than two elements (top and next). If either condition is true, it prints an error message indicating that the stack is too short and sets the status variable to EXIT_FAILURE . If the stack has at least two elements, it calculates the difference between the values of the top and second top elements by subtracting ((*stack)->n) from ((*stack)->next->n) . It then calls the pop function to remove the top element from the stack. Finally, it updates the value of the new top element ((*stack)->n) with the calculated result.","shortMessageHtmlLink":"feat(sub): Implement efficient sub opcode"}},{"before":"334b9cbb0c23aaa76fedcaf178a5bdccc4d6392c","after":"62d2e97da90587d5b0fe02060d3c65547e229ffc","ref":"refs/heads/master","pushedAt":"2023-11-16T06:21:29.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"feat(nop): Implement efficient nop opcode\n\nImplement the _nop function in monty.h to efficiently handle the nop opcode. The function takes a pointer to the stack and the line count as arguments. It uses (void) to explicitly indicate that the _nop opcode doesn't require any specific action. Since the nop opcode doesn't do anything, the function body is empty.","shortMessageHtmlLink":"feat(nop): Implement efficient nop opcode"}},{"before":"6a23e1caf1ba7b37d5b5cf4e7abea08369fbe967","after":"334b9cbb0c23aaa76fedcaf178a5bdccc4d6392c","ref":"refs/heads/master","pushedAt":"2023-11-16T06:00:18.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"feat(add): Implement efficient add opcode\n\nImplement the _add function in monty.h to efficiently handle the add opcode. The function takes a pointer to the stack and the line count as arguments. It first checks if the stack is empty or if the stack has less than two elements (top and next). If either condition is true, it prints an error message indicating that the stack is too short and sets the status variable to EXIT_FAILURE . If the stack has at least two elements, it calculates the sum of the values of the top two elements by adding ((*stack)->next->n) and ((*stack)->n) . It then calls the pop function to remove the top element from the stack. Finally, it updates the value of the new top element ((*stack)->n) with the calculated result.","shortMessageHtmlLink":"feat(add): Implement efficient add opcode"}},{"before":"1243e0f48d763d118f01a06f7a4e0f06d28da376","after":"6a23e1caf1ba7b37d5b5cf4e7abea08369fbe967","ref":"refs/heads/master","pushedAt":"2023-11-16T05:20:50.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"feat(swap): Implement efficient swap opcode\n\nImplement the _swap function in monty.h to efficiently handle the swap opcode. The function takes a pointer to the stack and the line count as arguments. It first checks if the stack is empty or if the stack has less than two elements (top and next). If either condition is true, it prints an error message indicating that the stack is too short and sets the status variable to EXIT_FAILURE . If the stack has at least two elements, it creates a temporary pointer tmp and assigns the stack pointer to it. It creates a temporary variable tmp_n and assigns the value of the top element ( tmp->n ) to it. It swaps the values of the top element and the next element by assigning tmp->next->n to tmp->n and tmp_n to tmp->next->n .","shortMessageHtmlLink":"feat(swap): Implement efficient swap opcode"}},{"before":"9d8f524ce5f1730b9491872e4267fea45ea78583","after":"1243e0f48d763d118f01a06f7a4e0f06d28da376","ref":"refs/heads/master","pushedAt":"2023-11-16T05:19:16.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"feat(swap): Implement efficient swap opcode\n\nImplement the _swap function in monty.h to efficiently handle the swap opcode. The function takes a pointer to the stack and the line count as arguments. It first checks if the stack is empty or if the stack has less than two elements (top and next). If either condition is true, it prints an error message indicating that the stack is too short and sets the status variable to EXIT_FAILURE . If the stack has at least two elements, it creates a temporary pointer tmp and assigns the stack pointer to it. It creates a temporary variable tmp_n and assigns the value of the top element ( tmp->n ) to it. It swaps the values of the top element and the next element by assigning tmp->next->n to tmp->n and tmp_n to tmp->next->n .","shortMessageHtmlLink":"feat(swap): Implement efficient swap opcode"}},{"before":"77c9b76c968056d78dacad7e780b5598f8ffcd62","after":"9d8f524ce5f1730b9491872e4267fea45ea78583","ref":"refs/heads/master","pushedAt":"2023-11-16T00:13:31.000Z","pushType":"push","commitsCount":2,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"feat(pop): Implement efficient pop opcode\n\nImplement the _pop function in monty.h to efficiently handle the pop opcode. The function takes a pointer to the stack and the line count as arguments. It first checks if the stack is empty or if the stack pointer is NULL. If either condition is true, it prints an error message indicating that the stack is empty and sets the status variable to EXIT_FAILURE . If the stack is not empty, it creates a temporary pointer tmp and assigns the next node after the top of the stack to it. It frees the memory allocated for the top of the stack using the free function. It updates the stack pointer to point to the next node ( tmp ). If the stack is not empty after the pop operation, it updates the prev pointer of the new top node to NULL .","shortMessageHtmlLink":"feat(pop): Implement efficient pop opcode"}},{"before":"66d9314c9b50090b5dcb0907e8b9dcd17f43cb26","after":"77c9b76c968056d78dacad7e780b5598f8ffcd62","ref":"refs/heads/master","pushedAt":"2023-11-15T23:24:23.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"feat(main): Implement efficient main function\n\nImplement the main function in monty.h to efficiently handle the entry point of the program. The function takes the list of arguments passed to the program and the amount of arguments as arguments. It initializes variables, opens the file specified by the command-line argument, reads each line from the file, tokenizes the line, skips empty lines and comments, calls the opcode function to execute the instruction, and handles memory deallocation and file closing. The function also checks for errors such as incorrect number of arguments or failure to open the file and exits with the appropriate status.","shortMessageHtmlLink":"feat(main): Implement efficient main function"}},{"before":"07cb0319b2329d1ac1f54a0fd9892ecd0ede5603","after":"66d9314c9b50090b5dcb0907e8b9dcd17f43cb26","ref":"refs/heads/master","pushedAt":"2023-11-15T23:22:11.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"feat(stack): Implement efficient stack operations\n\nImplement the queue_node , add_node , print_stack , and free_stack functions in monty.h to efficiently handle stack operations.\n\nThe queue_node function adds a new node to the end of a stack_t stack in a queue manner. It takes a pointer to the stack and the number of the node as arguments. It allocates memory for a new node, sets its value, and adds it to the end of the stack. If memory allocation fails, it returns NULL.\n\nThe add_node function adds a new node to the start of a stack_t stack. It takes a pointer to the stack and the number for the new node as arguments. It allocates memory for a new node, sets its value, and adds it to the start of the stack. If memory allocation fails, it prints an error message and returns NULL.\n\nThe print_stack function prints the contents of a stack_t stack. It takes a pointer to the stack as an argument and iterates through the stack, printing each node's value. It returns the number of elements in the stack.\n\nThe free_stack function frees a dlistint_t linked list. It takes a pointer to the stack head as an argument and iterates through the stack, freeing each node's memory.","shortMessageHtmlLink":"feat(stack): Implement efficient stack operations"}},{"before":"fdb8b9b2ae056b453be3efc4931ff409d85f6f58","after":"07cb0319b2329d1ac1f54a0fd9892ecd0ede5603","ref":"refs/heads/master","pushedAt":"2023-11-15T23:20:42.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"feat(pall): Implement efficient pall function\n\nImplement the _pall function in monty.h to efficiently print the stack. The function takes a pointer to the stack and the line number as arguments. It calls the print_stack function to print all the values on the stack.","shortMessageHtmlLink":"feat(pall): Implement efficient pall function"}},{"before":"9604aefe7477775969bd03125a0f3001797b02c7","after":"fdb8b9b2ae056b453be3efc4931ff409d85f6f58","ref":"refs/heads/master","pushedAt":"2023-11-15T23:18:37.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"feat(opcode): Implement efficient opcode function\n\nImplement the _opcode function in monty.h to efficiently handle the execution of built-in instructions. The function takes a pointer to the stack, a string to compare, and the line count as arguments. It checks if the string matches known instructions and performs the corresponding action. If the string is stack, it sets the global.data_struct variable to 1. If the string is queue, it sets the global.data_struct variable to 0. If the string matches any other known instruction, it calls the corresponding function and passes the stack and line count as arguments. If no match is found, it prints an error message and sets the status variable to EXIT_FAILURE .","shortMessageHtmlLink":"feat(opcode): Implement efficient opcode function"}},{"before":"e6c32076af586c39143430782a058c5ab667bffa","after":"9604aefe7477775969bd03125a0f3001797b02c7","ref":"refs/heads/master","pushedAt":"2023-11-15T21:56:25.000Z","pushType":"push","commitsCount":2,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"feat(push): Implement efficient push function\n\nImplement the _push function in monty.h to efficiently push an element into the stack. The function takes a pointer to the stack and the line number as arguments. It initializes a variable n to store the argument passed to the push opcode. If the argument is not a valid integer, it prints an error message with the line number and sets the status to EXIT_FAILURE . Depending on the data structure type (stack or queue), the function calls either the _add_node or _queue_node function to add the element to the stack. If the function fails to add the node, it returns and sets the status to EXIT_FAILURE .","shortMessageHtmlLink":"feat(push): Implement efficient push function"}},{"before":"950f7645ecffa17ef655ce05cb0681b1a1a53bfa","after":"e6c32076af586c39143430782a058c5ab667bffa","ref":"refs/heads/master","pushedAt":"2023-11-15T16:43:06.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"feat(main): Implement main function for Monty interpreter\n\n- Added main function to handle command line arguments and file processing.\n- Implemented error handling for invalid command line arguments and file opening.\n- Implemented file reading and opcode processing line by line.\n\nfeat(file_reader): Implement file_reader function\n\n- Added file_reader function to process the entire Monty file.\n- Opened the file and read each line.\n- Extracted opcode from each line and passed it to get_po function for processing.\n\nrefactor(stack_init): Refactor stack_init function\n\n- Updated stack_init function to initialize the stack pointer.\n- Set the top of the stack to NULL.\n\nfeat(free_all): Implement free_all function\n\n- Added free_all function to free all dynamically allocated memory.\n- Traversed the stack and freed each node.\n\nThis commit implements the main function for the Monty interpreter, file_reader function to process the Monty file, and helper functions for stack initialization and memory freeing.","shortMessageHtmlLink":"feat(main): Implement main function for Monty interpreter"}},{"before":"7a5991e8c926c56dc45548e645519aee2c6cb95c","after":"950f7645ecffa17ef655ce05cb0681b1a1a53bfa","ref":"refs/heads/master","pushedAt":"2023-11-15T16:19:23.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"feat(PUSH): Implement push functionality\n\n- Add a function PUSH to push an element into the stack\n- Validate if the argument is a valid integer\n- If stack mode is enabled, add the integer to the stack\n- If stack mode is disabled, add the integer to the queue\n\nfix(PALL): Fix unused parameter warning\n\n- Remove the unused parameter line_cnt in the PALL function\n\nPlease review and merge these changes.","shortMessageHtmlLink":"feat(PUSH): Implement push functionality"}},{"before":"483d2c1205c1075721a9e44ba976a95fb1a05910","after":"7a5991e8c926c56dc45548e645519aee2c6cb95c","ref":"refs/heads/master","pushedAt":"2023-11-15T16:14:45.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"feat(PUSH): Implement push functionality\n\n- Add a function PUSH to push an element into the stack\n- Validate if the argument is a valid integer\n- If stack mode is enabled, add the integer to the stack\n- If stack mode is disabled, add the integer to the queue\n\nfix(PALL): Fix unused parameter warning\n\n- Remove the unused parameter line_cnt in the PALL function\n\nPlease review and merge these changes.","shortMessageHtmlLink":"feat(PUSH): Implement push functionality"}},{"before":"a0e4d72693a57a4cb6c3eb637c12bb1ae2324253","after":"483d2c1205c1075721a9e44ba976a95fb1a05910","ref":"refs/heads/master","pushedAt":"2023-11-15T15:23:28.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"paschalugwu","name":"Paschal Ugwu","path":"/paschalugwu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/106428248?s=80&v=4"},"commit":{"message":"feat(PUSH): Implement push functionality\n\n- Add a function PUSH to push an element into the stack\n- Validate if the argument is a valid integer\n- If stack mode is enabled, add the integer to the stack\n- If stack mode is disabled, add the integer to the queue\n\nfix(PALL): Fix unused parameter warning\n\n- Remove the unused parameter line_cnt in the PALL function\n\nPlease review and merge these changes.","shortMessageHtmlLink":"feat(PUSH): Implement push functionality"}}],"hasNextPage":true,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"cursor":"djE6ks8AAAAEetevKAA","startCursor":null,"endCursor":null}},"title":"Activity ยท paschalugwu/monty"}