Skip to content

Commit

Permalink
Add army ranks and basic Čépépé support (#25)
Browse files Browse the repository at this point in the history
Add basic Č++ support
  • Loading branch information
Toaster192 authored Nov 3, 2024
1 parent 1137162 commit 4beffbb
Show file tree
Hide file tree
Showing 3 changed files with 135 additions and 16 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Č
# Č (Čéčko) / Č++ (Čépépé)

The czech library for C. Why? Because we could, of course!
The czech library for C (and C++). Why? Because we could, of course!

Please contribute your other ~~horrible~~ awesome and creative translations
so that we can write a fully czech code to suit all our needs.
Expand Down
137 changes: 123 additions & 14 deletions czech.h
Original file line number Diff line number Diff line change
@@ -1,30 +1,50 @@
/*
▀█▄▄█▀
▄▄▄▄
██▀▀▀▀█
██▀
██
██▄
██▄▄▄▄█
▀▀▀▀
*/
// typy
#define SOUBOR FILE
#define plav float
#define plov float
#define plovoucí float
#define vznášej float
#define dvojnásobný double
#define dvojnásobná double
#define dvojnásobné double
#define dvojitý double
#define dvojitá double
#define dvojité double
#define číslo int
#define cel int // INTeger -> CELé číslo
#define znak char
#define dlouhé long
#define dlouhý long
#define krátké short
#define dlouhá long
#define dlouhé long
#define krátký short
#define znaménkové signed
#define krátká short
#define krátké short
#define znaménkový signed
#define znaménková signed
#define znaménkové signed
#define bezznaménkový unsigned
#define bezznaménková unsigned
#define bezznaménkové unsigned
#define neznaménkové unsigned
#define neznaménkový unsigned
#define neznaménková unsigned
#define neznaménkové unsigned
#define prázdno void
#define prázdný void
#define prázdná void
#define prázdné void
#define nijaký void
#define nijaké void
#define nijaká void
#define nijaké void
#define prázdnota void
#define pravdivost bool

Expand All @@ -38,6 +58,14 @@
#define nčíslo16_t uint16_t
#define nčíslo32_t uint32_t
#define nčíslo64_t uint64_t
#define cel8_t int8_t
#define cel16_t int16_t
#define cel32_t int32_t
#define cel64_t int64_t
#define ncel8_t uint8_t
#define ncel16_t uint16_t
#define ncel32_t uint32_t
#define ncel64_t uint64_t

// logické konstrukce
#define když if
Expand All @@ -49,32 +77,45 @@
#define zatímco while
#define pro for
#define dělej do
#define udělej do
#define proveď do
#define přepínač switch
#define případ case
#define výchozí default
#define rozbij break
#define rozbít break
#define přeruš break
#define přerušit break
#define pokračuj continue

// ostatní klíčová slova
#define vrať return
#define navrať return
#define stálé static
#define stálý static
#define stálá static
#define neměnné const
#define stálé static
#define konst const
#define konstantní const
#define neměnný const
#define neměnná const
#define neměnné const
#define jdido goto
#define velikost(x) sizeof(x)

#define hlavní main

// operátory
#define je ==
#define rovný ==
#define rovná ==
#define rovné ==
#define rovno ==
#define rovnáse ==
#define není !=
#define nerovný !=
#define nerovná !=
#define nerovné !=
#define nerovno !=
#define nerovnáse !=

// experimentální triky
Expand All @@ -83,6 +124,14 @@
#define konec }
#define skonči }

#define major *
#define podplukovník **
#define plukovník ***
#define brigádní_generál *
#define generálmajor **
#define generálporučík ***
#define armádní_generál ****

// režimy otevření souboru
#define ČTENÍ "r"
#define ZÁPIS "w"
Expand All @@ -92,10 +141,20 @@
#define DVOJKOVÝ_PŘÍPIS "wa"

// standardní I/O streamy
#define standovnitř stdin
#define stanvstup stdin
#define stando stdin
#define stanvýstup stdout
#define stanven stdout
#define stanchyb stderr

#define stídovnitř stdin
#define stívstup stdin
#define stído stdin
#define stívýstup stdout
#define stíven stdout
#define stíchyb stderr

// konstanty
#define pravda 1
#define vcajku 1
Expand All @@ -106,7 +165,9 @@
#define KS -1 //Konec Souboru
#define NULA NULL

// <stdio.h>
// Knihovny

// <stdio.h> - <spnvv.h>
#define smaž(x) remove(x)
#define přejmenuj(x, y) rename(x, y)
#define dočsoubor() tmpfile()
Expand All @@ -122,7 +183,7 @@
#define tisknif(...) printf(__VA_ARGS__)
#define čtif(...) scanf(__VA_ARGS__)

// <stdlib.h>
// <stdlib.h> - <spnkni.h>
#define ppřiděl(x) malloc(x) // paměť přiděl
#define čpřiděl(x, y) calloc(x, y) // čistou paměť přiděl
#define osvoboď(x) free(x)
Expand Down Expand Up @@ -183,7 +244,8 @@
#define schyba(x) ferror(x)
#define tchybu(x) perror(x)

// <string.h>

// <string.h> - <retezec.h>
#define pamzkop(...) memccpy(__VA_ARGS__)
#define pamzna(...) memchr(__VA_ARGS__)
#define pampor(...) memcmp(__VA_ARGS__)
Expand Down Expand Up @@ -229,7 +291,7 @@
#define řeťzměň(...) strxfrm(__VA_ARGS__)
#define řeťzměň_l(...) strcfrm_l(__VA_ARGS__)

// <float.h>
// <float.h> - <plav.h>
#define PLV_SOUSTAVA FLT_RADIX
#define PLV_UDRŽ_ČÍS FLT_MANT_DIG
#define DVJ_UDRŽ_ČÍS DBL_MANT_DIG
Expand Down Expand Up @@ -260,7 +322,8 @@
#define DVJ_MIN DBL_MIN
#define DDVJ_MIN LDBL_MIN

// <math.h>

// <math.h> - <matika.h>
#define plovoucí_t float_t
#define dvojitý_t double_t
#define dvojité_t double_t
Expand Down Expand Up @@ -332,8 +395,9 @@
#define cosd(x) cosl(x)
#define chf(x) erf(x)
#define chfp(x) erff(x)
#define chfd(x) erfl(x)
#define chfd(x) erfc(x)
// TODO: We can not map multiple tokens to the same one so this needs to be redefined
// #define chfd(x) erfl(x)
// #define chfd(x) erfc(x)
#define chfdp(x) erfcf(x)
#define chfdd(x) erfcl(x)
#define moc(x) exp(x)
Expand Down Expand Up @@ -369,3 +433,48 @@
#define pzby(x, y) fmod(x, y)
#define pzbyp(x, y) fmodf(x, y)
#define pzbyd(x, y) fmodl(x, y)

/*
▀█▄▄█▀
▄▄▄▄
██▀▀▀▀█
██▀ ██ ██
██ ▄▄▄██▄▄▄ ▄▄▄██▄▄▄
██▄ ▀▀▀██▀▀▀ ▀▀▀██▀▀▀
██▄▄▄▄█ ██ ██
▀▀▀▀
*/
// c -> character -> znak -> z
#define zven cout
#define zvýstup cout
#define zdovnitř cin
#define zvstup cin
#define zdo cin
#define zerr cerr
#define zchyb cerr

#define cven cout
#define cvýstup cout
#define cdovnitř cin
#define cvstup cin
#define cdo cin
#define cchyb cerr

#define používá using
#define jménovesmír namespace
#define jmennýprostor namespace
// std -> sexually transmitted disease -> Sexuálně přenosná nemoc -> spn
#define spn std
// STandarD -> STandardnÍ
#define stí std

#define vektor vector
#define zatlač_zpátky push_back
#define zatlač_zpět push_back
#define zatlač_dozadu push_back
#define strč_zpátky push_back
#define strč_zpět push_back
#define strč_dozadu push_back

#define mapa map
#define pár pair
10 changes: 10 additions & 0 deletions examples/cpp_example.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <vector>
#include "czech.h"

používá jménovesmír spn;

číslo hlavní(prázdno){
vektor<číslo> poop;
poop.zatlač_zpátky(32);
vrať 0;
}

0 comments on commit 4beffbb

Please sign in to comment.