Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results for brachylog function
Search options not deleted
13 votes

Can this value be made with unique coins and/or notes?

Brachylog 2 (TIO Nexus), 2 bytes ⊇+ Try it online! … (A reminder, or for people who don't already know: Brachylog 2 uses its own character encoding in which ⊇ is a single byte long.) …
user avatar
8 votes

Find the smallest positive integer which ends in n, is divisible by n and whose digits sum to n

Brachylog v2, 12 10 bytes a₁.;A×?≜ẹ+ Try it online! This is a function submission that takes input via . and produces output via ? … I assume something about ẹ doesn't like unknowns, so the ≜ tells Brachylog to use a brute-force approach for that part of the program rather than algebra. …
user avatar
3 votes

Sum \$\text{Square}^2\$

Brachylog, 12 8 bytes f^₂ᵐ+~^₂ -4 bytes thanks to Fatelize cause i didn't realize brachylog has a factors functions explanation f^₂ᵐ+~^₂ # full code f # get divisors …
Kroppeb's user avatar
  • 1,733
1 vote

Implement Bogosort

Brachylog (v2), 5 bytes ≤₁|ṣ↰ Try it online! Function submission. (The TIO link uses a command-line argument that automatically wraps a function into a full program.) … recursively on it, {outputting its output} Prolog (the language that Brachylog compiles into) is tail-recursive, so this function ends up being compiled into a tight loop. …
7 votes

All ASCII characters with a given bit count

Brachylog, 7 bytes ∈Ṭ&ạhḃ+ Try it online! A predicate which functions as a generator, takes input through its output variable, and produces each character through its input variable. … Because Brachylog. …
Unrelated String's user avatar
14 votes
Accepted

How long is my number?

This should work in both Brachylog 1 and Brachylog 2. … This is a function submission (the TIO link contains a command-line argument that causes the interpreter to run an individual function rather than a whole program), partly because otherwise we'd have to …
user avatar
7 votes

Find the Factorial!

Brachylog, 7 6 bytes By making a range and multiplying it -1 byte tanks to ovs having the idea to use the max() function ;1⌉⟦₁× Explanation ;1 -- If n<1, use n=1 instead (zero case) ⟦ … Brachylog, 10 9 bytes recursion ≤1|-₁↰;?× Explanation --f(n): ≤1 -- if n ≤ 1: return 1 | -- else: -₁↰ -- f(n-1) ;? …
Kroppeb's user avatar
  • 1,733
1 vote

Excessive Integers

Brachylog, 11 bytes $p@b:la:-a+ Try it online! Verify all testcases. (The wrapper is longer than the function...) …
Leaky Nun's user avatar
  • 50.1k
1 vote

Display Peter's keyboard pattern

Brachylog, 26 bytes Ị↺,Ạ,".,?!"ụḍ₄{i↔ⁱ⁾}ᶠcs₃ẉ⊥ Try it online! Essentially a translation of my Jelly answer. A full program which prints the desired output with a trailing newline. … If a trailing newline is unacceptable: Brachylog, 27 bytes Ị↺,Ạ,".,?!"ụḍ₄{i↔ⁱ⁾}ᶠcs₃ᶠ~ṇ Try it online! Outputs as a function. …
Unrelated String's user avatar
2 votes

I reverse the source code, you negate the input!

Brachylog, 2 bytes &ṅ Brachylog implicitly inputs from the left and outputs from the right. & ignores anything to the left and passes the input to the function rightwards. ṅ constrains each side of …
IFcoltransG's user avatar
10 votes

Smallest Diversifying Exponent

Brachylog (v2), 9 bytes ;.≜^dl10∧ Try it online! This is a function submission. The TIO link contains a wrapper that makes a function into a full program. Explanation ;. …
2 votes

Heterograms, Palindromes, oh my!

Brachylog, 3 bytes, language postdates challenge DdD Try it online! This is one of the very few programs that works in both Brachylog 1 and Brachylog 2. … The TIO link is to Brachylog 1 for old times' sake. Also unsually for Brachylog, this is a full program, not a function. …
user avatar
3 votes

Longest Common Subsequence of Two Strings containing a particular Substring

Brachylog, 12 bytes, language postdates challenge k⊇ᵐ=h.s~t?∨0 Try it online! This is a function. The TIO link uses a command-line argument that allows functions to be run like full programs. …
user avatar
4 votes

I double the source, you double the output!

Brachylog, 8 bytes w₆-₇ℕ~l" Try it online! Try it online!Try it online! … Although Brachylog has implicit function output, full programs won't automatically print without being given arguments, making this challenge a bit more interesting. …
Unrelated String's user avatar
5 votes

Make a number palindrome

Brachylog 2, 8 bytes, language postdates challenge ẹ;AcB↔Bc Try it online! … The question asks for a function, so I provided one; the TIO link takes an argument that runs a function like a full program. …
user avatar

1
2 3 4 5 6
15 30 50 per page