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
#ignore thumbnails created by windows | |
Thumbs.db | |
#Ignore files build by Visual Studio | |
*.obj | |
*.exe | |
*.pdb | |
*.user | |
*.aps | |
*.pch |
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
;1 | |
(defun calc-poly (x) | |
(+ (* (- (* (+ (* (- (* 2 x) 3) x) 4) x) 5 ) x) 6)) | |
;2 | |
(defun NULL1 (a) | |
(if a nil T)) | |
(defun CADDR1 (lst) | |
(car (cdr (cdr lst)))) |
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
;1 | |
(defun fib-r (n) | |
(cond | |
( (eql n 1) 1) | |
( (eql n 2) 2) | |
(t (+ (fib-r (- n 1)) (fib-r (- n 2)))) | |
) | |
) | |
(defun fib-i (n) |
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
;1 | |
(defun factorial (n) | |
(if (equal n 1) 1 (* n (factorial(- n 1)))) | |
) | |
(defun map-factorial (lst) | |
(mapcar 'factorial lst) | |
) | |
;2 | |
(defun map-sum (l1 l2) |
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
(defconstant color-names '("Red" "Green" "Orange" "Yellow" "Purple" "Tan" "Black" "White" "Brown" "Grey" )) | |
(defconstant color-letters "0123456789") | |
(defconstant max-colors 10) | |
(defconstant max-positions 8) | |
(defconstant max-rounds 10) | |
(defconstant max-moves 20) | |
(defun make-permutation (positions colors) | |
(let ((color-string (make-array positions :element-type 'character))) |
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
#test | |
f = open("out.gpss.pp.txt","w+") | |
mode = "RENUM" #"GEN_SWQ" #"GEN_SW_CHAN" | |
if mode == "GEN_SW_CHAN": | |
sws = [ (10, 11), (10,12), (10,13), (10,14), (14,15), (14,16), \ | |
(20,21), (20,22), (20,23), (20,24), (10,20)] | |
for inp,out in sws: | |
f.write("7400 aS{0}S{1} SEIZE kS{0}S{1}\n".format(inp, out)) | |
f.write("7410 ADVANCE ADV_k\n") | |
f.write("7420 RELEASE kS{0}S{1}\n".format(inp, out)) |
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
#include <iostream> | |
using namespace std; | |
class List | |
{ | |
private: | |
struct ListItem | |
//структура для хранения списка | |
{ | |
int value; // заначение |
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
import socket | |
host = '' | |
port = 50127 | |
data = '\x00\x42\x02\x01\x40\x61\x86\xff\xbb\x97\x00\x14\xa9\xfe\x54\xb5\xff\xff\x00\x00' | |
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) | |
s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) | |
s.bind((host, port)) |