Skip to content

This repo contains the ALX project on stacks and ques. It involves the creation of a monty bytecode interpreter.

Notifications You must be signed in to change notification settings

Gus-Victrix/monty

Repository files navigation

0x19. C - Stacks, Queues - LIFO, FIFO

img

0. push, pall

push : pushes an element to the stack.

pall : prints all the values on the stack, starting from the top of the stack.

1. pint

pint : prints the value at the top of the stack, followed by a new line.

2. pop

pop : removes the top element of the stack.

3. swap

swap : swaps the top two elements of the stack.

4. add

add : adds the top two elements of the stack.

5. nop

nop : doesn’t do anything.

6. sub

sub : subtracts the top element of the stack from the second top element of the stack.

7. div

div : divides the second top element of the stack by the top element of the stack.

8. mul

mul : multiplies the second top element of the stack with the top element of the stack.

9. mod

mod : computes the rest of the division of the second top element of the stack by the top element of the stack.

10. comments

When the first non-space character of a line is #, treat this line as a comment (don’t do anything).

11. pchar

pchar : prints the char at the top of the stack, followed by a new line.

12. pstr

pstr : prints the string starting at the top of the stack, followed by a new line.

13. rotl

rotl : rotates the stack to the top.

14. rotr

rotr : rotates the stack to the bottom.

15. stack, queue

stack : sets the format of the data to a stack (LIFO).

queue : sets the format of the data to a queue (FIFO).

16. Brainf*ck

Brainf*ck script that prints School, followed by a new line.

17. Add two digits

Add two digits given by the user.

18. Multiplication

Multiply two digits given by the user.

19. Multiplication level up

Multiply two digits given by the user.






Made with by [@Gus-Victrix](https://github.com/Gus-Victrix)

About

This repo contains the ALX project on stacks and ques. It involves the creation of a monty bytecode interpreter.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published