Skip to content

Instantly share code, notes, and snippets.

@jgilless
jgilless / euler1.rb
Last active August 29, 2015 14:09
Ruby solution for Project Euler problem 1
# https://projecteuler.net/problem=1
puts "Find the sum of all the multiples of 3 or 5 below which number?"
STDOUT.flush #clears the buffer
max_num = Integer(gets.chomp)
def sum_x3_x5(num)
sum = 0
(1..num).each do |n|
sum = sum + n if (n % 3 == 0) || (n % 5 == 0) #Add if n is divisible by 3 or 5
@jgilless
jgilless / autoclicker.py
Created November 13, 2014 03:59
Autoclicker for Clicker Heroes
#simplest autoclicker ever
import win32api
import win32con
import time
import sys
def click(x,y):
win32api.SetCursorPos((x,y))
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,x,y,0,0)