This tutorial is not for beginners at programming because it is very difficult to understand.
There are many ways to install FreakC, you can:
-
Clone FreakC from Github using:
-
Install here.
In the "FreakC" folder, open cmd and type this command to compile and run the code:
freakc file_name
Example:
freakc "Examples/HelloWorld.fclang"
If you want to compile the code only, type:
freakc file_name --compile
If you want to compile the code and show the compiled code, type:
freakc file_name --candr
To show the current version of the devkit, type:
freakc --version
To create a new FreakC project quickly, you can type:
freakc project_name --create
Notice that it will generate a file with a Hello World example in it, if you just want to create an empty file, type:
freakc project_name --create --empty
To show all options and usage, type:
freakc --help
To show all options and usage (with a dumb ascii art), type:
freakc
To open interactive shell, type:
freakc --shell
::Or fcshell
You can type in whatever you want, it will be stored in "tar.fclang". You can type in any of these commands to execute tasks:
To print out a string or text, you use:
Swear[fnc] string
or you can prints text using:
SwearLine[fnc] string
The differences between Swear[fnc] and SwearLine[fnc] is that Swear[fnc] prints out normal text, if there are no text printed out, there might be some errors. But SwearLine[fnc] prints out a space then a text, if nothing is printed out, it will add a new line.
You can actually store data to a file by using:
Swear[fnc] data>>file
Unlike any characters, "!" requires "^", for example:
::This would causes no errors
Swear[fnc] @#/
::This would cause error ("!" will not be shown)
Swear[fnc] !
::Correct codes:
Swear[fnc] ^!
The reason for this is that FreakC has: SETLOCAL ENABLEDELAYEDEXPANSION which causes "!" to not be used properly.
If you're asking yourself, what are the reasons for the holy existence of "[fnc]". Well, it's completely useless, but I added it just to make coders waste some time :)
To start using Unicode character, type:
FuckUnicode[fnc] >nul
So now you can use Unicode characters:
FuckUnicode[fnc] >nul
Swear[fnc] ă ê ©
:: Would print out "ă ê ©"
If you type:
Swear[fnc] Swear[fnc]
It won't print out "Swear[fnc]", but it will print out "echo", because FreakC will compiles any statement/command without caring if it's a used data or not. So to actually print out "Swear[fnc]", you will need to add "^" in any place of the command. Example:
Swear[fnc] S^wear[fnc]
:: This will print out "Swear[fnc]"
To pause in FreakC, please type in:
GotoToilet[fnc]
You will see this command underneath, but you should you this command to pause your program.
There are three data types in FreakC: integer, string.
To declare a variable, you use:
PoopString[fnc] variable_name=string_value
Or:
PoopString[fnc] "variable_name=string_value"
To do math equations, you use:
PoopInt[fnc] variable_name=equation
Note that PoopInt[fnc] will always round up number, to do equation or to declare a variable as a float, do:
:: Import float
Fuck[fnc] float
PoopFloat[fnc] "variable_name" "equation"
To declare a variable as an array, you use:
data_type arr[array_index]=
Ex:
PoopString[fnc] arr[0]=Hello
PoopInt[fnc] arr[1]=100
Note: There is no real Array in FreakC, the reason for naming arr[index] is to run for loops easier for all those "fake elements of a fake Array".
To declare a variable from user's input, you use:
PoopInput[fnc] variable_name=
Note: If you do this, it will prints out "Enter name:" right next to the input
PoopInput[fnc] variable_name=Enter name:
You can do Math equations with FreakC like this:
PoopInt[fnc] result=1+1+2+4
If you do this, variable "result" will be "Hel + lo"
PoopString[fnc] result=Hel + lo
Math operators
SquareMyBois[fnc] variable_without_%%
CubeMyBois[fnc] variable_without_%%
FuckUp[fnc] equation
FuckUpLess[fnc] equation
To merge strings, do this:
PoopString[fnc] str1=Hello
PoopString[fnc] str2=World
PoopString[fnc] str=%str1% %str2%
So the value of %str% is "Hello World"
Don't merge string like this:
PoopString[fnc] str1=Hello
PoopString[fnc] str2=World
PoopString[fnc] str=%str1% + %str2%
This time, the value will be "Hello + World"
You can use variables in FreakC commands as %variable_name%
For example, to print out a variable, you can do this:
PoopString[fnc] result=Hello World^!
Swear[fnc] %result%
But, to print out an element of an array, you use:
PoopString[fnc] a[0]=Hello
Swear[fnc] %a[0]%
To print out every element of an array, you can write something like this:
OpenHouse[fnc] ENABLEDELAYEDEXPANSION
PoopInt[fnc] a[0]=100
PoopInt[fnc] a[1]=35
PoopInt[fnc] a[2]=20
LoopStuffs[fnc] %%n in (0,1,2) do (
Swear[fnc] ^!a[%%n]^!
)
Actually, there is a whole another way to create an array:
PoopString[fnc] arr=1 2 3 4 5
ScanLetters[fnc] %%i in (%arr%) do (
::Print out every elements
Swear[fnc] %%i
)
You can declare a global variable by just using all the ways mentioned recently.
To declare a variable locally, you will need to use:
OpenHouse[fnc]
PoopInt[fnc] ans=100
CloseHouse[fnc]
OpenHouse[fnc] and CloseHouse[fnc] helps create a local environment.
In Batch, to use variable in for loops, or enables command prosessor's extensions, you would need:
setlocal ENABLEDELAYEDEXPANSION
setlocal ENABLEEXTENSIONS
You can also do that with OpenHouse[fnc]
OpenHouse[fnc] ENABLEDELAYEDEXPANSION
OpenHouse[fnc] ENABLEEXTENSIONS
Note: DELAYEDEXPANSION is already enabled in FreakC. So you wouldn't need to enable it actually.
There are a lot of special variables left, but you might not find uses for them
And if you're asking yourself why add more dumb commands like this, well, because FreakC's bs.
In Batch, you can do this to print out Hello:
set stuff=echo Hello
%stuff%
In FreakC, if you do this, you would get errors
PoopString[fnc] stuff=Swear[fnc] Hello
%stuff%
You should type:
PoopString[fnc] stuff= Swear[fnc] Hello
%stuff%
There are variables that you CAN NOT USE like: %a%, %printString%, %fccompile%, %fccompilename%, %fcread%.
Also, spaces in FreakC is extremely important, so if you declare a variable like this:
PoopInt[fnc] abc = 100
It will declare the "abc " variable, so if you prints it out like this, it will not work
Swear[fnc] %abc%
You will have to code like this:
Swear[fnc] %abc %
Then, it will prints out " 100"
Other thing that you should notice is that
PoopString[fnc] text
would return any variable begins with "text"
Single-line comment:
:: Comment
Another way:
rem comment
Multi-line comment:
[cmt] comment
[ecmt]
To write a comment that won't show up in the compiled codes, use:
[hcmt] comment
Labels helps you to jump to a state or pass parameters to execute tasks (somewhat procedural programming).
To create a label/procedure, you use:
PoopFnc[fnc] label_name
To jump to a label, you use:
EatFnc[fnc] label_name
To call a label/procedure, you use:
GrabFnc[fnc] :label_name
Or:
LickFnc[fnc] label_name
GrabFnc[fnc] can also targets file, while LickFnc[fnc] can only targets label/function. For example, you can execute files like this:
GrabFnc[fnc] file_name
EatFnc[fnc] jumps to a function and will not execute the previous code while GrabFnc[fnc] use code from the function but still execute the previous code.
Also, GrabFnc[fnc] also supports parameters, which helps you a lot of time.
For examples, this code will print the sum of two parameters:
GrabFnc[fnc] :plus 1 2
PoopFnc[fnc] plus
PoopInt[fnc] ans=%~1 + %~2
Swear[fnc] %ans%
Note: Parameters in FreakC are %~1, %~2,...
To restart the program, you can type:
EatFnc[fnc] FreakCCompiled
It is because the compiled code of FreakC is in a main label/procedure "FreakCCompiled"
This code would still work eventhough it contains special character
PoopFnc[fnc] dsasd$ 123213 323
EatFnc[fnc] dsasd$ 123213 323
There is no such thing as "OOP on FreakC", but you can fake one, like this:
::Call the function "Car" with parameters to declares elements
GrabFnc[fnc] :Car "supercar" "20" "special"
::Would print out the element "gas" of "supercar"
Swear[fnc] %supercar.gas%
::Would create a function called "Car", then pass all the parameters to the new variables.
PoopFnc[fnc] Car
DoIfFalse[fnc] "%~1" == "" DoIfFalse[fnc] "%~2" == "" DoIfFalse[fnc] "%~3" == "" (
PoopString[fnc] %~1.gas=%~2
PoopString[fnc] %~1.model=%~3
)
Die[fnc] /b 0
To use if statement, type:
DoIf[fnc] condition command_to_execute
Example:
PoopInt[fnc] abc=100
DoIf[fnc] %abc% == 100 (
Swear[fnc] abc is equal to 100
)
You can actually use a Batch command in DoIf[fnc]. Example:
PoopInt[fnc] abc=20
DoIf[fnc] %abc% == 20 (
echo abc is equal to 100
)
DoIfExist[fnc] file_name (
command_to_execute
)
DoIfDefined[fnc] variable_name (
command_to_execute
)
DoIfFalse[fnc] condtition (
command_to_execute
)
DoIf[fnc] condition (
command_to_execute
) OrNot[fnc] (
command_to_execute
)
To use if not for DoIfDefined[fnc] or DoIfExist[fnc], you can do this:
DoIfNotExist[fnc] file (
command_to_execute
)
DoIfNotDefined[fnc] file (
command_to_execute
)
To receive keys pressed, add:
TapSomeSht[fnc] key
For examples, if you want the users to press one in "wsad", type:
TapSomeSht[fnc] wsad
To perform any actions, you will need to use a special if statement:
DoIfTap[fnc] position_of_key_in_TapSomeSht[fnc]
Example:
TapSomeSht[fnc] wsad
DoIfTap[fnc] 4 (
Swear[fnc] You pressed "D"
)
DoIfTap[fnc] 3 (
Swear[fnc] You pressed "A"
)
DoIfTap[fnc] 2 (
Swear[fnc] You pressed "S"
)
DoIfTap[fnc] 1 (
Swear[fnc] You pressed "W"
)
You can use:
DoIfNotTap[fnc]
to use if not.
You can type this to check if the condition is true or false instantly:
TryMeBtch[fnc] condition
Then, it will prints out "Yes" if true, "No" if false.
For example, this will prints out "Yes"
TryMeBtch[fnc] "hello" == "hello"
You can also do this:
TryMeHoe[fnc] condition
It will assign 'Yes' or 'No' to %tmhres%.
LoopStuffs[fnc] %%parameters in (start,step,end) do (
)
ScanOrgans[fnc] drive/directory %%parameters in (file) do (
)
ScanLetters[fnc] drive/directory %%parameters in (string/file) do (
)
ScanDiaries[fnc] %%parameters in (set) do (
)
ScanDir[fnc] %%parameters in (folder) do (
)
While loops can be created using:
WhileSuck[fnc] condition
::code
EndSuck[fnc]
Of course, the loops will run when the condition is still true, stop when false.
RepeatSuck[fnc]
::code
UntilStale[fnc] condition
While loop is executed only when given condition is true. Whereas, do-while loop is executed for first time irrespective of the condition. After executing while loop for first time, then condition is checked.
YOU CAN NOT USE NESTED WHILE LOOPS
This will be wrong:
WhileSuck[fnc] condition
WhileSuck[fnc] condition
EndSuck[fnc]
EndSuck[fnc]
(Same with Do-While)
You can use somewhat "recursion" like this:
PoopInt[fnc] i=start_number
PoopFnc[fnc] loop
command
DoIf[fnc] %i% == end_number EatFnc[fnc] nextcode
PoopInt[fnc] i++
EatFnc[fnc] loop
PoopFnc[fnc] nextcode
command
For example, this program will print all the number from 0 to 10 then print out "Done!":
PoopInt[fnc] i=0
PoopFnc[fnc] loop
Swear[fnc] %i%
DoIf[fnc] %i% == 10 EatFnc[fnc] nextcode
PoopInt[fnc] i++
EatFnc[fnc] loop
PoopFnc[fnc] nextcode
Swear[fnc] Done^!
To import a pre-built library, use:
Fuck[fnc] lib_name
All libraries:
Fuck[fnc] arrayfunc
:: Find sum of list
CountBitches[fnc] "variable_name" "list"
:: Find maximum of list
Bitchiest[fnc] "variable_name" "list"
:: Find minimum of list
Horniest[fnc] "variable_name" "list"
:: Example:
Bitchiest[fnc] "max_num" "2 3 1 8 5"
:: This will prints out "8"
Swear[fnc] %max_num%
All the functions above only works with list with all integers. String or floats will cause errors.
Unlike all the previous release, now FreakC support writing Batch without any other commands. So you can actually learn Batch and write Batch codes in FreakC.
Well, I would say it will and won't at the same time. What I mean is that if there is Batch in FreakC, you would definitely write Batch rather than FreakC, but actually, FreakC codes are just compiled to Batch anyway. The only key feature of FreakC is being an esolang with funny and dirty syntax, that's why people would want to use it. FreakC doesn't improve Batch, it's just a funny version of it.
It's just like nul in Batch, so if you want to make your console not print out any process, you can do it like this:
Command >nul
To hide errors, you can do this:
Command >nul 2>nul
You can create a module file using:
Cancer[fnc]
Note: The "Cancer[fnc]" command needs to stay at the top of the file.
Then, include it in the main file using:
InsertShits[fnc] module_name.bat
::Note: You have to replace .fclang with .bat
Then, compile the module file first, then compile the main file at the end.
Create a file called "module.fclang" with:
Cancer[fnc]
Swear[fnc] World
Create a file called "program.fclang" with:
Swear[fnc] Hello
InsertShits[fnc] module.bat
In the command window, type:
freakc module --compile
freakc program
It will prints out:
Hello
World
If you are a C++ dev, this would be an equivalent to "#include".
If you don't want to merge all the codes into one file (as FreakC uses a lot of labels), you can simply:
- Create a module file with Cancer[fnc] on top of all the codes and add Die[fnc] /b in the bottom.
- Create a main file, but rather than using InsertShits[fnc], you can use normal GrabFnc[fnc] to access a file as a procedure.
- Compile the module file first, then compile and run the main file.
A demo can be found here.
FindShits[fnc]:
FindShits[fnc] [/V] [/C] [/N] [/I] [/OFF[LINE]] "string" [[drive:][path]filename[ ...]]
/V Displays all lines NOT containing the specified string.
/C Displays only the count of lines containing the string.
/N Displays line numbers with the displayed lines.
/I Ignores the case of characters when searching for the string.
/OFF[LINE] Do not skip files with offline attribute set.
"string" Specifies the text string to find.
[drive:][path]filename Specifies a file or files to search.
If a path is not specified, FIND searches the text typed at the prompt or piped from another command.
If a path is not specified, FIND searches the text typed at the prompt or piped from another command.
FindTrash[fnc]:
FindTrash[fnc] [/B] [/E] [/L] [/R] [/S] [/I] [/X] [/V] [/N] [/M] [/O] [/P] [/F:file]
[/C:string] [/G:file] [/D:dir list] [/A:color attributes] [/OFF[LINE]]
strings [[drive:][path]filename[ ...]]
/B Matches pattern if at the beginning of a line.
/E Matches pattern if at the end of a line.
/L Uses search strings literally.
/R Uses search strings as regular expressions.
/S Searches for matching files in the current directory and all subdirectories.
/I Specifies that the search is not to be case-sensitive.
/X Prints lines that match exactly.
/V Prints only lines that do not contain a match.
/N Prints the line number before each line that matches.
/M Prints only the filename if a file contains a match.
/O Prints character offset before each matching line.
/P Skip files with non-printable characters.
/OFF[LINE] Do not skip files with offline attribute set.
/A:attr Specifies color attribute with two hex digits. See "color /?"
/F:file Reads file list from the specified file(/ stands for console).
/C:string Uses specified string as a literal search string.
/G:file Gets search strings from the specified file(/ stands for console).
/D:dir Search a semicolon delimited list of directories
strings Text to be searched for.
[drive:][path]filename Specifies a file or files to search.
Use spaces to separate multiple search strings unless the argument is prefixed with /C.
For example, 'FINDSTR "hello there" x.y' searches for "hello" or "there" in file x.y.
'FINDSTR /C:"hello there" x.y' searches for "hello there" in file x.y.
Regular expression quick reference:
. Wildcard: any character
* Repeat: zero or more occurrences of previous character or class
^ Line position: beginning of line
$ Line position: end of line
[class] Character class: any one character in set
[^class] Inverse class: any one character not in set
[x-y] Range: any characters within the specified range
\x Escape: literal use of metacharacter x
\<xyz Word position: beginning of word
xyz\> Word position: end of word
(Copied from the documentation of Batch)
Die[fnc]
ShutdownSystem[fnc]
::Add /t time and /c "comment" to set the time to shutdown and leave a comment before shutdown
RestartSystem[fnc]
::Add /t time and /c "comment" to set the time to shutdown and leave a comment before restart
PukeDir[fnc] folder_name
EatDir[fnc] folder_name
EatDrive[fnc] drive_name
StealDiary[fnc] file_name
Forget[fnc]
GotoToilet[fnc]
Trash[fnc]
TrashDir[fnc] folder_name
OddOrEven[fnc] number
ChangeColor[fnc] hex_code
ChangeName[fnc] title_name
ChangeSize[fnc] size_number
ChangeSize[fnc] con cols=columns_or_width lines=lines_or_height
RenameFile[fnc] file_name
MoveFile[fnc] file_name new_path
CopyFile[fnc] file_name new_path
PlayFile[fnc] file
WaitForBus[fnc] time_as_second
Loop[fnc]
SeeDate[fnc]
SeeTime[fnc]
MyMemory[fnc]
EnableCoolStuff[fnc]
This would be useful for debugging.
DisableCoolStuff[fnc]
Note: All the command prompt content is hiden by default
BuyCalender[fnc]
Note: Administrator is required to run the command
BuyClock[fnc]
DumbCousin[fnc]
Note: Administrator is required to run the command
You can disable numpoop, numpiss, numpuke,... by putting this block of code on top of your program:
Cancer[fnc]
EnableCoolStuff[fnc]
You can prints out a quote of patrick from the huge collection of... 3 quotes that FreakC comes with :))
::Is mayonnaise an instrument ?
Patrick[meme] 1
::Roses are blue, violets are red, I have to go to the bathroom.
Patrick[meme] 2
::I can't see my forehead.
Patrick[meme] 3
::The inner machinations of my mind are an enigma.
Patrick[meme] 4
::Once upon a time there was an ugly barnacle. He was so ugly that everyone died. The end!
Patrick[meme] 5
::I wumbo, you wumbo, he she we wumbo.
Patrick[meme] 6
::Two words, SpongeBob. Na. Chos.
Patrick[meme] 7
And yes, no more [fnc], there is [meme] now =D
You can prints out Dani's quotes :))
::Not as thicc as your mom.
Dani[meme] mom
::Prints "Wow that was really cool." endlessly
Dani[meme] cool
::Freak you billy.
Dani[meme] billy
You can also do SpongeBob stuffs
::echo Ravioli, ravioli, give me formuoli.
SpongeBob[meme] 1
:: Pops a window that rickrolls you :D
SummonLegend[fnc]
::Prints out Hello, World
HelloWorld[str]
::Prints out Grab me a drink, mate
GrabMeADrink[str]
::Prints out I Love You
ILoveYou[str]
::Prints out Are ya winning son ?
AreYaWinningSon[str]
::Prints out Hi mate
HiM8[str]
::Prints out Damn boi... Damn boi... Damn boi he thicc boia, that's a thicc ass boi.
Thicc[meme]
And again, yes, there is also [str] just for varieties =D
CoolHackerMan[fnc]
Just for surprising elements, just try it on your own =D
Java[fnc]
Java[str]
Java[meme]
Json[str]
Please do not put these commands in the same line as the others:
For example, this would cause error:
DoIf[fnc] %b% == %c% OddOrEven[fnc] 1
You should have it like this:
DoIf[fnc] %b% == %c% (
OddOrEven[fnc] 1
)
But with normal commands like Swear[fnc], you can use it however you want.
Also, FreakC is case-sensitive, so you need to be strict with your code.
Most of the commands are just modified Batch commands, so you can actually apply Batch logic in it.