This file contains hidden or 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.Cannonballs | |
| # | |
| # A new kind of cannon is being tested. The cannon shoots cannonballs in a fixed direction. Each cannonball flies horizontally until it hits the ground, and then it rests there. Cannonballs are shot from different heights, so they hit the ground at different points. | |
| # You are given two zero-indexed arrays, A and B, containing M and N integers respectively. Array A describes the landscape in the direction along which the cannon is shooting. Elements of array A represent the height of the ground, going from the cannon outwards. Array B contains levels from which consecutive cannonballs are shot. | |
| # Assume that a cannonball is shot at level H. | |
| # Let I be the smallest index, such that 0 < I < M and A[I] ≥ H. The cannonball falls at position I − 1 and increases the ground level A[I−1] by 1. | |
| # If there is no such I, and H > A[I] for all 0 ≤ I < M, then the cannonball flies beyond the horizon and has no effect on the result. | |
| # If H ≤ A[0], then the cannonball ricochets away and has no effect on the |
This file contains hidden or 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
| /usr/bin/jackd -P1 -dalsa -dhw:0 -r44100 -p1024 -n2 psuspender --jackd |
This file contains hidden or 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
| //Enter OpenSCAD code here. | |
| module 200_balka(){ | |
| translate ([0, 0, 10])cube([10, 10, 200]); | |
| } | |
| module 125_balka(){ | |
| rotate([90, 0, 90]) cube([10, 10, 125]); | |
| } | |
| module 240_balka(){ |
This file contains hidden or 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
| // inner-pad.scad | |
| //lad-cube.scad | |
| module one-romb() { | |
| scale ([1, 0.7, 1]) rotate ([45, 0, 0]) cube([30, 1, 1], center=true); | |
| } | |
| //lad-rombs.scad | |
| module lad-rombs() { | |
| for(i= [1 : 30]){ | |
| translate ([0, i - (i * 0.3), 0]) one-romb(); |
This file contains hidden or 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
| module one-romb() { | |
| scale ([1, 0.7, 1]) rotate ([45, 0, 0]) cube([30, 1, 1], center=true); | |
| } | |
| //lad-rombs.scad | |
| module lad-rombs() { | |
| for(i= [1 : 30]){ | |
| union(){translate ([0, i - (i * 0.3), 0]) one-romb();} | |
| } | |
| } |
This file contains hidden or 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
| //vneshnii kontur | |
| CIRCLE_R =8.25; | |
| SQUARE_H = 14; | |
| SQUARE_W = 16.5; | |
| l=8; | |
| LENGTH = 21.5; | |
| TRANSLATE_Y = LENGTH - CIRCLE_R - SQUARE_H * 0.5; | |
| module vneshnii_pad(){ |
This file contains hidden or 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
| module romb() { | |
| scale ([1, 1, 1]) rotate ([20, 0, 0]) cube([5, 3, 1], center=true); | |
| } | |
| //diamond_rombs.scad | |
| module diamond(){ | |
| rotate ([0, 0, -45]) { | |
| for(i= [0 : 3]){ | |
| union(){ translate ([0, i - (i * 0.3), 0]) scale ([1, 1.2, 0.6]) romb();} |
This file contains hidden or 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
| //upper-cube.scad | |
| INCL = 3.2; // inner cube length | |
| INCW = 2; // inner cube width | |
| INCH = 2; // inner cube height | |
| THIKNESS = 0.9; | |
| OCL = INCL + THIKNESS * 2 ; // outer cube length |
This file contains hidden or 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
| //stavka.scad | |
| module stavka() { | |
| difference (){ | |
| translate ([0, 0, -10]) cube ([20, 20, 20], center=true); | |
| union (){ | |
| for (rot = [[0, 90, 0], [90, 0, 0], [0, 0, 90]]){ rotate(rot) cylinder(r= 6.5, h=50, fa = 20, center = true);} | |
| } | |
| } | |
| } |
This file contains hidden or 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
| ;fnkon' | |
| (define (filter f l) | |
| (if (null? l) '() | |
| (let ((x (car l)) | |
| (r (filter f (cdr l)))) | |
| (if (f x) (cons x r) r)))) | |
| (define (map f l) | |
| (letrec ((result (cons '() '())) | |
| (helper (lambda (p l) |