Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% A Prolog solver for the Skyline puzzle | |
% http://www.constantin-jean-clau.de/ | |
print_solution(X,Y) :- solve(X,Y,Sol), print_board(Sol). | |
pos(X,Y,_) :- member(X,[1,2,3,4,5,6,7]), member(Y,[1,2,3,4,5,6,7]). | |
board(Board) :- findall(pos(X,Y,_),pos(X,Y,_),Board). | |
solve(X,Y,Board) :- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% A Prolog solver for the bridge and torch puzzle | |
% https://en.wikipedia.org/wiki/Bridge_and_torch_problem | |
print_all_solutions :- | |
findall(_,print_solution,_). | |
print_solution :- | |
init(State), | |
solve(State,Solution,EndState), | |
writeln('Start state:'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% A Prolog solver for the Zebra puzzle a.k.a. Einstein's riddle. | |
% https://en.wikipedia.org/wiki/Zebra_Puzzle | |
einstein :- | |
einstein(Solution), | |
write_sol(Solution). | |
einstein(Sol) :- | |
Sol = [ | |
[1,N1,C1,P1,D1,S1], % There are five houses. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% A Prolog solver for the Icosian game | |
% https://en.wikipedia.org/wiki/Icosian_game | |
icosian_puzzle_edges([ | |
(b,c), (b,g), (b,z), (c,d), (c,p), (d,f), (d,m), (f,g), (f,k), (g,h), | |
(h,j), (h,x), (j,k), (j,v), (k,l), (l,t), (l,m), (m,n), (n,p), (n,s), | |
(p,q), (q,z), (q,r), (r,s), (r,w), (s,t), (t,v), (v,w), (w,x), (x,z) | |
]). | |
connected(Adj,P,Q) :- member((P,Q),Adj); member((Q,P),Adj). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Compare Database | |
Option Explicit | |
' http://en.wikipedia.org/wiki/International_Bank_Account_Number | |
Private Const IbanCountryLengths As String = "AL28AD24AT20AZ28BH22BE16BA20BR29BG22CR21HR21CY28CZ24DK18DO28EE20FO18" & _ | |
"FI18FR27GE22DE22GI23GR27GL18GT28HU28IS26IE22IL23IT27KZ20KW30LV21LB28" & _ | |
"LI21LT20LU20MK19MT31MR27MU30MC27MD24ME22NL18NO15PK24PS29PL28PT25RO24" & _ | |
"SM27SA24RS22SK24SI19ES24SE24CH21TN24TR26AE23GB22VG24QA29" | |
Private Function ValidIbanCountryLength(CountryCode As String, IbanLength As Integer) As Boolean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' modKeyboardLeds | |
' Aswin van Woudenberg | |
Option Explicit | |
Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" _ | |
(lpVersionInformation As OSVERSIONINFO) As Long | |
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _ | |
ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long) | |
Private Declare Function GetKeyboardState Lib "user32" (pbKeyState As Byte) As Long |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// setres.cpp | |
// Aswin van Woudenberg | |
#include <iostream> | |
#include <windows.h> | |
using namespace std; | |
int main(int argc, char *argv[]) | |
{ |