Code Monkey home page Code Monkey logo

cffc-std's Introduction

The standard library CaffeineC

This is the GitHub repository of the official standard library for the CaffeineC programming language.

Packages

I/O

import "vyPal/cffc-std/io";

Function printf(fmt: *i8): i32

The printf function that is builtin to clang

Function sprintf(str: *i8, fmt: *i8): i32

The sprintf function that is builtin to clang

Function print(format: *i8): void

Same as printf

Function println(format: *i8): void

Same as printf, but adds an additional newline character

Function input(prompt: *i8): *i8

Prints prompt and reads user input from command line until a newline character is received (or the 256 character limit is reached)

Random

import "vyPal/cffc-std/rand";

Function initRandom(): void

Uses the srand() function from clang to initialize the random number generator

Function randInt(min: i32, max: i32): i32

Generates a random 32-bit integer from min to max (both inclusive)

Strings

import "vyPal/cffc-std/strings";

Class String

string: *i8

Method constructor(s: *i8): void

Creates a new instance of the String class and sets the value of the string field to s

Method length(): i32

Returns the length of the string (not counting the null terminator)

Method parseI32(): i32

Uses the clang atoi() function to parse an i32 from the instance of the String class

Method parseF32(): f32

Uses the clang atof() function to parse an f32 from the instance of the String class

Operator ==

Defines the comparison function for equals operator when used on two instances of this class

Operator +

Defines the function for addition operator when used on two instances of this class

Getter *i8

Defines the function for when an instance of this class is requested as a *i8

Getter i32

Same as parseI32()

Getter f32

Same as parseF32()

cffc-std's People

Contributors

vypal avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.