Skip to content

A program that builds the Ice Crystal Pyramids of Sastantua in ascii characters for it's user.

Notifications You must be signed in to change notification settings

Crimson-Yeti/Sastantua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 

Repository files navigation

Sastantua


A program that builds the Ice Crystal Pyramids of Sastantua in ASCII characters for it's user.


Allosimanius Syneca is a cold, snowy, beautiful planet. It is so beautiful that if you stood on top of the
Ice Crystal Pyramids of Sastantua, it is possible that your brain will fall out due to unobserved beauty. 

sastantua

Compiling and Running the Program

Compilation

sastantua.c is a complete program, and can be run through any C compiler to create an executable program that can be ran in the user's terminal.

gcc -o sastantua sastantua.c

Running the Program

The executable can be given any number of pyramids to be built when called from the command line. Size must be greater than one, and the different sizes given must be delimited by a space.

Example

./sastantua 1 3 5

will output

Size 1
|  /*\
| /***\
|/**|**\

Size 3
|               /*\
|              /***\
|             /*****\
|          /***********\
|         /*************\
|        /***************\
|       /*****************\
|    /***********************\
|   /*************************\
|  /************|||************\
| /*************|||*************\
|/**************|||**************\

Size 5
|                                  /*\
|                                 /***\
|                                /*****\
|                             /***********\
|                            /*************\
|                           /***************\
|                          /*****************\
|                       /***********************\
|                      /*************************\
|                     /***************************\
|                    /*****************************\
|                   /*******************************\
|               /***************************************\
|              /*****************************************\
|             /*******************************************\
|            /*********************************************\
|           /***********************************************\
|          /*************************************************\
|      /*********************************************************\
|     /***********************************************************\
|    /****************************|||||****************************\
|   /*****************************|||||*****************************\
|  /******************************|||$|******************************\
| /*******************************|||||*******************************\
|/********************************|||||********************************\

If an invalid size is given an error will be printed in place of a pyramid

Example

./sastantua 1 a 2

will output

Size 1
|  /*\
| /***\
|/**|**\


***Argument "a" Invalid***


Size 2
|        /*\
|       /***\
|      /*****\
|   /***********\
|  /*************\
| /***************\
|/********|********\

Size Input

Intuitively, the larger the size we give the program, the larger the pyramid generated. Our size input directly controls the amount of tiers in our pyramid, and the size of the door. As with any sturdy structure, our tiers increase in size as they near the bottom of the pyramid, and stylistically the size of our door increases with the size of the pyramid.

Tier Growth

sastantuatiers

As can be seen in the chart above, there's a predictable progression to the size of our pyramid's tiers.

Row Count Incrementation
  • The top tier starts at 3 rows, and every tier after the first will always have one more row than the one above it.
    • The equation for this rule is as follows

      Number of Rows = Tier + 2

Character Count Incrementation
  • The top tier starts at 3 characters.
  • Any row within the same tier as the row above it will always contain 2 more characters that the row above it.
  • The first row for all tiers below the first contain (current tier number + 3) more characters than the row above it if the current tier number is odd, or (current tier number + 4) more characters than the row above it if the current tier number is even.
    • The equation for this rule is as follows

      i % 2 == 0 ? i + 4 : i + 3

Building the Door

When building a pyramid, the size of the door stylistically needs to scale with the size of the overall structure. Our door is created using a simple set of rules.

Height and Width
  • The height and width will always be match.
  • The height and width are equal to (size of pyramid) if the size of the pyramid is odd, or (size of pyramid - 1) if the size of the pyramid is even.
    • The equation for this rule is as follows

      size = (size % 2 == 0 ? size - 1 : size)

Door Knob
  • A door knob will only be shown if the size of the door is greater than 3.
  • The door knob is represented by a single dollar sign "$".
  • The door knob is centered vertically between the top and bottom of the door, and one plank "|" from the right edge of the door.

About

A program that builds the Ice Crystal Pyramids of Sastantua in ascii characters for it's user.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages