Skip to content

Instantly share code, notes, and snippets.

View a1ip's full-sized avatar
🎯
Focusing

Philippe Rigovanov a1ip

🎯
Focusing
View GitHub Profile
@a1ip
a1ip / 00-CodeCombat-Old-Beginner-Campaign.md
Last active August 18, 2018 19:34
CodeCombat Old Beginner Campaign solutions http://codecombat.com/play-old
@a1ip
a1ip / 00-CodeCombatRandom-Harder-Levels.md
Last active August 18, 2018 19:36
CodeCombat Random Harder Levels solutions http://codecombat.com/play-old
@a1ip
a1ip / 00-CodeCombatPlayer-Created-Levels.md
Last active August 18, 2018 19:37
CodeCombat Player-Created Levels solutions http://codecombat.com/play-old
@a1ip
a1ip / Content.md
Created June 25, 2014 10:25
Russian translation of "Javascript Method Arguments" article http://codecombat.com/editor/article/javascript-method-arguments

Методы перешли на следующий уровень.

Методы теперь могут принимать аргументы, которые говорят методу как ему выполнять свое действие. Здесь "Hello!" это то что говорит метод say(). (Кавычки нужны потому что это строка текста, а текстовые строки обязательно нужно заключать в кавычки. Просто так надо.)

Если аргументов несколько, то их нужно разделять запятыми. В методе move(5, 6);, 5 - это первый аргумент (координата x), а 6 - второй аргумент (координата y). (Числа используются без кавычек.)

var coin, firstMineIndex, lastMineIndex, pr;
this.detonate = function(i) {
return this.say("Detonate " + i, [i]);
};
firstMineIndex = 2;
lastMineIndex = 120;
@a1ip
a1ip / index.html
Last active February 12, 2022 07:40
А. ШЕНЬ. ПРОГРАММИРОВАНИЕ. Теоремы и задачи
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>А. ШЕНЬ. ПРОГРАММИРОВАНИЕ. Теоремы и задачи</title>
</head>
<body>
<div>
<h2>А. ШЕНЬ</h2>
<h1>ПРОГРАММИРОВАНИЕ</h1>
<h1>теоремы и задачи</h1>
@a1ip
a1ip / eloquentjavascript-03.00.litcoffee
Created July 11, 2014 14:15
Filename with two dots

http://eloquentjavascript.net/2nd_edition/preview/03_functions.html
Consider this puzzle: by starting from the number 1 and repeatedly either adding 5 or multiplying by 3, an infinite amount of new numbers can be produced. How would you write a function that, given a number, tries to find a sequence of such additions and multiplications that produce that number? For example, the number 13 could be reached by first multiplying by 3 and then adding 5 twice, whereas the number 15 cannot be reached at all.

Here is a recursive CoffeeScript solution:

findSolution = (target) ->
  find = (start, history) ->
    if start is target
      history
    else if start > target
@a1ip
a1ip / eloquentjavascript-03-00.litcoffee
Created July 11, 2014 14:17
Filename with one dot

http://eloquentjavascript.net/2nd_edition/preview/03_functions.html
Consider this puzzle: by starting from the number 1 and repeatedly either adding 5 or multiplying by 3, an infinite amount of new numbers can be produced. How would you write a function that, given a number, tries to find a sequence of such additions and multiplications that produce that number? For example, the number 13 could be reached by first multiplying by 3 and then adding 5 twice, whereas the number 15 cannot be reached at all.

Here is a recursive CoffeeScript solution:

findSolution = (target) ->
  find = (start, history) ->
    if start is target
      history
    else if start > target
@a1ip
a1ip / chronological.md
Last active January 8, 2026 18:20
БИБЛИЯ ЗА ГОД. План чтения Библии в хронологическом порядке https://git.io/-rzaIQ

БИБЛИЯ ЗА ГОД. Чтение Библии в хронологическом порядке

ЯНВАРЬ

1 Быт. 1, 2, 3
2 Быт. 4, 5, 6, 7
3 Быт. 8, 9, 10, 11
4 Иов 1, 2, 3, 4, 5
5 Иов 6, 7, 8, 9

@a1ip
a1ip / chronological.json
Last active August 29, 2015 14:04
БИБЛИЯ ЗА ГОД. План чтения Библии в хронологическом порядке
{
"plan": [
{
"month": "ЯНВАРЬ",
"days": [
{
"day": "1",
"reading": "Быт. 1, 2, 3"
},
{