as main.s -o main.o
ld main.o -o main
./main
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
| const N: usize = 10000; | |
| fn main() { | |
| let mut antiprimes = vec![]; | |
| let mut max_number = 0; | |
| let mut divisors = vec![0; N]; | |
| for i in 1..=N { | |
| for j in ((i - 1)..N).step_by(i) { | |
| divisors[j] += 1; |
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
| (defun initial-divisors (n) | |
| (let ((i 0) | |
| (lst '())) | |
| (while (> n i) | |
| (push 0 lst) | |
| (incf i)) | |
| lst)) | |
| (initial-divisors 10) |
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) 2020 The ZMK Contributors | |
| * Copyright (c) 2023 Innaworks Development Limited, trading as MoErgo | |
| * | |
| * SPDX-License-Identifier: MIT | |
| */ | |
| /* THIS FILE WAS GENERATED BY GLOVE80 LAYOUT EDITOR |
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
| :- use_module(library(pio)). | |
| :- use_module(library(dcgs)). | |
| :- use_module(library(charsio)). | |
| :- use_module(library(reif)). | |
| :- use_module(library(dif)). | |
| :- use_module(library(lists)). | |
| lines([]) --> []. | |
| lines([X|Xs]) --> | |
| line(X), |
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
| :- use_module(library(format)). | |
| :- use_module(library(lists)). | |
| :- use_module(library(pio)). | |
| :- initialization(run). | |
| run :- | |
| phrase_from_file(state(was_space, 1, 0, 0, Lines, Words, Chars), "quijote.txt"), | |
| format("~d ~d ~d~n", [Lines, Words, Chars]), | |
| halt. |
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
| :- use_module(library(clpz)). | |
| :- use_module(library(lists)). | |
| :- use_module(library(format)). | |
| cols(6). | |
| rows(6). | |
| board([ | |
| c,c,2,c,3,c, | |
| 2,c,c,c,c,c, | |
| c,c,2,4,c,3, |
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
| default: | |
| gcc -o fib fib.s -static | |
| clean: | |
| rm -rf fib |
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
| .data | |
| fibs: .quad 0,0,0,0,0,0,0,0,0,0,0,0 | |
| size: .quad 12 | |
| printf_str: .asciz "%d\n" | |
| head: .ascii "The Fibonacci numbers are:\n" | |
| head_len = . - head | |
| .text | |
| .global main | |
| main: |
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
| :- use_module(library(lists)). | |
| :- use_module(library(random)). | |
| :- use_module(library(tabling)). | |
| :- table move/2. | |
| run(N) :- | |
| generate_random(N, State), | |
| solve(State, History), | |
| maplist(display_state, History). |
NewerOlder