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
#Build ins | |
bindsym Mod4+Shift+c reload | |
bindsym Mod4+Shift+r restart | |
#Modes | |
mode "resize" { | |
bindsym h resize shrink width 5 px | |
bindsym j resize grow height 5 px |
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
r=replicate;main=(\x->mapM_ putStrLn[r(x-l)' '++r(l+l-1)'*'|l<-[1..x]++[1]])=<<(readLn::IO Int) |
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
isPrime :: Int -> Bool | |
isPrime u | |
| u < 2 = False | |
| u == 2 = True | |
| otherwise = not $ maximum [ mod u x == 0 | x <- [2..s]] where s = u - 1 | |
main = do y <- readLn :: IO Int | |
mapM_ print $ filter (\x -> mod y x == 0 && isPrime x) [1..y] |
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
#include <stdio.h> | |
#include <string.h> | |
#include <stdbool.h> | |
unsigned t(char a){ | |
return (unsigned)(a-48); | |
} | |
int main(void){ | |
char d[13]; |
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
main(int i) {for(i =7; | |
i--; printf( "_____ " )) | |
;puts (""); for( i=7;i | |
--; printf( "%c%s%c " , | |
i>2| i&1?'|' :' ', i==6? | |
" | " :i==1| i==4 ?" " | |
:"___" ,i>3 ?(i& 1?' ' | |
:'|') :i&1? ' ': '/')); | |
puts( ""); for(i =7;i | |
--; printf("%c%s " ,i> |
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
import sys | |
import random | |
coin = 't' | |
texts = {"t": "tail", "h": "head"} | |
def start(): | |
while True: | |
toss = random.randint(0,1) | |
guessed = raw_input("Choose [h]ead or [t]ail or [q]uit: ") |
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
#include <stdio.h> | |
char * pSource; | |
int bDone; | |
int bOpMatched; | |
int iNestDepth; | |
int iNumber; | |
extern int atoi(); |
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
;;Guess my number REPL game | |
(defun guess-my-number () | |
(ash (+ *small* *big*) -1) | |
) | |
(defun smaller () | |
(setf *big* (1- (guess-my-number))) ;(1+ x) is same us (+ 1 x) | |
(guess-my-number) | |
) |
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
Size = ARGV.first.to_i | |
doors = Array.new(Size, false) | |
(1..Size).each do |pass| | |
(0...Size).each do |pos| | |
doors[pos] = !doors[pos] if (pos+1) % pass == 0 | |
end | |
end | |
doors.each_with_index {|val, pos| puts pos+1 if val} |
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
D[]={1593024318,64462,1343508809,49681,1214537545,45313,1149521993,34961,1593019977,64463,0},*d=D,c;main(){while(*d){while(*d>1)printf("%c",*d%2?42:32),*d/=2;++c%2?:puts(""),d++;}return 0;} |
OlderNewer