Sunday, January 31, 2016

Amazing Music - Minimal Code

echo "g(i,x,t,o){return((3&x&(i*((3&i>>16?\"BY}6YB6%\":\"Qj}6jQ6%\")[t%8]+51)>>o))<<4);};main(i,n,s){for(i=0;;i++)putchar(g(i,1,n=i>>14,12)+g(i,s=i>>17,n^i>>13,10)+g(i,s/3,n+((i>>11)%3),10)+g(i,s/5,8+n-((i>>10)%3),9));}"|gcc -xc -&&./a.out|aplay


Type that on your linux terminal and hear the music being generated life by this code:
Remove |aplay if you want to see the stream of chars on your terminal instead of the music.

Explanation:
https://www.youtube.com/watch?v=MqZgoNRERY8

Wednesday, January 6, 2016

Space Invaders


Coded in Free Pascal (Object Pascal) and using the SDL unit. I bring you the classic space invader game.
All the credit goes to the person who posted how to do it step by step on Youtube.
You'll find the link to the original video below.



Here the link to the original author:

https://www.youtube.com/watch?v=hPmJB0mS-GA