Skip to content

Instantly share code, notes, and snippets.

@Luomint
Luomint / FSR.glsl
Created November 12, 2022 22:16 — forked from agyild/FSR.glsl
AMD FidelityFX Super Resolution v1.0.2 for mpv
// Copyright (c) 2021 Advanced Micro Devices, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
function minimax(level, player) {
if (checkWin(player) || level === 0 || checkWin(AI)) {
score = evaluate();
return score;
}
function minimax(level, player) {
if (checkWin(player) || level === 0 || checkWin(AI)) {
score = evaluate();
return score;
}
// Tic Tac Toe with miniMax algorithm
$(document).ready(function () {
var moves;
var coords = [];
var what;
var where;
var imageUrl = "https://srichinmoy.files.wordpress.com/2013/12/cock.jpg";
@Luomint
Luomint / 28.rb
Last active September 3, 2015 22:29
28.rb
#bmi calculator
numbers = %w(91 1.80
60 1.62
48 2.00
49 1.32
90 2.37
95 2.30
94 2.29
104 2.40
@Luomint
Luomint / 3.rb
Created August 28, 2015 17:13
Not working, incorrect answers for some reason: #1, #4, #10, #13
numbers = %w(-4953066 2629785 -5777626
8415931 4699071 3832995
7424130 1554574 9291366
-2638056 8806036 -3576544
-3067030 6695809 7141481
-7202215 4497599 3429471
-1610641 -7891372 213522
-7124492 -4169781 -1367309
-8841642 1315845 7180330
-5649708 2964479 -5931762
numbers = %w(-4953066 2629785 -5777626
8415931 4699071 3832995
7424130 1554574 9291366
-2638056 8806036 -3576544
-3067030 6695809 7141481
-7202215 4497599 3429471
-1610641 -7891372 213522
-7124492 -4169781 -1367309
-8841642 1315845 7180330
@Luomint
Luomint / gist:15b0c15241fb7fbc8708
Last active August 29, 2015 14:18
Why isn't the numbe 44 converted to 2044?
class TravelAgentSession
def year=(y)
@year = y.to_i
if @year > 100
@year = @year + 2000
end
end
end
agnis = TravelAgentSession.new
@Luomint
Luomint / gist:24da23ec5980bb318c98
Last active August 29, 2015 14:18
Why doesn't this work if the first acessor is at the bottom (2 scenarios)
#This works:
class Ticket
def price #
@price # this will be moved to the bottom below on the 2nd example
end #
def price(amount)
if (amount * 100).to_i == amount * 100
@price = amount
else