Compare commits
15 Commits
0bc1280929
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| caa964cc99 | |||
| de2948a44a | |||
| 949cfc5a23 | |||
| d867691dd6 | |||
| 231c3491b6 | |||
| 152c726aa3 | |||
| 91d7fb3beb | |||
| dc83f6e7d1 | |||
| 512d441517 | |||
| c6d0207fa5 | |||
| c2abb6af27 | |||
| 37d6eab0cd | |||
| 98447f2cf7 | |||
| df8f21a07b | |||
| 9a0e65632e |
@@ -1,5 +1,6 @@
|
||||
# Умножение: общий случай
|
||||
## Ссылка на видеоразбор
|
||||
https://youtu.be/NKhwfK0PurY
|
||||
## Код из книги
|
||||
let real_mul x y n =
|
||||
let n2 = n + 2 in
|
||||
|
||||
7
Жегалин Михаил/Konkatenatsia.rkt
Normal file
7
Жегалин Михаил/Konkatenatsia.rkt
Normal file
@@ -0,0 +1,7 @@
|
||||
(define (concat li1 li2)
|
||||
(if (empty? li2)
|
||||
li1
|
||||
(concat (append li1 (list (car li2))) (cdr li2))
|
||||
)
|
||||
)
|
||||
(writeln (concat (list 1 2 3) (list 3 4 5)))
|
||||
8
Жегалин Михаил/README.md
Normal file
8
Жегалин Михаил/README.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# Конкатенация
|
||||
## Ссылка на видеоразбор
|
||||
https://youtu.be/UCdiG5nTiFY
|
||||
## Код из книги
|
||||
#let rec append l1 l2 =
|
||||
match l1 with
|
||||
[] -> l2
|
||||
| (h::t) -> h::(append t l2);;
|
||||
29
Ковтун Богдан/Kovtun Bogdan.rkt
Normal file
29
Ковтун Богдан/Kovtun Bogdan.rkt
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
#lang racket/base
|
||||
(define (coordinations x1 y1 x2 y2 x3 y3 x4 y4 x5 y5)
|
||||
(define (square x) (* x x))
|
||||
(if (equal? (* (- x1 x2) (- y2 y3)) (* (- y1 y2) (- x2 x3)))
|
||||
(displayln "Points 1, 2 and 3 lie on a common line.")
|
||||
(displayln "Points 1, 2 and 3 do not lie on a common line."))
|
||||
(if (equal? (* (- x1 x2) (- y3 y4)) (* (- y1 y2) (- x3 x4)))
|
||||
(displayln "Lines (1,2) and (3,4) are parallel.")
|
||||
(displayln "Lines (1,2) and (3,4) are not parallel."))
|
||||
(if (equal? (+ (* (- x1 x2) (- x3 x4)) (* (- y1 y2) (- y3 y4))) 0 )
|
||||
(displayln "Lines (1,2) and (3,4) are perpendicular.")
|
||||
(displayln "Lines (1,2) and (3,4) are not perpendicular."))
|
||||
(if (equal? (+ (square(- x1 x2)) (square(- y1 y2))) (+ (square(- x3 x4)) (square(- y3 y4))))
|
||||
(displayln "Lines (1,2) and (3,4) have the same length.")
|
||||
(displayln "Lines (1,2) and (3,4) do not have the same length.."))
|
||||
(if (and (equal? (* 2 x1) (+ x2 x3)) (equal? (* 2 y1) (+ y2 y3)))
|
||||
(displayln "Point 1 is the midpoint of line (2,3).")
|
||||
(displayln "Point 1 is not the midpoint of line (2,3)."))
|
||||
(if (and (equal? (* (- x1 x2) (- y2 y3)) (* (- y1 y2) (- x2 x3)) )
|
||||
(equal? (* (- x1 x4) (- y4 y5)) (* (- y1 y4) (- x4 x5)) ) )
|
||||
(displayln "Lines (2,3) and (4,5) meet at point 1.")
|
||||
(displayln "Lines (2,3) and (4,5) do not intersect at point 1."))
|
||||
(if (and (equal? x1 x2) (equal? y1 y2))
|
||||
(displayln "Points 1 and 2 are the same.")
|
||||
(displayln "Points 1 and 2 are not the same."))
|
||||
|
||||
)
|
||||
(coordinations 0 1 0 0 0 1 1 1 2 2)
|
||||
32
Ковтун Богдан/README.md
Normal file
32
Ковтун Богдан/README.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# Перевод геометрических свойств в координаты
|
||||
## Ссылка на видеоразбор
|
||||
https://youtu.be/Nu43zpDrWuM
|
||||
## Код из книги
|
||||
let coordinations =
|
||||
["collinear", (** Points 1, 2 and 3 lie on a common line **)
|
||||
<<(1_x - 2_x) * (2_y - 3_y) = (1_y - 2_y) * (2_x - 3_x)>>;
|
||||
"parallel", (** Lines (1,2) and (3,4) are parallel **)
|
||||
<<(1_x - 2_x) * (3_y - 4_y) = (1_y - 2_y) * (3_x - 4_x)>>;
|
||||
"perpendicular", (** Lines (1,2) and (3,4) are perpendicular **)
|
||||
<<(1_x - 2_x) * (3_x - 4_x) + (1_y - 2_y) * (3_y - 4_y) = 0>>;
|
||||
"lengths_eq", (** Lines (1,2) and (3,4) have the same length **)
|
||||
<<(1_x - 2_x)^2 + (1_y - 2_y)^2 = (3_x - 4_x)^2 + (3_y - 4_y)^2>>;
|
||||
"is_midpoint", (** Point 1 is the midpoint of line (2,3) **)
|
||||
<<2 * 1_x = 2_x + 3_x /\ 2 * 1_y = 2_y + 3_y>>;
|
||||
"is_intersection", (** Lines (2,3) and (4,5) meet at point 1 **)
|
||||
<<(1_x - 2_x) * (2_y - 3_y) = (1_y - 2_y) * (2_x - 3_x) /\
|
||||
(1_x - 4_x) * (4_y - 5_y) = (1_y - 4_y) * (4_x - 5_x)>>;
|
||||
"=", (** Points 1 and 2 are the same **)
|
||||
<<(1_x = 2_x) /\ (1_y = 2_y)>>];;
|
||||
|
||||
let coordinate = onatoms
|
||||
(fun (R(a,args)) ->
|
||||
let xtms,ytms = unzip
|
||||
(map (fun (Var v) -> Var(v^"_x"),Var(v^"_y")) args) in
|
||||
let xs = map (fun n -> string_of_int n^"_x") (1--length args)
|
||||
and ys = map (fun n -> string_of_int n^"_y") (1--length args) in
|
||||
subst (fpf (xs @ ys) (xtms @ ytms)) (assoc a coordinations));;
|
||||
|
||||
START_INTERACTIVE;;
|
||||
coordinate <<collinear(a,b,c) ==> collinear(b,a,c)>>;;
|
||||
END_INTERACTIVE;;
|
||||
8
Костин Андрей/README.md
Normal file
8
Костин Андрей/README.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# Вычисление степени
|
||||
## Ссылка на видеоразбор
|
||||
https://youtu.be/4LgMiXXWyE4
|
||||
## Код из книги
|
||||
#let rec exp x n =
|
||||
if n = 0 then 1
|
||||
else x * exp x (n - 1);;
|
||||
|
||||
4
Костин Андрей/power.rkt
Normal file
4
Костин Андрей/power.rkt
Normal file
@@ -0,0 +1,4 @@
|
||||
#lang racket
|
||||
(define (power n m)
|
||||
(if (= m 0) 1
|
||||
(* n (power n (- m 1)))))
|
||||
30
Латин Ярослав/1ch.fs
Normal file
30
Латин Ярослав/1ch.fs
Normal file
@@ -0,0 +1,30 @@
|
||||
let mutable y1 = 1
|
||||
let _ = y1 <- y1*2 in
|
||||
let _ = y1 <- y1+1 in
|
||||
let _ = y1 <- y1+1 in
|
||||
|
||||
printf "y1 = %A\n"y1
|
||||
|
||||
let mutable x1 = 1
|
||||
let _ = x1 <- x1+1 in
|
||||
let _ = x1 <- x1*2 in
|
||||
let _ = x1 <- x1+1 in
|
||||
|
||||
printf "x1 = %A\n"x1
|
||||
|
||||
let mutable y = 1
|
||||
y <- y * 2
|
||||
y <- y + 1
|
||||
y <- y + 1
|
||||
|
||||
|
||||
printf "y = %A\n"y
|
||||
|
||||
let mutable x = 1
|
||||
x <- x + 1
|
||||
x <- x * 2
|
||||
x <- x + 1
|
||||
|
||||
|
||||
printf "x = %A\n"x
|
||||
|
||||
15
Латин Ярослав/2ch.fs
Normal file
15
Латин Ярослав/2ch.fs
Normal file
@@ -0,0 +1,15 @@
|
||||
module kolok
|
||||
|
||||
let mutable x = []
|
||||
|
||||
let mutable refx = ref x
|
||||
|
||||
let _ = refx <- ref [2]
|
||||
//let _ = refx <- ref [true]
|
||||
|
||||
|
||||
printf "%O\n" refx
|
||||
printf "%A\n" refx
|
||||
|
||||
|
||||
|
||||
16
Латин Ярослав/README.md
Normal file
16
Латин Ярослав/README.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# Последовательность вычислений и Работа с системой типов
|
||||
## Ссылка на видеоразбор
|
||||
|
||||
## Код из книги
|
||||
Ярик Латин, [5/10/22 4:31 PM]
|
||||
let _ = x := !x + 1 in
|
||||
let _ = x := !x + 1 in
|
||||
let _ = x := !x + 1 in
|
||||
let _ = x := !x + 1 in
|
||||
();;
|
||||
|
||||
Ярик Латин, [5/10/22 4:31 PM]
|
||||
x := !x + 1;
|
||||
x := !x + 1;
|
||||
x := !x + 1;
|
||||
x := !x + 1;;
|
||||
29
Носов Иван/README.md
Normal file
29
Носов Иван/README.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# Дифференцирование
|
||||
## Ссылка на видеоразбор
|
||||
https://youtu.be/Kh0shn9UW6Y
|
||||
## Код из книги
|
||||
#let rec differentiate x tm = match tm with
|
||||
Var y -> if y = x then Const "1" else Const "0"
|
||||
| Const c -> Const "0"
|
||||
| Fn("-",[t]) -> Fn("-",[differentiate x t])
|
||||
| Fn("+",[t1;t2]) -> Fn("+",[differentiate x t1;
|
||||
differentiate x t2])
|
||||
| Fn("-",[t1;t2]) -> Fn("-",[differentiate x t1;
|
||||
differentiate x t2])
|
||||
| Fn("*",[t1;t2]) ->
|
||||
Fn("+",[Fn("*",[differentiate x t1; t2]);
|
||||
Fn("*",[t1; differentiate x t2])])
|
||||
| Fn("inv",[t]) -> chain x t
|
||||
(Fn("-",[Fn("inv",[Fn("^",[t;Const "2"])])]))
|
||||
| Fn("^",[t;n]) -> chain x t
|
||||
(Fn("*",[n; Fn("^",[t; Fn("-",[n; Const "1"])])]))
|
||||
| Fn("exp",[t]) -> chain x t tm
|
||||
| Fn("ln",[t]) -> chain x t (Fn("inv",[t]))
|
||||
| Fn("sin",[t]) -> chain x t (Fn("cos",[t]))
|
||||
| Fn("cos",[t]) -> chain x t
|
||||
(Fn("-",[Fn("sin",[t])]))
|
||||
| Fn("/",[t1;t2]) -> differentiate x
|
||||
(Fn("*",[t1; Fn("inv",[t2])]))
|
||||
| Fn("tan",[t]) -> differentiate x
|
||||
(Fn("/",[Fn("sin",[t]); Fn("cos",[t])]))
|
||||
and chain x t u = Fn("*",[differentiate x t; u]);;
|
||||
113
Носов Иван/proizvodnaya.rkt
Normal file
113
Носов Иван/proizvodnaya.rkt
Normal file
@@ -0,0 +1,113 @@
|
||||
#lang racket
|
||||
(define (deriv exp var)
|
||||
(cond ((number? exp) 0)
|
||||
((variable? exp)
|
||||
(if (same-variable? exp var) 1 0))
|
||||
|
||||
((sum? exp)
|
||||
(make-sum (deriv (addend exp) var)
|
||||
(deriv (augend exp) var)))
|
||||
|
||||
((dif? exp)
|
||||
(make-dif (deriv (addend exp) var)
|
||||
(deriv (augend exp) var)))
|
||||
|
||||
((product? exp)
|
||||
(make-sum
|
||||
(make-product (multiplier exp)
|
||||
(deriv (multipicand exp) var))
|
||||
(make-product (deriv (multiplier exp) var)
|
||||
(multipicand exp))))
|
||||
|
||||
((exponentiation? exp)
|
||||
(make-product
|
||||
(make-product (exponent exp)
|
||||
(make-exponentiation (base exp) (- (exponent exp) 1)))
|
||||
(deriv (base exp)
|
||||
var)))
|
||||
|
||||
((sinus? exp)
|
||||
(make-product
|
||||
(deriv (base exp)
|
||||
var)(make-cos (base exp))))
|
||||
|
||||
((cosinus? exp)
|
||||
(make-product
|
||||
(deriv (base exp)var)(make-sin (base exp))))
|
||||
|
||||
((ex? exp)
|
||||
(make-product
|
||||
(deriv (base exp)
|
||||
var)(make-exp (base exp))))
|
||||
|
||||
|
||||
(else
|
||||
error "unknow expression type -- DERIV" exp)))
|
||||
|
||||
(define (ex? x)
|
||||
(and (pair? x) (eq? 'exp (car x))))
|
||||
|
||||
(define (make-exp a0)(list 'exp a0))
|
||||
|
||||
(define (sinus? x)
|
||||
(and (pair? x) (eq? 'sin (car x) )))
|
||||
|
||||
(define (make-cos a0)(list 'cos a0))
|
||||
|
||||
(define (cosinus? x)
|
||||
(and (pair? x) (eq? 'cos (car x) )))
|
||||
|
||||
(define (make-sin a0)(list '-sin a0))
|
||||
|
||||
(define (=number? exp num)
|
||||
(and (number? exp) (= exp num)))
|
||||
|
||||
(define (multipicand p) (caddr p))
|
||||
|
||||
(define (variable? x) (symbol? x))
|
||||
|
||||
(define (same-variable? v0 v1)
|
||||
(and (variable? v0) (variable? v1) (eq? v0 v1)))
|
||||
|
||||
(define (make-sum a0 a1)
|
||||
(cond ((and (number? a0) (number? a1)) (+ a0 a1))
|
||||
(else (list '+ a0 a1))))
|
||||
|
||||
(define (sum? x)
|
||||
(and (pair? x) (eq? (car x) '+)))
|
||||
|
||||
(define (dif? x)
|
||||
(and (pair? x) (eq? (car x) '-)))
|
||||
|
||||
(define (make-dif a0 a1)
|
||||
(cond ((and (number? a0) (number? a1)) (- a0 a1))
|
||||
(else (list '- a0 a1))))
|
||||
|
||||
(define (addend s) (cadr s))
|
||||
|
||||
(define (augend s) (caddr s))
|
||||
|
||||
(define (make-product m0 m1)
|
||||
(cond ((or (=number? m0 0) (=number? m1 0)) 0)
|
||||
((=number? m0 1) m1)
|
||||
((=number? m1 1) m0)
|
||||
((and (number? m0) (number? m1)) (* m0 m1))
|
||||
(else (list '* m0 m1))))
|
||||
|
||||
(define (product? x)
|
||||
(and (pair? x) (eq? (car x) '*)))
|
||||
|
||||
(define (multiplier p) (cadr p))
|
||||
|
||||
(define (make-exponentiation x n)
|
||||
(cond ((= n 0) 1)
|
||||
((= n 1) x)
|
||||
(else (list '** x n))))
|
||||
|
||||
(define (exponentiation? x)
|
||||
(and (pair? x) (eq? (car x) '**)))
|
||||
|
||||
(define (base s) (cadr s))
|
||||
|
||||
(define (exponent s) (caddr s))
|
||||
|
||||
3
Павлова Наташа/README.md
Normal file
3
Павлова Наташа/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Лемма 7.6
|
||||
## Ссылка на видеоразбор
|
||||
https://youtu.be/8mOFRUgdmZU
|
||||
22
Павлова Наташа/lemma_7.6.rkt
Normal file
22
Павлова Наташа/lemma_7.6.rkt
Normal file
@@ -0,0 +1,22 @@
|
||||
#lang racket
|
||||
|
||||
(define (rev lst)
|
||||
(if (null? lst);ф-я принимает пустой список
|
||||
lst;возвращает пустой список
|
||||
(if (= 1 (length lst));ф-я принимает список из 1 элемента
|
||||
lst; возвращает список из 1 элемента
|
||||
;в списке можно выделить голову и хвост
|
||||
(append (rev (cdr lst)); запускаем rev для хвоста (cdr - хвост)
|
||||
(list(car lst));возвращаем голову (car - голова)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(writeln(rev(rev '(1 2 3 4))))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
24
Погребицкий Евгений/README.md
Normal file
24
Погребицкий Евгений/README.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# Теорема Симсона
|
||||
## Ссылка на видеоразбор
|
||||
https://youtu.be/_ewjiWIH0VY
|
||||
## Код из книги
|
||||
START_INTERACTIVE;;
|
||||
let simson =
|
||||
<<lengths_eq(o,a,o,b) /\
|
||||
lengths_eq(o,a,o,c) /\
|
||||
lengths_eq(o,a,o,d) /\
|
||||
collinear(e,b,c) /\
|
||||
collinear(f,a,c) /\
|
||||
collinear(g,a,b) /\
|
||||
perpendicular(b,c,d,e) /\
|
||||
perpendicular(a,c,d,f) /\
|
||||
perpendicular(a,b,d,g)
|
||||
==> collinear(e,f,g)>>;;
|
||||
|
||||
let vars =
|
||||
["g_y"; "g_x"; "f_y"; "f_x"; "e_y"; "e_x"; "d_y"; "d_x"; "c_y"; "c_x";
|
||||
"b_y"; "b_x"; "o_x"]
|
||||
and zeros = ["a_x"; "a_y"; "o_y"];;
|
||||
|
||||
wu simson vars zeros;;
|
||||
|
||||
38
Погребицкий Евгений/simson.rkt
Normal file
38
Погребицкий Евгений/simson.rkt
Normal file
@@ -0,0 +1,38 @@
|
||||
#lang racket/base
|
||||
|
||||
(define (square x) (* x x))
|
||||
|
||||
(define (lengths_eq x1 y1 x2 y2 x3 y3)
|
||||
(if (equal? (+ (square(- x1 x2)) (square(- y1 y2))) (+ (square(- x3 x1)) (square(- y3 y1))))
|
||||
#t #f
|
||||
))
|
||||
|
||||
(define (collinear x1 y1 x2 y2 x3 y3)
|
||||
(if (equal? (* (- x1 x2) (- y2 y3)) (* (- y1 y2) (- x2 x3)))
|
||||
#t #f
|
||||
))
|
||||
|
||||
(define (perpendicular x1 y1 x2 y2 x3 y3 x4 y4)
|
||||
(if (equal? (+ (* (- x1 x2) (- x3 x4)) (* (- y1 y2) (- y3 y4))) 0 )
|
||||
#t #f
|
||||
))
|
||||
|
||||
|
||||
|
||||
(define (simson o_x o_y a_x a_y b_x b_y c_x c_y d_x d_y e_x e_y f_x f_y g_x g_y)
|
||||
(if (and
|
||||
(lengths_eq o_x o_y a_x a_y b_x b_y)
|
||||
(lengths_eq o_x o_y a_x a_y c_x c_y)
|
||||
(lengths_eq o_x o_y a_x a_y d_x d_y)
|
||||
(collinear e_x e_y b_x b_y c_x c_y)
|
||||
(collinear f_x f_y a_x a_y c_x c_y)
|
||||
(collinear g_x g_y a_x a_y b_x b_y)
|
||||
(perpendicular b_x b_y c_x c_y d_x d_y e_x e_y)
|
||||
(perpendicular a_x a_y c_x c_y d_x d_y f_x f_y)
|
||||
(perpendicular a_x a_y b_x b_y d_x d_y g_x g_y))
|
||||
|
||||
(begin (displayln "3 Points lie on one line.") (collinear e_x e_y f_x f_y g_x g_y)
|
||||
) (displayln "3 Points do not lie on one line.")
|
||||
))
|
||||
|
||||
(simson 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 )
|
||||
18
Сивочуб Алексей/README.md
Normal file
18
Сивочуб Алексей/README.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# Теорема о квадрате
|
||||
## Ссылка на видеоразбор
|
||||
https://youtu.be/0Yp5sgddlko
|
||||
## Код из сайта
|
||||
START_INTERACTIVE;;
|
||||
let coordinations =
|
||||
["perpendicular", (** Lines (1,2) and (3,4) are perpendicular **)
|
||||
<<(1_x - 2_x) * (3_x - 4_x) + (1_y - 2_y) * (3_y - 4_y) = 0>>;
|
||||
"lengths_eq", (** Lines (1,2) and (3,4) have the same length **)
|
||||
<<(1_x - 2_x)^2 + (1_y - 2_y)^2 = (3_x - 4_x)^2 + (3_y - 4_y)^2>>;
|
||||
"is_midpoint", (** Point 1 is the midpoint of line (2,3) **)
|
||||
<<2 * 1_x = 2_x + 3_x /\ 2 * 1_y = 2_y + 3_y>>];;
|
||||
#Square theorem
|
||||
|
||||
(grobner_decide ** originate)
|
||||
<<is_midpoint(m,a,c) /\ perpendicular(a,c,m,b)
|
||||
==> lengths_eq(a,b,b,c)>>;;
|
||||
END_INTERACTIVE;
|
||||
35
Сивочуб Алексей/square.rkt
Normal file
35
Сивочуб Алексей/square.rkt
Normal file
@@ -0,0 +1,35 @@
|
||||
#lang racket/base
|
||||
|
||||
(define (square x) (* x x))
|
||||
|
||||
(define (lengths_eq x1 y1 x2 y2 x3 y3 x4 y4)
|
||||
(if (equal? (+ (square(- x1 x2)) (square(- y1 y2)))
|
||||
(+ (square(- x3 x4)) (square(- y3 y4))))
|
||||
(displayln "Lines (1,2) and (3,4) have the same length.")
|
||||
(displayln "Lines (1,2) and (3,4) do not have the same length.")))
|
||||
|
||||
(define (perpendicular x1 y1 x2 y2 x3 y3 x4 y4)
|
||||
(if (equal? (+ (* (- x1 x2) (- x3 x4)) (* (- y1 y2) (- y3 y4))) 0 )
|
||||
#t #f
|
||||
))
|
||||
|
||||
(define (is_midpoint x1 y1 x2 y2 x3 y3)
|
||||
(if (and (equal? (* 2 x1) (+ x2 x3)) (equal? (* 2 y1) (+ y2 y3)))
|
||||
(displayln "Point 1 is the midpoint of line (2,3).")
|
||||
(displayln "Point 1 is not the midpoint of line (2,3).")
|
||||
))
|
||||
|
||||
|
||||
(define (grobner_decide_mid a_x a_y b_x b_y c_x c_y d_x d_y m_x m_y)
|
||||
(if (and (is_midpoint m_x m_y a_x a_y c_x c_y)
|
||||
(perpendicular a_x a_y c_x c_y m_x m_y b_x b_y))
|
||||
(begin
|
||||
(lengths_eq a_x a_y b_x b_y b_x b_y c_x c_y)
|
||||
(displayln "This is a square.")
|
||||
)
|
||||
(displayln "This is not a square.")
|
||||
))
|
||||
|
||||
|
||||
|
||||
(grobner_decide_mid 0 0 0 2 2 2 2 0 1 1)
|
||||
19
Солкин Кирилл/README.md
Normal file
19
Солкин Кирилл/README.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# Полезные комбинаторы
|
||||
## Код из книги
|
||||
#let mem x l = exists (fun y -> y = x) l;;
|
||||
mem : ’a -> ’a list -> bool = <fun>
|
||||
#let insert x l =
|
||||
if mem x l then l else x::l;;
|
||||
insert : ’a -> ’a list -> ’a list = <fun>
|
||||
#let union l1 l2 = itlist insert l1 l2;;
|
||||
union : ’a list -> ’a list -> ’a list = <fun>
|
||||
#let setify l = union l [];;
|
||||
setify : ’a list -> ’a list = <fun>
|
||||
#let Union l = itlist union l [];;
|
||||
Union : ’a list list -> ’a list = <fun>
|
||||
#let intersect l1 l2 = filter (fun x -> mem x l2) l1;;
|
||||
intersect : ’a list -> ’a list -> ’a list = <fun>
|
||||
#let subtract l1 l2 = filter (fun x -> not mem x l2) l1;;
|
||||
subtract : ’a list -> ’a list -> ’a list = <fun>
|
||||
#let subset l1 l2 = forall (fun t -> mem t l2) l1;;
|
||||
subset : ’a list -> ’a list -> bool = <fun>
|
||||
83
Солкин Кирилл/polezn_komb.rkt
Normal file
83
Солкин Кирилл/polezn_komb.rkt
Normal file
@@ -0,0 +1,83 @@
|
||||
#lang racket
|
||||
(define (itlist f lst b)
|
||||
(if (null? lst)
|
||||
b
|
||||
(f (car lst) (itlist f (list-tail lst 1) b))))
|
||||
|
||||
(define (sum lst)
|
||||
(itlist + lst 0))
|
||||
|
||||
(define (prod lst)
|
||||
(itlist * lst 1))
|
||||
|
||||
(define (mid p)
|
||||
(lambda (x s)
|
||||
(if (p x)
|
||||
(cons x s)
|
||||
s)))
|
||||
|
||||
(define (filter p lst)
|
||||
(itlist (mid p) lst '()))
|
||||
|
||||
(define (andt l b)
|
||||
(and l b))
|
||||
|
||||
(define (ort l b)
|
||||
(or l b))
|
||||
|
||||
(define (forall p lst)
|
||||
(define a true)
|
||||
(itlist andt (map p lst) a))
|
||||
|
||||
(define (exists p lst)
|
||||
(define a false)
|
||||
(itlist ort (map p lst) a))
|
||||
|
||||
(define (tem l b)
|
||||
(+ b 1))
|
||||
|
||||
(define (length lst)
|
||||
(itlist tem lst 0))
|
||||
|
||||
(define (append l m)
|
||||
(itlist cons l m))
|
||||
|
||||
(define (const f)
|
||||
(lambda (x y) (cons (f x) y)))
|
||||
|
||||
(define (map f l)
|
||||
(define s '())
|
||||
(define con (const f))
|
||||
(itlist con l s))
|
||||
|
||||
(define (mem x lst)
|
||||
(exists (lambda (y) (= y x)) lst))
|
||||
|
||||
(define (insert x lst)
|
||||
(if (mem x lst)
|
||||
lst
|
||||
(cons x lst)))
|
||||
|
||||
(define (union l1 l2)
|
||||
(itlist insert l1 l2))
|
||||
|
||||
(define (setify lst)
|
||||
(union lst '()))
|
||||
|
||||
(define (Union lst)
|
||||
(itlist union lst '()))
|
||||
|
||||
(define (notc l2)
|
||||
(lambda (x) (mem x l2)))
|
||||
|
||||
(define (nonotc l2)
|
||||
(lambda (x) (not (mem x l2))))
|
||||
|
||||
(define (intersect l1 l2)
|
||||
(filter (notc l2) l1))
|
||||
|
||||
(define (subtract l1 l2)
|
||||
(filter (nonotc l2) l1))
|
||||
|
||||
(define (subset l1 l2)
|
||||
(forall (lambda (t) (mem t l2)) l1))
|
||||
14
Тюлюбаев Артём/README.md
Normal file
14
Тюлюбаев Артём/README.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# Ссылки и массивы
|
||||
## Ссылка на видеоразбор
|
||||
https://www.youtube.com/watch?v=LapJ8pgGTk0
|
||||
## Код из книги
|
||||
#let v = make_vect 5 0;;
|
||||
v : int vect = [|0; 0; 0; 0; 0|]
|
||||
#vect_item v 1;;
|
||||
- : int = 0
|
||||
#vect_assign v 1 10;;
|
||||
- : unit = ()
|
||||
#v;;
|
||||
- : int vect = [|0; 10; 0; 0; 0|]
|
||||
#vect_item v 1;;
|
||||
- : int = 10
|
||||
11
Тюлюбаев Артём/base+.lisp
Normal file
11
Тюлюбаев Артём/base+.lisp
Normal file
@@ -0,0 +1,11 @@
|
||||
(setq a (make-array '(4 3)))
|
||||
(dotimes (i 4)
|
||||
(dotimes (j 3)
|
||||
(setf (aref a i j) (list i 'x j '= (* i j)))
|
||||
)
|
||||
)
|
||||
(dotimes (i 4)
|
||||
(dotimes (j 3)
|
||||
(print (aref a i j))
|
||||
)
|
||||
)
|
||||
6
Тюлюбаев Артём/base.lisp
Normal file
6
Тюлюбаев Артём/base.lisp
Normal file
@@ -0,0 +1,6 @@
|
||||
(setf x (make-array '(3)
|
||||
:initial-contents '(0 1 2))
|
||||
)
|
||||
(write x)
|
||||
(setf (aref x 1) 23)
|
||||
(write x)
|
||||
7
Фурина Валерия/README.md
Normal file
7
Фурина Валерия/README.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# Лемма 7.4
|
||||
## Комментарии к коду
|
||||
#### Вариант 1: добавляет пустой список и переворачивает результат.
|
||||
#### Вариант 2: ничего не переворачивает, как и было в лемме.
|
||||
## Ссылка на видеоразбор
|
||||
https://www.youtube.com/watch?v=t_9Jv9RKarY
|
||||
|
||||
11
Фурина Валерия/var1.rkt
Normal file
11
Фурина Валерия/var1.rkt
Normal file
@@ -0,0 +1,11 @@
|
||||
(define (concat li1 li2)
|
||||
(if (empty? li2)
|
||||
li1
|
||||
(concat (append li1 (list (car li2))) (cdr li2))
|
||||
)
|
||||
)
|
||||
|
||||
(define (rev li1 li2)
|
||||
(reverse (concat li1 li2))
|
||||
)
|
||||
(writeln (rev (list 1 2) (list 3 4)))
|
||||
6
Фурина Валерия/var2.rkt
Normal file
6
Фурина Валерия/var2.rkt
Normal file
@@ -0,0 +1,6 @@
|
||||
(define (concat li1 li2)
|
||||
(if (empty? li2)
|
||||
li1
|
||||
(concat (append li1 (list (car li2))) (cdr li2))
|
||||
)
|
||||
)
|
||||
3
Шуканова Евгения/README.md
Normal file
3
Шуканова Евгения/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Лемма 7.5
|
||||
## Ссылка на видеоразбор
|
||||
https://youtu.be/FHUiQoj2YXc
|
||||
498
Шуканова Евгения/try.rkt
Normal file
498
Шуканова Евгения/try.rkt
Normal file
@@ -0,0 +1,498 @@
|
||||
#reader(lib"read.ss""wxme")WXME0109 ##
|
||||
#|
|
||||
This file uses the GRacket editor format.
|
||||
Open this file in DrRacket version 7.8 or later to read it.
|
||||
|
||||
Most likely, it was created by saving a program in DrRacket,
|
||||
and it probably contains a program with non-text elements
|
||||
(such as images or comment boxes).
|
||||
|
||||
http://racket-lang.org/
|
||||
|#
|
||||
33 7 #"wxtext\0"
|
||||
3 1 6 #"wxtab\0"
|
||||
1 1 8 #"wximage\0"
|
||||
2 0 8 #"wxmedia\0"
|
||||
4 1 34 #"(lib \"syntax-browser.ss\" \"mrlib\")\0"
|
||||
1 0 36 #"(lib \"cache-image-snip.ss\" \"mrlib\")\0"
|
||||
1 0 68
|
||||
(0
|
||||
#"((lib \"image-core.ss\" \"mrlib\") (lib \"image-core-wxme.rkt\" \"mr"
|
||||
#"lib\"))\0"
|
||||
) 1 0 16 #"drscheme:number\0"
|
||||
3 0 44 #"(lib \"number-snip.ss\" \"drscheme\" \"private\")\0"
|
||||
1 0 36 #"(lib \"comment-snip.ss\" \"framework\")\0"
|
||||
1 0 93
|
||||
(1
|
||||
#"((lib \"collapsed-snipclass.ss\" \"framework\") (lib \"collapsed-sni"
|
||||
#"pclass-wxme.ss\" \"framework\"))\0"
|
||||
) 0 0 43 #"(lib \"collapsed-snipclass.ss\" \"framework\")\0"
|
||||
0 0 19 #"drscheme:sexp-snip\0"
|
||||
0 0 29 #"drscheme:bindings-snipclass%\0"
|
||||
1 0 101
|
||||
(2
|
||||
#"((lib \"ellipsis-snip.rkt\" \"drracket\" \"private\") (lib \"ellipsi"
|
||||
#"s-snip-wxme.rkt\" \"drracket\" \"private\"))\0"
|
||||
) 2 0 88
|
||||
(3
|
||||
#"((lib \"pict-snip.rkt\" \"drracket\" \"private\") (lib \"pict-snip.r"
|
||||
#"kt\" \"drracket\" \"private\"))\0"
|
||||
) 0 0 55
|
||||
#"((lib \"snip.rkt\" \"pict\") (lib \"snip-wxme.rkt\" \"pict\"))\0"
|
||||
1 0 34 #"(lib \"bullet-snip.rkt\" \"browser\")\0"
|
||||
0 0 25 #"(lib \"matrix.ss\" \"htdp\")\0"
|
||||
1 0 22 #"drscheme:lambda-snip%\0"
|
||||
1 0 29 #"drclickable-string-snipclass\0"
|
||||
0 0 26 #"drracket:spacer-snipclass\0"
|
||||
0 0 57
|
||||
#"(lib \"hrule-snip.rkt\" \"macro-debugger\" \"syntax-browser\")\0"
|
||||
1 0 26 #"drscheme:pict-value-snip%\0"
|
||||
0 0 45 #"(lib \"image-snipr.ss\" \"slideshow\" \"private\")\0"
|
||||
1 0 38 #"(lib \"pict-snipclass.ss\" \"slideshow\")\0"
|
||||
2 0 55 #"(lib \"vertical-separator-snip.ss\" \"stepper\" \"private\")\0"
|
||||
1 0 18 #"drscheme:xml-snip\0"
|
||||
1 0 31 #"(lib \"xml-snipclass.ss\" \"xml\")\0"
|
||||
1 0 21 #"drscheme:scheme-snip\0"
|
||||
2 0 34 #"(lib \"scheme-snipclass.ss\" \"xml\")\0"
|
||||
1 0 10 #"text-box%\0"
|
||||
1 0 32 #"(lib \"text-snipclass.ss\" \"xml\")\0"
|
||||
1 0 1 6 #"wxloc\0"
|
||||
0 0 88 0 1 #"\0"
|
||||
0 75 1 #"\0"
|
||||
0 10 90 -1 90 -1 3 -1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 255 255 255 1 -1 0 9
|
||||
#"Standard\0"
|
||||
0 75 12 #"Courier New\0"
|
||||
0 10 90 -1 90 -1 3 -1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 255 255 255 1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 -1 -1 2 24
|
||||
#"framework:default-color\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 150 0 150 0 0 0 -1 -1 2 15
|
||||
#"text:ports out\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 150 0 150 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1.0 0 -1 -1 93 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 255 0 0 0 0 0 -1
|
||||
-1 2 15 #"text:ports err\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 93 -1 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 175 0 0 0 -1 -1 2 17
|
||||
#"text:ports value\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 175 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 34 139 34 0 0 0 -1
|
||||
-1 2 27 #"Matching Parenthesis Style\0"
|
||||
0 -1 1 #"\0"
|
||||
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 34 139 34 0 0 0 -1
|
||||
-1 2 1 #"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 38 38 128 0 0 0 -1 -1 2 37
|
||||
#"framework:syntax-color:scheme:symbol\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 38 38 128 0 0 0 -1 -1 2 38
|
||||
#"framework:syntax-color:scheme:keyword\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 38 38 128 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 194 116 31 0 0 0 -1 -1 2
|
||||
38 #"framework:syntax-color:scheme:comment\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 194 116 31 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 41 128 38 0 0 0 -1 -1 2 37
|
||||
#"framework:syntax-color:scheme:string\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 41 128 38 0 0 0 -1 -1 2 35
|
||||
#"framework:syntax-color:scheme:text\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 41 128 38 0 0 0 -1 -1 2 39
|
||||
#"framework:syntax-color:scheme:constant\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 41 128 38 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 132 60 36 0 0 0 -1 -1 2 49
|
||||
#"framework:syntax-color:scheme:hash-colon-keyword\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 132 60 36 0 0 0 -1 -1 2 42
|
||||
#"framework:syntax-color:scheme:parenthesis\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 132 60 36 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 2 36
|
||||
#"framework:syntax-color:scheme:error\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 36
|
||||
#"framework:syntax-color:scheme:other\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 16
|
||||
#"Misspelled Text\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 81 112 203 0 0 0 -1 -1 2
|
||||
38 #"drracket:check-syntax:lexically-bound\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 81 112 203 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 178 34 34 0 0 0 -1 -1 2 28
|
||||
#"drracket:check-syntax:set!d\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 178 34 34 0 0 0 -1 -1 2 37
|
||||
#"drracket:check-syntax:unused-require\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 2 36
|
||||
#"drracket:check-syntax:free-variable\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 68 0 203 0 0 0 -1 -1 2 31
|
||||
#"drracket:check-syntax:imported\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 68 0 203 0 0 0 -1 -1 2 47
|
||||
#"drracket:check-syntax:my-obligation-style-pref\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 178 34 34 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 116 0 0 0 0 -1 -1 2 50
|
||||
#"drracket:check-syntax:their-obligation-style-pref\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 116 0 0 0 0 -1 -1 2 48
|
||||
#"drracket:check-syntax:unk-obligation-style-pref\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 139 142 28 0 0 0 -1 -1 2
|
||||
49 #"drracket:check-syntax:both-obligation-style-pref\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 139 142 28 0 0 0 -1 -1 2
|
||||
26 #"plt:htdp:test-coverage-on\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 1 0 0 0 0 0 0 255 165 0 0 0 0 -1 -1 2 27
|
||||
#"plt:htdp:test-coverage-off\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 1 0 0 0 0 0 0 255 165 0 0 0 0 -1 -1 4 1
|
||||
#"\0"
|
||||
0 70 1 #"\0"
|
||||
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
|
||||
-1 -1 4 4 #"XML\0"
|
||||
0 70 1 #"\0"
|
||||
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
|
||||
-1 -1 2 37 #"plt:module-language:test-coverage-on\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 38
|
||||
#"plt:module-language:test-coverage-off\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 1 0 0 0 0 0 0 255 165 0 0 0 0 -1 -1 0 36
|
||||
#"mrlib/syntax-browser:subtitle-color\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 1 0 0 0 0 0 0 36 36 140 255 255 255 -1
|
||||
-1 0 42 #"mrlib/syntax-browser:focused-syntax-color\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 1 0 0 0 0 0 0 34 139 34 255 255 255 -1
|
||||
-1 4 1 #"\0"
|
||||
0 71 1 #"\0"
|
||||
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
|
||||
-1 -1 4 1 #"\0"
|
||||
0 -1 1 #"\0"
|
||||
1.0 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0 0 0 1.0 1.0 1.0 0 0 255 0 0 0 -1
|
||||
-1 4 1 #"\0"
|
||||
0 71 1 #"\0"
|
||||
1.0 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0 0 0 1.0 1.0 1.0 0 0 255 0 0 0 -1
|
||||
-1 4 1 #"\0"
|
||||
0 71 1 #"\0"
|
||||
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 0 100 0 0 0 0 -1
|
||||
-1 4 1 #"\0"
|
||||
0 71 1 #"\0"
|
||||
1.0 0 -1 -1 93 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 255 0 0 0 0 0 -1
|
||||
-1 2 1 #"\0"
|
||||
0 70 1 #"\0"
|
||||
1.0 0 -1 -1 93 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 148 0 211 0 0 0 -1
|
||||
-1 2 1 #"\0"
|
||||
0 -1 1 #"\0"
|
||||
1.0 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0 0 0 1.0 1.0 1.0 0 0 255 0 0 0 -1
|
||||
-1 0 1 #"\0"
|
||||
0 -1 1 #"\0"
|
||||
0 12 -1 -1 -1 -1 -1 -1 0 0 1 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
|
||||
-1 -1 2 1 #"\0"
|
||||
0 -1 1 #"\0"
|
||||
0 12 -1 -1 -1 -1 -1 -1 0 0 1 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
|
||||
-1 -1 2 1 #"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 200 0 0 0 0 0 -1 -1 4 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 255 255 0 -1 -1 4
|
||||
32 #"widget.rkt::browser-text% basic\0"
|
||||
0 70 1 #"\0"
|
||||
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
|
||||
-1 -1 4 59
|
||||
#"macro-debugger/syntax-browser/properties color-text% basic\0"
|
||||
0 70 1 #"\0"
|
||||
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
|
||||
-1 -1 65 1 #"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 190 190 190 0 0 0 -1 -1 4
|
||||
1 #"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 4 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 4 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 255 0 0 0 -1 -1 4 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 107 142 35 0 0 0 -1 -1 4 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 100 0 0 0 0 -1 -1 4 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 139 0 0 0 0 0 -1 -1 4 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 100 149 237 0 0 0 -1 -1 4
|
||||
1 #"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 65 105 225 0 0 0 -1 -1 4 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 70 130 180 0 0 0 -1 -1 4 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 47 79 79 0 0 0 -1 -1 4 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 139 0 0 0 -1 -1 4 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 75 0 130 0 0 0 -1 -1 4 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 160 32 240 0 0 0 -1 -1 4 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 255 165 0 0 0 0 -1 -1 4 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 250 128 114 0 0 0 -1 -1 4
|
||||
1 #"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 184 134 11 0 0 0 -1 -1 4 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 128 128 0 0 0 0 -1 -1 4 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 169 169 169 0 0 0 -1 -1 4
|
||||
1 #"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 255 228 225 -1 -1 4
|
||||
1 #"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 224 255 255 -1 -1 4
|
||||
1 #"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 1 0 0 0 0 0 0 255 0 0 224 255 255 -1 -1
|
||||
0 167 0 28 3 12 #"#lang racket"
|
||||
0 0 24 29 1 #"\n"
|
||||
0 0 24 29 1 #"\n"
|
||||
0 0 24 3 1 #"("
|
||||
0 0 15 3 6 #"define"
|
||||
0 0 24 3 2 #" ("
|
||||
0 0 14 3 3 #"rev"
|
||||
0 0 24 3 1 #" "
|
||||
0 0 14 3 1 #"x"
|
||||
0 0 24 3 1 #")"
|
||||
0 0 24 29 1 #"\n"
|
||||
0 0 24 29 1 #"\n"
|
||||
0 0 24 3 2 #" ("
|
||||
0 0 14 3 2 #"if"
|
||||
0 0 24 3 2 #" ("
|
||||
0 0 14 3 5 #"list?"
|
||||
0 0 24 3 1 #" "
|
||||
0 0 14 3 1 #"x"
|
||||
0 0 24 3 3 #") "
|
||||
0 0 17 3 32
|
||||
(4
|
||||
#";\321\217\320\262\320\273\321\217\320\265\321\202\321\201\321"
|
||||
#"\217 \321\201\320\277\320\270\321\201\320\272\320\276\320\274"
|
||||
) 0 0 24 29 1 #"\n"
|
||||
0 0 24 3 5 #" "
|
||||
0 0 17 3 5 #";then"
|
||||
0 0 24 29 1 #"\n"
|
||||
0 0 24 3 6 #" ("
|
||||
0 0 14 3 2 #"if"
|
||||
0 0 24 3 2 #" ("
|
||||
0 0 14 3 6 #"equal?"
|
||||
0 0 24 3 2 #" ("
|
||||
0 0 14 3 4 #"rest"
|
||||
0 0 24 3 1 #" "
|
||||
0 0 14 3 1 #"x"
|
||||
0 0 24 3 2 #") "
|
||||
0 0 14 3 4 #"null"
|
||||
0 0 24 3 2 #") "
|
||||
0 0 17 3 33
|
||||
(5
|
||||
#";\320\262 \321\201\320\277\320\270\321\201\320\272\320\265"
|
||||
#" 1 \321\215\320\273\320\265\320\274\320\265\320\275\321\202"
|
||||
) 0 0 24 29 1 #"\n"
|
||||
0 0 24 3 9 #" "
|
||||
0 0 17 3 5 #";then"
|
||||
0 0 24 29 1 #"\n"
|
||||
0 0 24 3 9 #" "
|
||||
0 0 14 3 1 #"x"
|
||||
0 0 24 29 1 #"\n"
|
||||
0 0 24 3 9 #" "
|
||||
0 0 17 3 5 #";else"
|
||||
0 0 24 29 1 #"\n"
|
||||
0 0 24 3 10 #" ("
|
||||
0 0 14 3 6 #"append"
|
||||
0 0 24 3 2 #" ("
|
||||
0 0 14 3 3 #"rev"
|
||||
0 0 24 3 2 #" ("
|
||||
0 0 14 3 4 #"rest"
|
||||
0 0 24 3 1 #" "
|
||||
0 0 14 3 1 #"x"
|
||||
0 0 24 3 2 #"))"
|
||||
0 0 24 29 1 #"\n"
|
||||
0 0 24 3 10 #" ("
|
||||
0 0 14 3 2 #"if"
|
||||
0 0 24 3 2 #" ("
|
||||
0 0 14 3 5 #"list?"
|
||||
0 0 24 3 2 #" ("
|
||||
0 0 14 3 5 #"first"
|
||||
0 0 24 3 1 #" "
|
||||
0 0 14 3 1 #"x"
|
||||
0 0 24 3 2 #"))"
|
||||
0 0 24 29 1 #"\n"
|
||||
0 0 24 3 13 #" "
|
||||
0 0 17 3 5 #";then"
|
||||
0 0 24 29 1 #"\n"
|
||||
0 0 24 3 14 #" ("
|
||||
0 0 14 3 5 #"first"
|
||||
0 0 24 3 1 #" "
|
||||
0 0 14 3 1 #"x"
|
||||
0 0 24 3 1 #")"
|
||||
0 0 24 29 1 #"\n"
|
||||
0 0 24 3 13 #" "
|
||||
0 0 17 3 5 #";else"
|
||||
0 0 24 29 1 #"\n"
|
||||
0 0 24 3 14 #" ("
|
||||
0 0 14 3 4 #"list"
|
||||
0 0 24 3 2 #" ("
|
||||
0 0 14 3 5 #"first"
|
||||
0 0 24 3 1 #" "
|
||||
0 0 14 3 1 #"x"
|
||||
0 0 24 3 2 #"))"
|
||||
0 0 24 29 1 #"\n"
|
||||
0 0 24 3 20 #" )"
|
||||
0 0 24 29 1 #"\n"
|
||||
0 0 24 3 11 #" )"
|
||||
0 0 24 29 1 #"\n"
|
||||
0 0 24 3 7 #" )"
|
||||
0 0 24 29 1 #"\n"
|
||||
0 0 24 3 5 #" "
|
||||
0 0 17 3 5 #";else"
|
||||
0 0 24 29 1 #"\n"
|
||||
0 0 24 3 5 #" "
|
||||
0 0 14 3 1 #"x"
|
||||
0 0 24 3 1 #")"
|
||||
0 0 24 29 1 #"\n"
|
||||
0 0 24 3 2 #" )"
|
||||
0 0 24 29 1 #"\n"
|
||||
0 0 24 29 1 #"\n"
|
||||
0 0 17 3 10 #";displayln"
|
||||
0 0 17 3 23
|
||||
(6
|
||||
#" \"\320\237\321\200\320\276\320\262\320"
|
||||
#"\265\321\200\320\272\320\260 rev\""
|
||||
) 0 0 24 29 1 #"\n"
|
||||
0 0 24 3 1 #"("
|
||||
0 0 14 3 3 #"rev"
|
||||
0 0 24 3 2 #" ("
|
||||
0 0 14 3 4 #"list"
|
||||
0 0 24 3 1 #" "
|
||||
0 0 21 3 1 #"1"
|
||||
0 0 24 3 1 #" "
|
||||
0 0 21 3 1 #"2"
|
||||
0 0 24 3 1 #" "
|
||||
0 0 21 3 1 #"3"
|
||||
0 0 24 3 2 #"))"
|
||||
0 0 24 29 1 #"\n"
|
||||
0 0 17 3 10 #";displayln"
|
||||
0 0 17 3 20 #" \"rev(append l1 l2)\""
|
||||
0 0 24 29 1 #"\n"
|
||||
0 0 17 3 2 #";("
|
||||
0 0 17 3 3 #"rev"
|
||||
0 0 17 3 2 #" ("
|
||||
0 0 17 3 6 #"append"
|
||||
0 0 17 3 2 #" ("
|
||||
0 0 17 3 4 #"list"
|
||||
0 0 17 3 1 #" "
|
||||
0 0 17 3 1 #"1"
|
||||
0 0 17 3 1 #" "
|
||||
0 0 17 3 1 #"2"
|
||||
0 0 17 3 1 #" "
|
||||
0 0 17 3 1 #"3"
|
||||
0 0 17 3 3 #") ("
|
||||
0 0 17 3 4 #"list"
|
||||
0 0 17 3 1 #" "
|
||||
0 0 17 3 1 #"0"
|
||||
0 0 17 3 1 #" "
|
||||
0 0 17 3 1 #"4"
|
||||
0 0 17 3 1 #" "
|
||||
0 0 17 3 5 #"5 )))"
|
||||
0 0 24 29 1 #"\n"
|
||||
0 0 17 3 10 #";displayln"
|
||||
0 0 17 3 27 #" \"append (rev l2) (rev l2)\""
|
||||
0 0 24 29 1 #"\n"
|
||||
0 0 17 3 1 #";"
|
||||
0 0 17 3 1 #"("
|
||||
0 0 17 3 6 #"append"
|
||||
0 0 17 3 2 #" ("
|
||||
0 0 17 3 3 #"rev"
|
||||
0 0 17 3 2 #" ("
|
||||
0 0 17 3 4 #"list"
|
||||
0 0 17 3 1 #" "
|
||||
0 0 17 3 1 #"0"
|
||||
0 0 17 3 1 #" "
|
||||
0 0 17 3 1 #"4"
|
||||
0 0 17 3 1 #" "
|
||||
0 0 17 3 1 #"5"
|
||||
0 0 17 3 5 #" )) ("
|
||||
0 0 17 3 3 #"rev"
|
||||
0 0 17 3 1 #"("
|
||||
0 0 17 3 4 #"list"
|
||||
0 0 17 3 1 #" "
|
||||
0 0 17 3 1 #"1"
|
||||
0 0 17 3 1 #" "
|
||||
0 0 17 3 1 #"2"
|
||||
0 0 17 3 1 #" "
|
||||
0 0 17 3 4 #"3)))"
|
||||
0 0
|
||||
8
Яндринский Влад/NOD.rkt
Normal file
8
Яндринский Влад/NOD.rkt
Normal file
@@ -0,0 +1,8 @@
|
||||
(define (gcd x y)
|
||||
(if (= y 0)
|
||||
x
|
||||
(gcd y (modulo x y))
|
||||
)
|
||||
)
|
||||
|
||||
(writeln (gcd 999 33))
|
||||
6
Яндринский Влад/README.md
Normal file
6
Яндринский Влад/README.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# Вычисление НОД
|
||||
## Ссылка на видеоразбор
|
||||
https://youtu.be/8ulDLp5TqL0
|
||||
## Код из книги
|
||||
#let rec gcd x y =
|
||||
if y = 0 then x else gcd y (x mod y);;
|
||||
Reference in New Issue
Block a user