Saturday, December 26, 2020

A millisecond Timer in C


Here is one possible implementation of a millisecond timer in C using time.h and ts.tv_nsec
Proof of concept:  Timer Source code
A simpler, more compliant version can be found in repository.

Saturday, December 5, 2020

New Horizons

Google Sheets & Javascript

GOOGLE SHEET MANIPULATION

Spreadsheet link

WORD TRANSLATION
COMMENT
[+] Words:

>> Translation:

Result:

Table:

Saturday, November 14, 2020

A one-line formula to add the digits of a 2-digit number using mod

Adding two digits of a number is the same as subtracting 9 multiplied by the number in the tens from the original number. This formula uses mod(%) to isolate such number and provides the result of the addition of the 2 digits of a given number from 11 to 99:

From: x- (((x -(x mod 10)) / 10) *9)
To: f(x) = x - (1/10(x - x mod 10))× 9
Example: 23 -> 2+3 = 5 | 23 - (9*2) = 5 | 23 - (((23 - (23 mod 10)) / 10) * 9) = 5 
Sample in Ctwodigits




Friday, August 28, 2020

Asteroid Game

Screenshot of the remake of the classic game Asteroid with SDL2 in pure C.

[+] Code:
First commit and subsequent development: 

[+] Game Structure: