Skip to content

Instantly share code, notes, and snippets.

View ruslan-avantis's full-sized avatar
🏠
Работать из дома

Ruslan Avantis ruslan-avantis

🏠
Работать из дома
View GitHub Profile
@ruslan-avantis
ruslan-avantis / promiseArray.js
Last active June 2, 2023 10:13
Example of working with arrays
const Promise = require('bluebird')
const items = {
employers: [
{
name: 'qqqq',
cost: 1111,
},
{
name: 'weferf',
@ruslan-avantis
ruslan-avantis / getChessPosition.js
Last active September 18, 2021 18:53
Useful functions for chess
const getChessPosition = (v = [0,0]) => {
const o = {'a':0,'b':1,'c':2,'d':3,'e':4,'f':5,'g':6,'h':7}
return [Number(o[v[0]]), (Number(v[1]) - 1)]
}
/** Chess board
* let chessBoard = [
* ["a8","b8","c8","d8","e8","f8","g8","h8"],
* ["a7","b7","c7","d7","e7","f7","g7","h7"],
* ["a6","b6","c6","d6","e6","f6","g6","h6"],