Skip to content

Implement a stack and queue in C to know how these data structures works.

Notifications You must be signed in to change notification settings

AngelPedroza/monty

Repository files navigation

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

What is this?

A project for Holberton School, this is an interpreter for Monty bytecodes files. Monty is a scripting language that is first compiled into Monty byte codes. It relies on a unique stack data structure with specific instructions to manipulate it. Monty byte codes usually have the .m extension.

Description

What you should learn from this project:

  • What do LIFO and FIFO mean
  • What is a stack, and when to use it
  • What is a queue, and when to use it
  • What are the common implementations of stacks and queues
  • What are the most common use cases of stacks and queues
  • What is the proper way to use global variables

Compilation

The files are to be compiled this way:

$ gcc -Wall -Werror -Wextra -pedantic *.c -o monty

How to use

  1. compile files
  2. $ ./monty monty_byte_code_file_name.m

Example of usage

$ cat bytecodes/12.m
push 1
push 2
push 3
pall
add
pall
$ ./monty bytecodes/12.m
3
2
1
5
1

  • Implement the push and pall opcodes.
  • Implement the pint opcode.
  • Implement the pop opcode.
  • Implement the swap opcode.

Author

About

Implement a stack and queue in C to know how these data structures works.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published