项目作者: pbondoer

项目描述 :
sastantua @ 42 - pyramid generator
高级语言: C
项目地址: git://github.com/pbondoer/42-sastantua.git
创建时间: 2015-12-10T15:54:10Z
项目社区:https://github.com/pbondoer/42-sastantua

开源协议:

下载


sastantua @ 42

  1. Allosimanius Syneca is a planet noted for ice, snow, mind-hurtling beauty and
  2. stunning cold. The view from the top of the Ice Crystal Pyramids of Sastantua
  3. is widely known for its ability to release the observers mind to hitherto
  4. unexperienced horizons of beauty.

This is one of the numerous projects done during the 42 piscine in July 2015.
It was completed in a week and can display fancy pyramids in ASCII that follow
a simple set of rules. The objective was to recreate the output of a given
binary perfectly.

The unix utility diff was useful when
testing.

Compiling

The project currently only has the functions for generating the pyramid. To
compile, you will need a main. Assuming you have a working
libft:

  1. #include "libft.h"
  2. int main(int argc, char *argv[])
  3. {
  4. if (argc < 2)
  5. return 0;
  6. sastantua(ft_atoi(argv[1]));
  7. }

Alternatively, you can replace ft_atoi with the standard atoi
implementation (using stdlib.h instead).

Usage

Compiling this into a sastantua executable, you get:

  1. $ ./sastantua 3
  2. /*\
  3. /***\
  4. /*****\
  5. /***********\
  6. /*************\
  7. /***************\
  8. /*****************\
  9. /***********************\
  10. /*************************\
  11. /************|||************\
  12. /*************|||*************\
  13. /**************|||**************\