All Projects → KvanTTT → Freaky-Sources

KvanTTT / Freaky-Sources

Licence: Apache-2.0 license
Collection of freaky sources written on C# (mostly quines in different forms).

Programming Languages

C#
18002 projects
java
68154 projects - #9 most used programming language
smalltalk
420 projects
PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to Freaky-Sources

Creepycodecollection
A Nonsense Collection of Disgusting Codes
Stars: ✭ 2,206 (+18283.33%)
Mutual labels:  quine, polyglot
polyglot
Create websites using any mix of programming languages or workflows 💎
Stars: ✭ 79 (+558.33%)
Mutual labels:  polyglot
Rosettagit
Solutions to tasks in over 700 programming languages
Stars: ✭ 160 (+1233.33%)
Mutual labels:  polyglot
ldca
Self-replicating, self-modifying Assembly program that can evolve into every possible computer program in the universe (EXPERIMENTAL)
Stars: ✭ 43 (+258.33%)
Mutual labels:  quine
Graal
GraalVM: Run Programs Faster Anywhere 🚀
Stars: ✭ 16,272 (+135500%)
Mutual labels:  polyglot
Glottologist
An easy to use translate library
Stars: ✭ 58 (+383.33%)
Mutual labels:  polyglot
Snowcrash
A polyglot payload generator
Stars: ✭ 143 (+1091.67%)
Mutual labels:  polyglot
bee-travels-node
👁️ 🐝 Ⓜ️
Stars: ✭ 30 (+150%)
Mutual labels:  polyglot
examples
MetaCall Examples - A collection of use cases and examples to be deployed in MetaCall.
Stars: ✭ 18 (+50%)
Mutual labels:  polyglot
recursion-and-dynamic-programming
Julia and Python recursion algorithm, fractal geometry and dynamic programming applications including Edit Distance, Knapsack (Multiple Choice), Stock Trading, Pythagorean Tree, Koch Snowflake, Jerusalem Cross, Sierpiński Carpet, Hilbert Curve, Pascal Triangle, Prime Factorization, Palindrome, Egg Drop, Coin Change, Hanoi Tower, Cantor Set, Fibo…
Stars: ✭ 37 (+208.33%)
Mutual labels:  palindrome
Golang Examples
Some examples for the programming language Go.
Stars: ✭ 14 (+16.67%)
Mutual labels:  palindrome
rotten
Demo of Ken Thompson's Reflections on Trusting Trust as a tiny lisp compiler
Stars: ✭ 90 (+650%)
Mutual labels:  quine
kosmikoa.nvim
A dark color scheme for Neovim with support for LSP, Treesitter. This mirror is deprecated. Use the repo at https://sr.ht/~novakane/kosmikoa.nvim/
Stars: ✭ 23 (+91.67%)
Mutual labels:  polyglot
Polyglot
🔤 Multilingual and i18n support tool for Jekyll Blogs
Stars: ✭ 242 (+1916.67%)
Mutual labels:  polyglot
exembed
Go Embed experiments
Stars: ✭ 27 (+125%)
Mutual labels:  quine
Polyshell
A Bash/Batch/PowerShell polyglot!
Stars: ✭ 154 (+1183.33%)
Mutual labels:  polyglot
sql-formatter
Polyglot SQL formatter
Stars: ✭ 28 (+133.33%)
Mutual labels:  polyglot
react-polyglot-hooks
Hooks for using Polyglot.js with React.
Stars: ✭ 26 (+116.67%)
Mutual labels:  polyglot
loopback-example-polyglot
Example LoopBack application with polyglot runtimes
Stars: ✭ 14 (+16.67%)
Mutual labels:  polyglot
redux-polyglot
Polyglot.js bindings for Redux
Stars: ✭ 59 (+391.67%)
Mutual labels:  polyglot

Freaky-Sources

Collection of freaky sources written on C# (mostly quines in different forms).

More detail description is available on Russian:

Sources

Single Line Comment Palindrome Quine.

Multi Line Comment Palindrome Quine.

Asciimation Quine

Used data from http://asciimation.co.nz/ by Simon Jansen © 1997 - 2011. One compilation per one frame.

Star wars in source code

Quine Clock.

One compilation per one second.

Quine Clock

Quine Snake.

Use arrow keys to change direction and move snake. Game can be either completed or failed :)

Quine Snake

Polyglot Quine.

The quine that compilied both in C# and Java.

Palindrome Polyglot Quine

The quine that compilied both in C# and Java and have a palindromic format (PalindromePolyglotQuine.cs.java):

/**///\u000A\u002F\u002A
using System;//\u002A\u002F
class Program{public static void//\u000A\u002F\u002A
Main//\u002A\u002Fmain
(String[]z){String s="`**?`@#_^using System;?_#^class Program{public static void?@#_^Main?_#main^(String[]z){String s=!$!,t=s;int i;int[]a=new int[]{33,94,38,64,35,95,96,63,36};String[]b=new String[]{!&!!,!&n!,!&&!,!&@!,!&#!,!&_!,!`!,!?!,s};for(i=0;i<9;i++)t=t.?@#_^Replace?_#replace^(!!+(char)a[i],b[i]);t+='*';for(i=872;i>=0;i--)t=t+t?@#_^[i];Console.Write?_#.charAt(i);System.out.printf^(t);}}/",t=s;int i;int[]a=new int[]{33,94,38,64,35,95,96,63,36};String[]b=new String[]{"\"","\n","\\","\\u000A","\\u002F","\\u002A","/","//",s};for(i=0;i<9;i++)t=t.//\u000A\u002F\u002A
Replace//\u002A\u002Freplace
(""+(char)a[i],b[i]);t+='*';for(i=872;i>=0;i--)t=t+t//\u000A\u002F\u002A
[i];Console.Write//\u002A\u002F.charAt(i);System.out.printf
(t);}}/*/}};)t(
ftnirp.tuo.metsyS;)i(tArahc.F200u\A200u\//etirW.elosnoC;]i[
A200u\F200u\A000u\//t+t=t)--i;0=>i;278=i(rof;'*'=+t;)]i[b,]i[a)rahc(+""(
ecalperF200u\A200u\//ecalpeR
A200u\F200u\A000u\//.t=t)++i;9<i;0=i(rof;}s,"//","/","A200u\\","F200u\\","A000u\\","\\","n\",""\"{][gnirtS wen=b][gnirtS;}63,36,69,59,53,46,83,49,33{][tni wen=a][tni;i tni;s=t,"/}};)t(^ftnirp.tuo.metsyS;)i(tArahc.#_?etirW.elosnoC;]i[^_#@?t+t=t)--i;0=>i;278=i(rof;'*'=+t;)]i[b,]i[a)rahc(+!!(^ecalper#_?ecalpeR^_#@?.t=t)++i;9<i;0=i(rof;}s,!?!,!`!,!_&!,!#&!,!@&!,!&&!,!n&!,!!&!{][gnirtS wen=b][gnirtS;}63,36,69,59,53,46,83,49,33{][tni wen=a][tni;i tni;s=t,!$!=s gnirtS{)z][gnirtS(^niam#_?niaM^_#@?diov citats cilbup{margorP ssalc^#_?;metsyS gnisu^_#@`?**`"=s gnirtS{)z][gnirtS(
niamF200u\A200u\//niaM
A200u\F200u\A000u\//diov citats cilbup{margorP ssalc
F200u\A200u\//;metsyS gnisu
A200u\F200u\A000u\///**/

Implemention detail

Quine generation consists of several steps:

  • Code generation
  • Data generation
  • Code minification
  • Code formatting
  • Quine genration

At first next quine template is used:

using System;
using System.Text;
using System.Collections.Generic;

namespace Asciimation_1_3
{
    class Program
    {
        /*#Asciimation_1_3*/
        /*Asciimation_1_3#*/

        /*#HuffmanTree*/
        /*HuffmanTree#*/

        /*#HuffmanRleDecode2*/
        /*HuffmanRleDecode2#*/

        /*#Enums*/
        /*Enums#*/

        /*#Utils*/
        /*Utils#*/

        static string Data = /*%Data_1_3*/""/*Data_1_3%*/;
        static int CurrentFrame = /*$CurrentFrame*/0/*CurrentFrame$*/;

        static void Main()
        {
            var output = Decompress_v_1_3(Data, CurrentFrame++);
            if (CurrentFrame == 3591)
                CurrentFrame = 3590;
            /*@*/
        }
    }
}
/*$Output_1_3$*/

Comments with special char combinations named as "markers". Marker is used for code extraction or generation from different sources. Marker can have one of the following types:

  • Code copying from files for code blocks marked as /*#...*/… /*...#*/.
  • Data generation for data blocks marked /*%...*/… /*...%*/.
  • Quine parameters (introns) marked as /*$...*/… /*...$*/.
  • Place, where quine should be printed marked as /*@*/.

Compilation

One can generate quine via developed GUI. But prepared asciimation code is available here: AsciimationQuine_1_3.7z. It's possible to compile one frame or entire animation with the following scripts:

Windows command line (bat):

echo off

:LOOP
    "C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe" "Asciimation_1_3.cs"
    "Asciimation_1_3.exe" > "Asciimation_1_3.cs"
    type "Asciimation_1_3.cs"
goto LOOP

:END

Powershell:

while ($true) {
    &"C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe" "Asciimation_1_3.cs"
    ./"Asciimation_1_3.exe" > "Asciimation_1_3.cs"
    type "Asciimation_1_3.cs"
}

Linux with mono

while :
do
    mcs "Asciimation_1_3.cs"
    mono "Asciimation_1_3.exe" > "Asciimation_1_3.cs"
    cat "Asciimation_1_3.cs"
done

Tests

Quines, Palidrome, Polyglot and other program tests available in FreakySource.Tests project. Polyglot quine tests require installed Java.

Licence

  • Code for code, data, quine generation under the Apache 2.0 License.
  • Generated source codes under the MIT License.

Enjoy!

     ___     _____   _____   ^   ^   _    _     ___    _____   ^   _____   __  _ 
    / _ \   |  ___| |  ___| | | | | | \  / |   / _ \  |_   _| | | |  _  | |  \| |
   / /_\ \  |___  | | |___  | | | | |  \/  |  / /_\ \   | |   | | | |_| | | |\  |
  /_______\ |_____| |_____| |_| |_| |_|\/|_| /_______\  |_|   |_| |_____| |_| \_|
                                                                        
   _____    _   _   ^   __  _   _____                                
  |  _  |  | | | | | | |  \| | |  ___|                               
  | |_| |  | |_| | | | | |\  | |  __|              
  |_____ \ |_____| |_| |_| \_| |_____|                               
        \/                                        
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].