Skip to content

Instantly share code, notes, and snippets.

View onlyshk's full-sized avatar

Kuleshov Alexander onlyshk

View GitHub Profile
//
//***************************************************
// y - left
//***************************************************
//
int l1,l2 = 0;
x = 0;
y = 0;
k = 0;
z = 0;
@onlyshk
onlyshk / reversi.cpp
Created November 5, 2010 15:20
reversi logic
int x = 0;
int y = 0;
int z = 0;
int k,s = 0;
int l3 = 0;
int l4 = 0;
//
//***************************************************
// x - down
// //
// //***************************************************
// // x - down
// //***************************************************
// //
// x = (int)(e->y() / 40);
// y = (int)(e->x() / 40);
// if (x != 7)
// {
@onlyshk
onlyshk / gist:665483
Created November 6, 2010 15:30
LOGIC
//
//***************************************************
// x - down y right
//***************************************************
//
int l3;
int l4;
l1 = 0;
l2 = 0;
// if (x == 0)
// {
// l1 += 1;
// while (l1 != 8)
// {
// if (field[x][l1] == field[x][y])
// {
// s = l1;
// break;
// }
9> 10 / 5.
2.0
10> 10 div 5.
2
11> 10 rem 5.
0
@onlyshk
onlyshk / erlang.elisp
Created November 17, 2010 14:27
erlang my .emacs
(setq load-path (cons "/usr/lib/erlang/lib/tools-2.6.5.1/emacs"
load-path))
(setq load-path (cons "/usr/local/Cellar/erlang/R13B04/lib/erlang/lib/tools-2.6.5.1/emacs/erlang-skels.el"
load-path))
(require 'erlang-start)
(add-to-list 'auto-mode-alist '("\\.erl?$" . erlang-mode))
(add-to-list 'auto-mode-alist '("\\.hrl?$" . erlang-mode))
@onlyshk
onlyshk / cs.erl
Created November 29, 2010 07:03
client server erl
-module(f).
-export([init/0]).
-export([start/0, get_freq/0, stop/0]).
-export([allocate/0, deallocate/1]).
%%
%% server functions
%%
#include <QtCore/QCoreApplication>
#include "train.h"
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
#include "train.h"
#include <iostream>
//
// Get all trains
//
void Train::GetTrains()
{
cout << "Information about all trains: \n";