Skip to content

Instantly share code, notes, and snippets.

View Eugleo's full-sized avatar

Evžen Wybitul Eugleo

View GitHub Profile
public class LoopTest {
public static void main(String[] argv) {
int START = 2000000000;
int count = 0;
for (float f = START; f < START + 50; f++) {
count++;
}
System.out.println(count); // 0. Proč?
}
}
@Eugleo
Eugleo / fill.hs
Last active April 17, 2019 13:08
-- Seq {aa :: String, gaps :: [(Int, Int)]}
fill' :: Int -> Seq -> String
fill' n Seq {aa = aa, gaps = gaps} = go (sortOn fst gaps) (zip [1 ..] aa) n
where
go :: [(Int, Int)] -> [(Int, Char)] -> Int -> String
go _ [] l = replicate l '-'
go [] str l = map snd str ++ replicate l '-'
go gps@((start, leng):gs) ((i, c):xs) l
| start <= i = replicateAppend leng '-' (c : go gs xs (l - leng - 1))
| otherwise = c : go gps xs (l - 1)
@Eugleo
Eugleo / perfetto.pas
Last active January 1, 2019 00:25
Najdi perfektní čísla, čtverce a krychle
program perfetto;
var
i, n, sum: Integer;
sqr, cube: Boolean;
begin
read(n);
sum := 1;