Skip to content

Instantly share code, notes, and snippets.

View Nikola-Andreev's full-sized avatar

Nikola Andreev Nikola-Andreev

  • Sofia, Bulgaria
View GitHub Profile
using System;
public class Program
{
public static void Main()
{
int num = int.Parse(Console.ReadLine());
int stars;
int loop;
if (num % 2 == 0)
function solve() {
let bugs = []
let id = 0
function update() {
let element = $('#content')
element.empty()
for (let i = 0; i < bugs.length; i++) {
let a = $(`<div id="report_${bugs[i].ID}" class="report">`)
let b = $(`<div class="body">`)
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
namespace Praktice
{
class Program
{
static void Main(string[] args)
{
function result() {
let arr = []
return {
add:function (element) {
arr.push(element)
this.size++
return arr.sort((a,b) =>{
return a - b
})
},
(function () {
String.prototype.isEmpty = function () {
return this == ''
}
String.prototype.ensureStart = function (str) {
if(this.startsWith(str)){
return this.toString()
} else {
function result() {
let myObj = {}
myObj.extend = function (template) {
for (let a in template) {
if( typeof template[a] == 'function'){
Object.getPrototypeOf(myObj)[a]=template[a]
} else {
myObj[a] = template[a]
}
@Nikola-Andreev
Nikola-Andreev / Js Advanced functions
Created October 24, 2016 09:56
07-Monkey patcher solved
function solve(a) {
let obj = this
let processor = (function() {
function upvote() {
obj.upvotes++
}
function downvote() {
obj.downvotes++
function solve(a,b) {
let processor = (function() {
function upvote(a) {
a.upvotes++
}
function downvote(a) {
a.downvotes++
@Nikola-Andreev
Nikola-Andreev / JS Advanced
Created October 22, 2016 11:56
06.Breckfast robot
let s = (function() {
let obj = {
protein: 0,
carbohydrate: 0,
fat: 0,
flavour: 0
}
return function solve(input) {
@Nikola-Andreev
Nikola-Andreev / 07.Monkey Patcher
Created October 22, 2016 09:11
JS Advanced Functions - Exercices
let r = (function () {
let post
return function solve(obj,command) {
if(post == null){
post = obj
if(command == 'upvote'){