This file contains hidden or 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
| /* bubble sort a linked list */ | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| static struct list *scan_list(void); | |
| static void sort_list(struct list **); | |
| static void print_list(struct list *); | |
| static void free_list(struct list *); | |
| struct list { |
This file contains hidden or 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 <locale.h> | |
| /* estimate the endgame tablebase size of micro shogi */ | |
| enum { | |
| /* | |
| * number of ways to place the kings such that they don't check | |
| * each other. This assumes that the Sente king is always placed | |
| * on the right half of the board, we can cut the number of |
This file contains hidden or 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
| /*- | |
| * Copyright (c) 2014 Robert Clausecker <[email protected]> | |
| */ | |
| #define _POSIX_C_SOURCE 200809L | |
| #include <errno.h> | |
| #include <stdio.h> | |
| #include <string.h> | |
| #include <sys/stat.h> | |
| #include <fcntl.h> |
This file contains hidden or 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
| /* | |
| * Imagine a 5x5 grid. We begin coloring in some of the squares on that | |
| * grid. What is the minimum number of squares we must color in, such | |
| * that in every row, in every column, and in every 2x2 square grid, | |
| * there is at least one colored square? | |
| */ | |
| #include <stdio.h> | |
| typedef unsigned grid; |
This file contains hidden or 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
| /*- | |
| * Copyright (c) 2016 Robert Clausecker. All rights reserved. | |
| * | |
| * Redistribution and use in source and binary forms, with or without | |
| * modification, are permitted provided that the following conditions | |
| * are met: | |
| * 1. Redistributions of source code must retain the above copyright | |
| * notice, this list of conditions and the following disclaimer. | |
| * 2. Redistributions in binary form must reproduce the above copyright | |
| * notice, this list of conditions and the following disclaimer in the |
This file contains hidden or 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
| .text | |
| .globl is_eof_block | |
| .type is_eof_block,@function | |
| .align 16 | |
| is_eof_block: | |
| mov $7,%eax | |
| movups 0x00(%rdi),%xmm0 | |
| movups 0x10(%rdi),%xmm1 | |
| movups 0x20(%rdi),%xmm2 |
This file contains hidden or 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
| .text | |
| .globl is_eof_block | |
| .type is_eof_block,@function | |
| .align 16 | |
| is_eof_block: | |
| xor %eax,%eax | |
| vmovupd 0x00(%rdi),%ymm0 | |
| vmovupd 0x20(%rdi),%ymm1 | |
| vmovupd 0x40(%rdi),%ymm2 |
This file contains hidden or 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 <time.h> | |
| #include <string.h> | |
| #include <stdlib.h> | |
| #define TESTS 10000000 | |
| #ifndef MISALIGNED | |
| # define MISALIGNED 0 | |
| #endif |
This file contains hidden or 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
| .text | |
| .globl is_eof_block | |
| .type is_eof_block,@function | |
| .align 16 | |
| is_eof_block: | |
| xor %eax,%eax | |
| vmovupd 0x00(%rdi),%ymm0 | |
| vmovupd 0x20(%rdi),%ymm1 | |
| vmovupd 0x40(%rdi),%ymm2 |
This file contains hidden or 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
| /* | |
| * yesno.c - Get a yes/no answer from the user | |
| */ | |
| #define _POSIX_C_SOURCE 200809L | |
| #include <langinfo.h> | |
| #include <regex.h> | |
| #include <stdio.h> | |
| /* |