Skip to content

Instantly share code, notes, and snippets.

View Krimsit's full-sized avatar
🎯
Focusing

Andrey Subbotin Krimsit

🎯
Focusing
View GitHub Profile
@Krimsit
Krimsit / meteo.js
Last active November 16, 2017 12:40
var ir = require("@amperka/ir-receiver").connect(P0);
var led = require("@amperka/led").connect(P2);
var light = require("@amperka/light-sensor").connect(A3);
var temp = require("@amperka/thermometer").connect(A5);
var nrm_t = 24;
var now_t = temp.read("C").toFixed(3);
var nrm_l = 350;
var ir = require("@amperka/ir-receiver").connect(P0);
var led = require("@amperka/led").connect(P2);
var opers = {
antimulti: {
str: "3fe8977",
value: "/"
},multi: {
str: "3ff8877",
value: "*"
@Krimsit
Krimsit / random.js
Last active November 16, 2017 12:11
var buz = require('@amperka/buzzer').connect(P5);
var led = require('@amperka/led').connect(P2);
var button = require('@amperka/button').connect(P8);
function getRand(){
return Math.round(Math.random());
}
function TO(f, t){
setTimeout(function(){
@Krimsit
Krimsit / pot.js
Last active November 16, 2017 12:39
var buz = require('@amperka/buzzer').connect(P5);
var button = require('@amperka/button').connect(P8);
var pot = require("@amperka/pot").connect(A0);
var ir = require("@amperka/ir-receiver").connect(P0);
function ReadVal(){
var val = pot.read();
var val1 = Math.floor(val * 10000);
console.log(val1);
@Krimsit
Krimsit / marsh.js
Last active November 16, 2017 12:08
var buz = require('@amperka/buzzer').connect(P5);
var ir = require("@amperka/ir-receiver").connect(P0);
//var button = require('@amperka/button').connect(P1);
//var pot = require("@amperka/pot").connect(A1);
var arr = [
392, 392, 392, 311, 466, 392, 311, 466, 392,
587, 587, 587, 622, 466, 369, 311, 466, 392,
784, 392, 392, 784, 739, 698, 659, 622, 659,
415, 554, 523, 493, 466, 440, 466, 311, 369,
@Krimsit
Krimsit / Lamp.js
Last active November 16, 2017 18:33
var led = require("@amperka/led").connect(P5);
var ir = require("@amperka/ir-receiver").connect(P2);
ir.on("receive", function(code, repeat){
console.log(code.toString(16));
if(code.toString(16) == "3fcc33f"){
led.toggle();
}
else{
console.log("Error, fubction is not found!");
@Krimsit
Krimsit / Algoritm
Last active November 16, 2021 20:59
1.Алгоритм обхода в глубину - https://habrahabr.ru/post/200074/
2.Алгоритм обхода в ширину - https://habrahabr.ru/post/200252/
3.Алгоритм Дейкстры - https://habrahabr.ru/post/111361/
4.Алгоритм Флойда — Уоршелла - https://habrahabr.ru/post/105825/
5.Алгоритм Джонсона - https://ru.wikipedia.org/wiki/Алгоритм_Джонсона
6.Алгоритм Ли(волновой алгоритм) - https://ru.wikipedia.org/wiki/Алгоритм_Ли
7.Алгоритм Беллмана — Форда - https://habrahabr.ru/post/201588/
1.https://sites.google.com/site/pythontutorarticles/obhod-v-glubinu
n = 10
n = int(input())
k = int(input())
a = [x for x in range(1, n+1)]
for i in range(n):
if i == k:
del(a[i])
b = a[i]
print(b)