Skip to content

Instantly share code, notes, and snippets.

View gorkinovich's full-sized avatar

Gorka Suárez gorkinovich

View GitHub Profile
@gorkinovich
gorkinovich / C64TestKeyboard.c
Last active June 5, 2022 19:45
Test program in C language, using the CC65 compiler, to check the keyboard matrix with the Commodore 64.
#include <stdio.h>
#include <conio.h>
#define POKE(A,X) (*(unsigned char *)A) = (X)
#define PEEK(A) (*(unsigned char *)A)
#define POKEW(A,X) (*(unsigned int *)A) = (X)
#define PEEKW(A) (*(unsigned int *)A)
#define MAX_ROWS 8
#define MAX_COLS 8
@gorkinovich
gorkinovich / myst.erl
Last active May 29, 2022 14:53
This program solves the Myst puzzle inside the clock tower.
%%%================================================================================
%%% Copyright (c) 2022 Gorka Suárez García
%%%
%%% Permission is hereby granted, free of charge, to any person obtaining a copy
%%% of this software and associated documentation files (the "Software"), to deal
%%% in the Software without restriction, including without limitation the rights
%%% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
%%% copies of the Software, and to permit persons to whom the Software is
%%% furnished to do so, subject to the following conditions:
%%%
@gorkinovich
gorkinovich / MetaFibonacci.cpp
Created October 19, 2021 08:40
The calculation of the Fibonacci number using metaprogramming with C++ templates.
#include <iostream>
#include <iomanip>
#include <cstdint>
using namespace std;
// This function only works up to n = 46.
template<unsigned char n>
class MetaFibonacci {
private:
@gorkinovich
gorkinovich / Preferences.ini
Created April 4, 2021 13:05
This is a little fix for The Longest Journey in Steam, to avoid in Windows 10 a bug with the transparency in the textures of the game. The Preferences.ini file goes in the folder: %APPDATA%\The Longest Journey
[Preferences]
bool_AprilHighRes=1
SfxVolume=1.000000
VoiceVolume=1.000000
MusicVolume=1.000000
bool_Subtitles=1
bool_ShadowsOn=1
bool_DisableWarnings=1
bool_SkipCD=1
bool_HighResVideo=1
@gorkinovich
gorkinovich / maude.lang
Last active April 15, 2016 12:12
Maude System Syntax Highlighter for GTKSourceView
<?xml version="1.0" encoding="UTF-8"?>
<!--
Maude System Syntax Highlighter for GTKSourceView
Copyright (C) 2016 Adrián Riesco Rodríguez, Gorka Suárez García
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
open System
open System.IO
type Entity = {
TargetX : float
TargetY : float
Speed : float
ExpectedDistance : float
Name : string
}
open System
let golden_ratio = (1.0 + (Math.Sqrt 5.0)) / 2.0
let read_generic_number (msg : string) fconv ftest defval =
let mutable value = defval
while ftest value do
try
Console.Write msg
value <- Console.ReadLine() |> fconv
@gorkinovich
gorkinovich / NameAndAge.fs
Created December 2, 2015 01:28
A F#'s example to practice the language.
open System
let read_string (msg : string) =
Console.Write msg
Console.ReadLine ()
let read_integer (msg : string) =
Console.Write msg
let line = Console.ReadLine ()
let canparse, keyin = Int32.TryParse line