This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
$(window).on('scroll',function(e){ | |
parallax(); | |
}); | |
$('a.earth,a.moon,a.saturn,a.rocket').on('click', function(e){ | |
e.preventDefault(); | |
var th = $(this), | |
target = $(this).attr('href'), | |
next_pos = $(target).offset().top, | |
current_pos = $(window).scrollTop(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function numberInLetters(number) { | |
var separator = hyphen = conjunction = ' و '; | |
var negative = 'منفی '; | |
var decimal = ' ممیز '; | |
var dictionary = { | |
0: 'صفر', | |
1: 'یک', | |
2: 'دو', | |
3: 'سه', | |
4: 'چهار', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function numberInLetters($number) { | |
$separator = $hyphen = $conjunction = ' و '; | |
$negative = 'منفی '; | |
$decimal = ' ممیز '; | |
$dictionary = array( | |
0 => 'صفر', | |
1 => 'یک', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Monty Hall Problem Simulation | |
function montyHallSimulation(iterations = 10000, numDoors = 3) { | |
let switchWinCount = 0; // Wins when switching choice | |
let stayWinCount = 0; // Wins when staying with initial choice | |
for ( | |
let currentIteration = 0; | |
currentIteration < iterations; | |
currentIteration++ | |
) { |