text
stringlengths
180
608k
[Question] [ **This question already has answers here**: [Josephus problem (counting out)](/questions/5891/josephus-problem-counting-out) (31 answers) Closed 9 years ago. Here's a challenge inspired by Programming Praxis: <http://programmingpraxis.com/2009/02/19/flavius-josephus/> > > Write a function josephus(n,m) that returns a list of n people, > numbered from 0 to n-1, in the order in which they are executed, every > mth person in turn, with the sole survivor as the last person in the > list. > > > Example output: > > josephus(41,3) > > > 2 5 8 11 14 17 20 23 26 29 32 35 38 0 4 9 13 18 22 27 31 36 40 6 12 19 25 33 39 7 16 28 37 10 24 1 21 3 34 15 30 > > > The function can't leak on the global scope, and must return a list or an array. If your language can't return an array, it is allowed to just print the list. Shortest answer (in bytes) wins. [Answer] **Python 2 (85 Bytes):** Thanks to bitpwner we have this solution: ``` def j(m,n): a,b,c=range(m),0,[] while a:b=(b+n-1)%len(a);c+=[a.pop(b)] return c ``` To use this in Python 3 you have to cast `a` to a list, this comes with the cost of another 6 bytes. **Python 3 (114 bytes):** This was my first thought, but I think this is a good but no perfect solution: ``` def j(m,n): a,b=__import__("collections").deque(range(m)),[] while a:a.rotate(-n);b.append(a.pop()) return b ``` I was not happy with the use of the deque, but I couldn't think of any other solution. At least I could save 5 bytes with `__import__`. This function works as described above, `a` are the people and `b` is the execution order. As long as there are still people left (`while a:`), it rotates the deque/the people by `n` and appends the current man (`a.pop()`) to the execution list. [Answer] # [><>](http://esolangs.org/wiki/Fish) - 46 Really wanted to ><> a shot on this one, but unfortunately ><> has no concept of returning an array, so I simply printed it instead. ``` |v-1& ->: ?!\:1 >?!;ao>&:&\ ^ln~\ 1)?!/$}1- >: ``` Explanation: `|v-1&` loads the second argument into the register and subtracts 1 from the first argument `->: ?!\:1` unrolls the second argument so the stack has every value between it and 0 (so 5 becomes 5, 4, 3, 2, 1, 0) `>?!;ao>&:&\ ^ln~\` has two distinct parts. `&:&\` clones the value in the register onto the top of the stack, and the rest simply prints the top value on the stack, and ends the program if there's nothing left. `)?!/$}1- >:` rotates the whole stack as many times as the top value, which is what we copied from the register earlier. [Answer] ## Haskell, 79 ~~83~~ characters I still think mutable state could triumph if this is reopened, but recursion holds its own for now. Edit: Following proud haskeller's suggestions shaves off another 4 characters. ``` j n m=f[0..n-1][]1where f[]k _=k;f(a:b)k t|m==t=f b(k++[a])1|0<1=f(b++[a])k$t+1 ``` Pre-suggestions: ``` j n m=f[][0..n-1]$1 where f k[]_=k;f k(a:b)t|m==t=f(k++[a])b 1|0<1=f k(b++[a])(t+1) ``` ### Haskell, 111 characters First attempt: ``` j n m=reverse.snd.foldl f(0,[]).take(n*n).cycle$[0..n-1]where f a@(t,d)x|x`elem`d=a|t+1==m=(0,x:d)|True=(t+1,d) ``` [Answer] ## Perl - 94 Bytes ``` sub j{my$a=pop;my@c=((my$i=0)..pop()-1);while(@c){push@_,splice(@c,$i=($i+$a-1)%@c,1)}return@_} ``` [Answer] # Python 2, 96 95 bytes Since the obvious way to do it in Python was already taken, I had to do it recursively. :) ``` r=range x=lambda o,l,m:l and x(o+l[:1],l[m:]+l[1:m],m)or o j=lambda n,m:x([],r(m-1,n)+r(m-1),m) ``` [Answer] # Matlab (90) ``` function l=j(n,m) a=0:n-1;l=[];j=m;for i=a;l=[l,a(j)];a(j)=[];j=mod(j+m-2,length(a))+1;end ``` ]
[Question] [ Since I want to celebrate this definitely not nerdy event, your job is to calculate the piversary (pi-anniversary) of a given date. ### Input Your code has to have a possibilty to input a date in the format `DD/MM/YYYY`. You can expect, that the input is valid and the year is `0000<YYYY<9996`. ### Output You have to release two dates, the date in Pi months and the date in Pi years. ### Rules * If your language hasn't a build in Pi, you have to make a variable which will be exact enough to calculate the dates, but it is not allowed to calculate the days separately and use fix numbers. * You have to take care, that the months have different amount of days, but you don't have to care about leap years (only if you want). * If you calculate the date, you have to add the three years/months first and then the left part in rounded days. * Your code has to accept **any** valid date and should be able to handle edge cases like `30/12/2000` Example: ``` Input: 12/04/2010 Calculate monthly piversary: date + 3 months = 12/07/2010 date + (31*(Pi-3)) = date + 4.39 = date + 4 = 16/07/2010 //31 because July has 31 days Calculate yearly piversary: date + 3 years = 12/04/2013 date + (365*(Pi-3)) = date + 52 = 03/06/2013 Output: 16/07/2010,03/06/2013 ``` **May the shortest code win.** [Answer] ## Mathematica, ~~152~~ 134 bytes ``` f[i_]:=DateList@{i,{d="Day",m="Month",y="Year"}}~DatePlus~{{3,#},{Round[#2*(Pi-3.)],d}}~DateString~{d,"/",m,"/",y}&@@@{{m,31},{y,365}} ``` Ungolfed ``` f[i_] := DateString[ DatePlus[ DateList@{i,{d="Day",m="Month",y="Year"}}, {{3, #}, {Round[#2*(Pi - 3.)], d}} ], {d, "/", m, "/", y} ] & @@@ {{m, 31}, {y, 365}} ``` This does handle leap years. It's also horribly long. [Answer] # MATLAB: 141 ~~157, 169~~ ``` o='DD/mm/YY' d=datenum(x,o) f=@(s,v) datestr(addtodate(addtodate(d,3,s),(pi-3)*v,'day'),o) f('year',365) f('month',eomday(year(d),month(d))) ``` Quite long and straightforward. It assumes the input to be in `x`. --- Here is a version that is a few chars longer for those without the financial toolbox: ``` o='DD/mm/YY' d=datenum(x,o) [y,m]=datevec(d) f=@(s,v) datestr(addtodate(addtodate(d,3,s),(pi-3)*v,'day'),o) f('year',365) f('month',eomday(y,m)) ``` [Answer] ## Groovy - 297 chars Uses Joda Time. Does not handle leap years. Golfed: ``` @Grab(group='joda-time', module='joda-time', version='2.3') f=org.joda.time.format.DateTimeFormat.forPattern("dd/MM/yyyy") t=f.parseDateTime(args[0]) p="plusDays" m="Month" println f.print(t."plus${m}s"(3)."$p"((t."dayOf$m"().maximumValue*(Math.PI-3)) as int))+","+f.print(t.plusYears(3)."$p"(52)) ``` Sample run: ``` $ groovy Pi.groovy 12/04/2010 16/07/2010,03/06/2013 $ groovy Pi.groovy 30/12/2000 03/04/2001,20/02/2004 ``` Ungolfed: ``` @Grab(group='joda-time', module='joda-time', version='2.3') f = org.joda.time.format.DateTimeFormat.forPattern("dd/MM/yyyy") t = f.parseDateTime(args[0]) println f.print(t.plusMonths(3).plusDays((t.dayOfMonth().maximumValue*(Math.PI-3)) as int)) + "," + f.print(t.plusYears(3).plusDays(52)) ``` ]
[Question] [ Write a program which takes an integer argument and outputs the number of degree n monic polynomials with coefficients that are -1,1 or 0 which have a root which is a root of unity. To make it a little cleaner, only count polynomials with leading coefficient of 1. You can use any language you like as long as it is freely available and the interpreter/compiler is open source. You can use the standard libraries of the language you choose but no tools specifically designed to solve this problem. Your score is simply the length of your code. **Tests** > > For n = 1,2,3,4,5,6,7,8 the output should be 2,6,12,36,94, > 276,790. > > > Degree two polynomials with a root which is a root of unity. > > x^2-1,x^2-x, x^2+x, x^2-x+1, x^2+1, x^2+x+1 > > > --- There was a bug in my numbers above and so I have just copied Peter Taylor's until I find out how to fix it. [Answer] ## GolfScript (111 107 chars) ``` ~3\?:k,{2k*+3base{(}%:P,.*,{,{!}%-1+P{.,2$,>!{\[.0={*}+2$%\2$0={*}+%\]zip{{-}*}%\}*\0:x;{x|:x},.}do;,(},},, ``` Note: I disagree with some of the given test cases: I get ``` input output 1 2 2 6 3 12 4 36 5 94 6 276 7 790 8 2270 9 6412 10 18334 ``` ### Theory Every algebraic number \$a\$ over a field \$F\$ has a [minimal polynomial](http://en.wikipedia.org/wiki/Minimal_polynomial_(field_theory)) which is a factor of any polynomial \$P\$ in \$F[x]\$ for which \$P(a) = 0\$. For every integer \$n\$, the *primitive* \$n^\textrm{th}\$ roots of unity (those which are not roots of unity for any smaller \$n\$) share a minimal polynomial, the \$n^\textrm{th}\$ [cyclotomic polynomial](http://en.wikipedia.org/wiki/Cyclotomic_polynomial), whose degree is [\$\varphi(n)\$](http://en.wikipedia.org/wiki/Euler%27s_totient_function). So for input \$k\$ we can get an exact result by enumerating the possible functions and for each one looking for a non-trivial GCD with a cyclotomic polynomial of degree no greater than \$k\$. There are two ways of doing that check: either by looping over the cyclotomic polynomials (or safe products thereof - e.g. \$x^n - 1\$ rather than the \$n^\textrm{th}\$ cyclotomic polynomial), or by multiplying them together and doing one GCD. My current approach is to take a very loose bound \$N = (k+1)^2\$ on the largest number whose totient is \$k\$ and then loop over \$x^i - 1\$. This is much faster than doing a single GCD with a massive polynomial, which can get some truly enormous intermediate values in the GCD, and I've managed to golf it ever so slightly more as well. For speedier results at the cost of some characters, the bound can be improved moderately. Let \$M(n) = \max \{i : \varphi(i) = n\}\$. This has one major problem, which is that it's not well defined for odd \$n\$ greater than \$1\$ or for all even \$n\$. It also has the minor problem that it's not monotone. We need to use bound \$B(n) = \max \{i : \varphi(i) \le n\} = \max \{M(j) : j \le n\}\$. H. Gupta defines \$A(n) = n \prod\_{(p-1) \mid n} \frac{p}{p-1}\$ where \$p\$ prime and proves that \$M(n) \le A(n)\$. The bound is tight for \$n=1, 2, 8\$. Note that this is also not a monotone function: e.g. \$A(14) < A(12)\$. We can modify the definition of \$A(n)\$ to get a looser bound which is monotone. First observe that since \$2 - 1\$ divides any integer, we can say that \$A(n) = 2n \prod\_{(p-1) \mid n} \frac{p}{p-1}\$ where the \$p\$ must be *odd* primes. Then the number of multiplicands of the \$\prod\$ is bounded above by \$\log\_3 (n+1)\$, and each multiplicand is bounded above by \$\frac32\$, so we get \$A(n) \le 2^{1 - \log\_3 (n+1)} n(n+1)\$, and since this is monotone increasing for positive \$n\$ we also have \$B(n) \le 2^{1 - \log\_3 (n+1)} n(n+1)\$. This bound overestimates by a factor of about \$2.5\$ at \$n=96\$, which isn't too shabby. To use this bound, replace `.*` with `..(*2*2@3base,(?/)`. This is what I did to get the output for `n=6` and `n=7` in a reasonable amount of time. ### More efficient calculation ``` ;10,{ )..).(*2*2@3base,(?/),{ ):N,{!}%-1+ N,0-{ .N\%!{ ~${ 1$,\:Q,-),{ ;.0=\ [.0={*}+Q%]zip {{-}*}%(;\ }%\ }:^~; }{;}if }/ }/] (\{,(1$)<}, 3@?:k,{ 2k*+3base{(}%[`{\^0-!*}+1$?] }, ,p; }/ ``` prints the values for \$1\$ to \$10\$, taking about 8 minutes to get to \$8\$ and 125 minutes to get to \$10\$ on my computer. It applies the theory above more directly: it computes the actual cyclotomic polynomials (filtering to only include relevant ones), and then rather than doing GCD it suffices to do a division. Thus we replace a loop per (candidate, cyclotomic) tuple with a loop per cyclotomic, and makes the remaining division per (candidate, cyclotomic) work with smaller polynomials. It also has a quick-accept which speeds up testing for the successful candidates. I'm not sure whether it's possible to golf it to beat the GCD version, even ditching some of these optimisations. ]
[Question] [ Your job is to make a sorting algorithm. The catch, you must copy it from Stack Overflow. Your program will take an input array (or equivalency), and output a sorted permutation of the array. * Your program must consist solely of copy and pasted code blocks from Stack Overflow. * You may not take parts of a code block, nor may you rearrange one. A code block is everything within a single gray box. * The original question of the post may not have a tag, title, or question body containing the word "sort" in it. * You must cite the both the post and poster(s). * You may not use built in sorts. * The post must be older than this question. Also, here are allowed modifications: * You may move import statements to the top * For any type of identifier type thing, you may replace **all** of its occurrences within the code block with a different name. Please list substitutions. This is a popularity contest, so the correct answer with the most up-votes wins! [Answer] # GolfScript Straightforward bubble sort implementation. Can probably be golfed down further. [Try it online.](http://golfscript.apphb.com/?c=IyBTaW11bGF0ZWQgaW5wdXQgZnJvbSBTVERJTjoKCiJbMTAgNSAxNCAtOCA3IC0zXSIKCiMgU29ydGluZyBwcm9ncmFtOgoKfngge3sgZG9jdW1lbnQud3JpdGUgbWFuIFsKcHV0YyggJ2MnLCBzdGRvdXQgKSA7ClxiIHt7IHJldHVybiAxIGVjaG8gJHsxMH0KcmV0dXJuCnRydWU7CkNvbnZlcnQuVG9Eb3VibGUobykKZGF0YWdyaWQxLkl0ZW1zU291cmNlID0gZGF0YVRhYmxlMS5EZWZhdWx0VmlldzsKZWNobyAkYTp1CmNhdCA%2BIGZpbGUge3sgXGIgfX0gfngKaW50KiBhcnIxWzhdOwp9fQpzb3VyY2Ugfi8uYmFzaHJjCnJldHVybgp0cnVlOwpdIGRvY3VtZW50LndyaXRlCkBlY2hvIG9mZgpJUD1gY3VybCBpZmNvbmZpZy5tZWAKcmV0dXJuCnRydWU7Cn54IHJldHVybiAhMApyZXR1cm4KdHJ1ZTsKfX0gfngKZm9yIHswLi4xMC4uMn07IGRvCiAgLi4KZG9uZQpzZXQgLXgKXGIKYmFzZW5hbWUgYHB3ZGAKfng%3D "Web GolfScript") ``` ~x {{ document.write man [ putc( 'c', stdout ) ; \b {{ return 1 echo ${10} return true; Convert.ToDouble(o) datagrid1.ItemsSource = dataTable1.DefaultView; echo $a:u cat > file {{ \b }} ~x int* arr1[8]; }} source ~/.bashrc return true; ] document.write @echo off IP=`curl ifconfig.me` return true; ~x return !0 return true; }} ~x for {0..10..2}; do .. done set -x \b basename `pwd` ~x ``` ### Sources <https://stackoverflow.com/a/2513659> (<https://stackoverflow.com/u/276101>): `~x` <https://stackoverflow.com/a/3773868> (<https://stackoverflow.com/u/394167>): `{{` <https://stackoverflow.com/a/802894> (<https://stackoverflow.com/u/8815>): `document.write` <https://stackoverflow.com/a/2188223> (<https://stackoverflow.com/u/116908>): `man [` <https://stackoverflow.com/q/4563825> (<https://stackoverflow.com/u/111307>): ``` putc( 'c', stdout ) ; ``` <https://stackoverflow.com/a/16876671> (<https://stackoverflow.com/u/980550>): `\b` <https://stackoverflow.com/a/22604291> (<https://stackoverflow.com/u/1622022>): `return 1` <https://stackoverflow.com/a/6146038> (<https://stackoverflow.com/u/116908>): `echo ${10}` <https://stackoverflow.com/a/4054267> (<https://stackoverflow.com/u/69083>): ``` return true; ``` <https://stackoverflow.com/q/23657401> (<https://stackoverflow.com/u/1171811>): `Convert.ToDouble(o)` <https://stackoverflow.com/q/6097907> (<https://stackoverflow.com/u/517871>): ``` datagrid1.ItemsSource = dataTable1.DefaultView; ``` <https://stackoverflow.com/a/4813101> (<https://stackoverflow.com/u/591720>): ``` echo $a:u ``` <https://stackoverflow.com/q/19114714> (<https://stackoverflow.com/u/72436>): `cat > file` <https://stackoverflow.com/a/3773868> (<https://stackoverflow.com/u/394167>): `}}` <https://stackoverflow.com/a/859676> (<https://stackoverflow.com/u/87234>): ``` int* arr1[8]; ``` <https://stackoverflow.com/a/2518150> (<https://stackoverflow.com/u/245602>): ``` source ~/.bashrc ``` <https://stackoverflow.com/a/5750751> (<https://stackoverflow.com/u/187690>): `]` <https://stackoverflow.com/q/8823643> (<https://stackoverflow.com/u/1059446>): ``` @echo off ``` <https://stackoverflow.com/a/9764597> (<https://stackoverflow.com/u/167925>): ``` IP=`curl ifconfig.me` ``` <https://stackoverflow.com/a/8255667> (<https://stackoverflow.com/u/179669>): `return !0` <https://stackoverflow.com/a/966110> (<https://stackoverflow.com/u/104162>): ``` for {0..10..2}; do .. done ``` <https://stackoverflow.com/a/6930980> (<https://stackoverflow.com/u/705676>): ``` set -x ``` <https://stackoverflow.com/a/4641636> (<https://stackoverflow.com/u/333698>): ``` basename `pwd` ``` ]
[Question] [ This is a *very* crude text encoding algorithm I came up with the other day. It won't work if the text has more than 256 different characters in it – but it does support Unicode, at least in my Python implementation. The algorithm: 1. Find all the unique characters in the text. Let's call this list, **unique-chars**. 2. Break the text into a sequence of **tokens**, which can be either words (continuous runs of alphanumeric characters, and apostrophes) and symbols (anything that isn't a word). If there's two symbols (say, a comma and a space), take each only once. 3. Sort the tokens, most commonly occurring first. Then, take the top (256 - length of **unique-chars**). Put the two lists – **unique-chars**, and **most-common-tokens** – together into one. Let's call this list **substitution-table**. 4. Iterate through each token. If it's present in **substitution-table**, take the index in which this token is found, and convert it into a character. Otherwise, iterate through each letter in the token, and perform the same character conversion. This way, the most common words become one byte long; and those which are not as common, stay of the same length. I know, this is not very efficient. But it works. For reference, use *King James' Bible*, by Project Gutenberg; 4 452 069 bytes, MD5: `3b83dd48fa7db8df0819108f6d50f64f`. [Download here](https://drive.google.com/file/d/0B8mBtizpF3vfZWcycGdHQ3lyc1E/edit?usp=sharing). The processed version is 3 422 006 bytes, MD5: `17c52a22abe48dd4135a577e2a4aff8d`. [Download here](https://drive.google.com/file/d/0B8mBtizpF3vfWl9KT3JQT1Uxc0U/edit?usp=sharing). No restrictions apply on the language used, external libraries/programs, dirty tricks, or operating system. My Python 3 implementation runs in about 3.3–3.5 seconds, in average. Speed has precedence on everything else. Compiled language implementations, especially in C, would be appreciated. A solution in APL or Perl would be most welcome, I'm curious how they'd look like. As for how to time the solution, I'd say, time 30 executions (possibly cleaning the RAM after each execution, in case caching occurs), and report both the lowest time (which is indicative limit as for how long it takes the machine to run the program in the best conditions) and the rest of times, for completeness' sake. Obviously, this is not perfectly accurate, but it'll do for an indicative value. That said, happy coding~! [Answer] ## Perl - 154 bytes (KJB in ~1.94s) ``` while(<>){push@w,/[\w\']+|\W/g} \@c{length>1?$w{$_}++?():/./g:$_}for@w; @t{sort{$w{$b}-$w{$a}}keys%w}=grep!exists$c{$_},map{chr}0..255; print$t{$_}//$_ for@w ``` This is substantially golfed, but I can say with confidence that it hasn't affected the performance in any noticable way. Sample Usage: ``` $ perl encoder.pl < king-james-bible.txt > kjb.cmp ``` The created filesize is *3,253,677* bytes, runtime is approximately *1.94* seconds. If you want to test the correctness, you can export a translation table by appending the following three lines of code: ``` ;use Storable; %u=reverse%t; store\%u,'trans.tbl' ``` This will create, and possibly overwrite, a file named `trans.tbl` in the current working directory. Then, decode with the following script: ``` #!perl -n0 use Storable; %t=%{retrieve 'trans.tbl'}; print$t{$_}//$_ for/./sg ``` Sample usage: ``` $ perl decoder.pl < kjb.cmp > kjb.txt ``` The output is exactly *4,452,069* bytes, as expected. --- **Unrolled and commented** ``` while(<>){ # for each line push@w,/[\w\']+|\W/g # tokenize, add tokens to array } \@c{ # mark the following chars length>1? # token is 2 or more chars $w{$_}++ # increment occurrence in word hash ? # if this word has already been seen () # mark nothing : # else /./g # mark each char individually : # else $_ # mark the single char }for@w; # iterate over all tokens @t{ # create the translation table sort{$w{$b}-$w{$a}}keys%w # most frequent words }=grep!exists$c{$_},map{chr}0..255; # assign to an unmarked char print # output $t{$_} # the value in the trans hash // # or, if previous value is undefined $_ # output the untranslated string for@w # iterate over the tokens previously found ``` --- **Time analysis** **Min**: *1.843s* **Max**: *1.984s* **Avg**: *1.939s* 1.953, 1.953, 1.953, ***1.843***, 1.921, 1.937, 1.921, 1.953, 1.953, 1.921, 1.937, 1.968, 1.906, **1.984**, 1.937, 1.968, 1.953, 1.921, 1.921, 1.937, 1.968, 1.937, 1.890, 1.968, 1.937, 1.953, 1.937, 1.937, 1.937, 1.953 According to profiling, the time usage for each statement is approximately the following: *1.09s*: `while(<>){push@w,/[\w\']+|\W/g}` *31.3ms*: `\@c{length>1?$w{$_}++?():/./g:$_}for@w;` *15.6ms*: `@t{sort{$w{$b}-$w{$a}}keys%w}=grep!exists$c{$_},map{chr}0..255;` *750ms*: `print$t{$_}//$_for@w` Note that for the purpose of time usage analysis, the result was actually written to a file. Excluding the final output, or piping to `/dev/null` instead produces times 600ms to 750ms faster. --- **Major Performance Gains** * The individual characters of a word are marked only the first time the word is seen, instead of every time. As [noted by @VadimR](https://codegolf.stackexchange.com/posts/comments/43736), this alone saves around *2s*, over *25%* of the previous execution time. * The most frequent words are translated with unmarked characters, and marked characters left untranslated. This saves a great deal of time during output, because words not in the translation table can be output directly, without having to translate each individual character. * Tokenizing the file one line at a time - instead of all at once - is quite a bit faster. [Answer] **C# - 1.4s** I use a different metric for word sorting - 'word.Length -1' as this is the value of how many bytes would be saved by compressing said word. For example the word 'a' appears a lot, but saves nothing to compress (as it's already kept), and "the" saves twice as much as "at". ``` //Initial Size 4452066 //Final Size 3186918 //Time 1408 ms using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; namespace SimpleCommonWordCompressor { class Program { static void Main(string[] args) { while (true) { var data = File.ReadAllText("king-james-bible.txt"); var sw = Stopwatch.StartNew(); var uniqueChars = data.Distinct().Select(c => c.ToString()).ToArray(); var tokens = new List<string>(); var currentWord = new List<char>(); Action tryAddWord = () => { if (currentWord.Count > 0) { tokens.Add(string.Join("", currentWord)); currentWord.Clear(); } }; var charToStringLU = Enumerable.Range(0, 256).Select(i => ((char) i).ToString()).ToArray(); foreach (var datum in data) if (char.IsLetterOrDigit(datum)) currentWord.Add(datum); else { tryAddWord(); tokens.Add(charToStringLU[datum]); } tryAddWord(); var grpTokens = tokens.GroupBy(x => x).ToArray(); var wordTable = uniqueChars.Concat(grpTokens .OrderByDescending(g => g.Count() * (g.Key.Length - 1)) .Select(grp => grp.Key) .Take(256 - uniqueChars.Length)).ToList(); var wordDict = wordTable.ToDictionary(w => w, w => new[] { (byte)wordTable.IndexOf(w) }); var charTable = new byte[256]; for (byte i = 0; i < uniqueChars.Length; i++) charTable[uniqueChars[i][0]] = i; var tokenToBinary = grpTokens.ToDictionary (grp => grp.Key, grp =>{ byte[] index; if (wordDict.TryGetValue(grp.Key, out index)) return index; var newWordBinary = grp.Key.Select(c => charTable[c]).ToArray(); return newWordBinary; }); var binary = new List<byte>(); foreach (var token in tokens) binary.AddRange(tokenToBinary[token]); sw.Stop(); Console.WriteLine("Initial Size " + data.Length); Console.WriteLine("Final Size " + binary.Count); Console.WriteLine("Time " + sw.ElapsedMilliseconds + " ms\n"); Console.WriteLine("Press enter to run again"); Console.ReadLine(); } } } } ``` ]
[Question] [ **Challenge** Write the shortest program that implements the minimum requirements for a linked list, stack and queue. **Minimum requirements** * Functions that allow the user to add and remove elements from the linked list, stack and queue. * Any data type can be added to the linked list, stack and queue (string, int, etc.). * One special function (e.g. sort letters alphabetically). * The program must work (compile without errors and operations and results should make sense in the context of linked lists, stacks and queues)! * Lastly, this program must be hard-coded. Arrays, however, are allowed (please refer to the restrictions section). **Winning criteria** * Standard Codegolf rules. * Number of characters based on the summation of characters for linked list, stack and queue. **Restrictions** * No trivial answers (i.e. 0 or 1 for a stack based language). * You **are allowed** to write the program in any language **except** for stack-based languages (let me know if this is unfair). * You cannot simply use the functions of another class. If a language (like Ruby) already has `push` and `pop` functions in arrays or any other class, you must write **your own** `push` and `pop` functions. --- *Little blurb*: If this code golf challenge is too simple, I will add more requirements. I'm also open to any suggestions. [Answer] ## Haskell, 81 69 characters ``` data L a=N|a:~L a N~:z=z:~N (a:~b)~:z=a:~(b~:z) r N=N r(a:~z)=r z~:a ``` This code makes use of no preexisting functions at all. The push operation is `:~`, the enqueue operation is `~:`. Both pop and dequeue are via pattern match against `:~`. The extra operation `r` is reverse. Stacks: ``` ex1 = let stack0 = N -- empty stack stack1 = 'a' :~ stack0 -- push 'a' stack2 = 'b' :~ stack1 -- push 'b' first :~ stack3 = stack2 -- pop second :~ stack4 = stack3 -- pop in mapM_ print [first, second] ``` — ``` λ: ex1 'b' 'a' ``` Queues: ``` ex2 = let queue0 = N -- empty queue queue1 = queue0 ~: 'x' -- enq 'x' queue2 = queue1 ~: 'y' -- enq 'y' queue3 = queue2 ~: 'z' -- enq 'z' next0 :~ queue4 = queue3 -- deq next1 :~ queue5 = queue4 -- deq next2 :~ queue6 = queue5 -- deq in mapM_ print [next0, next1, next2] ``` — ``` λ: ex2 'x' 'y' 'z' ``` List reverse operation: ``` ex3 = let list = "alpha" :~ ("beta" :~ ("gamma" :~ N)) -- a list tsil = r list -- reverse the list native N = [] -- convert to native list native (a:~z) = a : native z -- for easy printing in mapM_ (print . native) [list, tsil] ``` — ``` λ: ex3 ["alpha","beta","gamma"] ["gamma","beta","alpha"] ``` [Answer] ## Ruby, 123 ``` class S def initialize @a=[] end def u n @a[@a.size]=n end def o @a.slice! -1 end def s @a.slice!0 end def j x @a*x end end ``` Example: ``` s = S.new # initialize s.u 5 # push 5 s.u 10 # push 10 s.u [1,2,3] # push [1,2,3] s.u "test" # push "test" s.u "test2" # push "test2" puts s.s # shift - queue behaivior (remove and return first element, 5) puts s.o # pop - stack behaivior (remove and return last element, "test2") puts s.j ", " # join - special behavior (join elements with argument, "10, 1, 2, 3, test") ``` [Answer] # C, 659 bytes [**Try Online**](http://ideone.com/0aJGRT) ``` typedef M;typedef struct M{int d;M*n;M*p;}Q;typedef struct{Q*f;Q*e;}L;Q*t;x; Q*F(L**l){return*l?(*l)->f:0;} Q*E(L**l){return*l?(*l)->e:0;} N(Q**t){*t=*t?(*t)->n:0;} P(Q**t){*t=*t?(*t)->p:0;} A(L**l,int d){Q*t=(Q*)malloc(sizeof(Q));t->d=d;if(*l)(*l)->f->p=t,t->n=(*l)->f,(*l)->f=t;else(*l)=(L*)malloc(sizeof(L)),(*l)->f=t,(*l)->e=t;} B(L**l){if(*l)t=(*l)->f,(*l)->f=t->n,(*l)->f->p=0,x=t->d,free(t);if(!(*l)->f)free(*l);return x;} C(L**l,int d){t=(Q*)malloc(sizeof(Q));t->d=d;if(*l)(*l)->e->n=t,t->p=(*l)->e,(*l)->e=t;else (*l)=(L*)malloc(sizeof(L)),(*l)->f=t,(*l)->e=t;} D(L**l){if(*l)t=(*l)->e,(*l)->e=t->p,(*l)->e->n=0,x=t->d,free(t);if(!(*l)->e)free(*l);return x;} ``` **Detailed** [*github*](https://github.com/khaled-kh/LightDataC/blob/master/include/lightdata/list.h) ``` typedef _LNode; typedef struct _LNode{ void* d; _LNode* n; _LNode* p; } LNode; typedef _List; typedef struct _List{ LNode* f; LNode* e; int size; } List; LNode* list_begin(List** l){ return *l?(*l)->f:0; } LNode* list_end(List** l){ return *l?(*l)->e:0; } void list_iterator_next(LNode** t){ *t = *t?(*t)->n:0; } void list_iterator_prev(LNode** t){ *t = *t?(*t)->p:0; } int list_size(List** l){ return *l?(*l)->size:0; } void list_push_front(List** l, void* d) { LNode*t = (LNode)malloc(sizeof(LNode)); t->d = d; if(*l) (*l)->f->p = t, t->n = (*l)->f, (*l)->f = t; else (*l)=(List*)malloc(sizeof(List)), (*l)->f = t, (*l)->e = t; (*l)->size++; } void list_push_back(List** l, void* d) { LNode*t = (LNode)malloc(sizeof(LNode)); t->d = d; if(*l) (*l)->e->n = t, t->p = (*l)->e, (*l)->e = t; else (*l)=(List*)malloc(sizeof(List)), (*l)->f = t, (*l)->e = t; (*l)->size++; } void* list_pop_front(List** l) { LNode* t = 0; void* d = 0; if(*l) t = (*l)->f, (*l)->f = t->n, (*l)->f->p = 0, d = t->d, free(t), (*l)->size--; if(!(*l)->f) free(*l); return d; } void* list_pop_back(List** l) { LNode* t = 0; void* d = 0; if(*l) t = (*l)->e, (*l)->e = t->p, (*l)->e->n = 0, d = t->d, free(t), (*l)->size--; if(!(*l)->e) free(*l); return d; } ``` [Answer] # JavaScript, 188 ``` function L(){N=null;E=[N,N];t=this;h=E;t.u=i=>h=[i,h]; t.o=_=>h==E?N:h[+!(h=h[1])];t.e=(i,l)=>h=(l||h)==E?[i, E]:[(l||h)[0],t.e(i,(l||h)[1])];t.s=_=>{o="";while(i=t.o()) {o+=i+","}return o}} ``` (Line breaks added for readability, not needed for answer or counted as bytes) ## Usage ### Methods * `u(item)`: P**u**sh * `o() -> item`: P**o**p (or dequeue) * `e(item)`: **E**nqueue * `s() -> string`: Convert to a **s**tring ### Example ``` let failed = _ => { throw Error(); }; let list = new L(); // Stack list.u(1); list.u(3); list.o() === 3 || failed(); list.u(2); list.o() === 2 || failed(); list.o() === 1 || failed(); list.o() === null || failed(); // Queue list.e(1); list.e(2); list.o() === 1 || failed(); list.e(3); list.o() === 2 || failed(); list.o() === 3 || failed(); list.o() === null || failed(); // Reverse list.u(1); list.u(2); list.u(3); list.s() === "3,2,1," || failed(); ``` ## Explanation ``` function L(){ N=null; // end marker // a node has the format [item, rest] E=[N,N]; // end marker, is a node t=this; h=E; // head of list, is a node t.d = _ => JSON.stringify(h); t.u=i=>h=[i,h]; // push t.o=_=> // pop/deque h==E? N: h[+!(h=h[1])]; // set head to rest, return item (index into zeroth index by casting an assignment to a value to a bool to a float) // t.e acts recursively, we use `||` to set a default for when the user calls t.e=(i,l)=> // enqueue (user caller leaves `l` undefined) h= (l||h)==E? [i, E]: // if at end, insert new item right before [(l||h)[0],t.e(i,(l||h)[1])]; // else keep current value and process rest recursively t.s=_=>{ o=""; while(i=t.o()) { o+=i+"," } return o } } ``` ## Notes List can't store anything JavaScript casts to `false` (`null`, `false`, `0`, `[]`, etc.). Repeated pop operations on an empty list have no effect. Ignore the return values of push and enqueue. Because I use global variables to reduce character count, only one list can be created. ]
[Question] [ What general tips do you have for golfing in VBScript? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to VBScript. Please post one tip per answer. Thanks to Marcog for the original idea. :) [Answer] Use an empty variable instead of "" ## Uninitialized variables are set to a special value: empty. When empty is cast to a string it becomes "". Contrived example (using z instead of ""): ``` s=InputBox(z) For i=1To 5 For j=1To i r=r&s Next MsgBox r r=z Next ``` For numeric types Empty is 0, and for booleans it is false. This can cut down on initialization code. ``` a=inputbox("Enter Starting Value") b=a while done=0 i=i+1 b=b*2 done=(b>10000 or i>10) wend msgbox "Your "&a&" rabbit(s) have turned into "&b&" rabbit(s) in "&i&" years." ``` [Answer] # Use IIf instead of If...Then `IIf()` is essentially a ternary operator. You can potentially save quite a few bytes. For example: ``` var = "World" If foo Then MsgBox "Hello" & var Else MsgBox "Goodbye" & var End If ``` Vs. ``` MsgBox IIf(foo, "Hello", "Goodbye") & "World" ``` Note: VBA only. VBScript doesn't support this one. [Answer] ## Shorter `IF` `Then`: save 10 bytes If you terminate an IF/THEN clause with a carriage return, you don't need to use an END IF. Example: ``` For x=1 to 1 IF x=1 THEN MSGBOX "No Error" Next ``` [Answer] # Use Line Separators Newlines count as two bytes ("\n"), but a colon is only one. ``` For i = 0 To 10 MsgBox "Hello" Next ``` Vs. ``` For i = 0 To 10: MsgBox "Hello": Next ``` *Note: You can't use the line separator for `If` statements.* [Answer] # Condense `For` statements In `For` statements (and in fact any statement comprised of a `"` or numeric literal followed by a reserved command) the space that separates any numeric and a following word may be removed This means that ``` For i = 1 To 100 Step 2 ... Next ``` May be condensed down to ``` For i=1To 100Step 2 ... Next ``` and following this logic, ``` If t = "TEST" Then ... ``` may be condensed to ``` If t="Test"Then ... ``` ]
[Question] [ ## Overview: Using you language of choice, implement a complete "[half away from 0](http://en.wikipedia.org/wiki/Rounding#Tie-breaking)" rounding function in the shortest amount of code possible. ## Rules/Constraints: * Direct, predefined `Round`-like functions are not allowed. * `Floor`/`Ceiling`-type functions *are* allowed, if your language supports these. * Function shall be able to handle 32-bit floating-point values. * Function shall be able to correctly handle negative values (see examples). * This is Golf, so shortest code wins. * Correct rounding for this challenge is to round away from 0, such that a rounded value will have an equal or larger absolute value. ## Input/Output: * Your function shall take two parameters: + The first is a float `x`, which is the value to round. + The second is an integer `n`, which is the number of decimal places to round to. + `x` can be a whole number or contain a decimal part, fitting within a 32-bit, single-precision float. + `n` can be greater than or equal to 0, and may be larger than the number of decimal places in `x`. * Output will be the correctly rounded `x`. * \**In cases where the solution is not exactly representable in IEEE float format, the output should be the logical representation you would have figured if not using a computer. i.e. The output of `Round(0.125, 2)` should be `0.13`*. ## Example I/O: ``` Round(1.23456789, 7) 1.2345679 Round(1.234, 5) 1.234 OR 1.23400 (Your choice on trailing 0) Round(-0.5, 0) -1 NOT 0 Round(-0.123, 2) -0.12 NOT -0.13 Round(3.1415926535897932384626433832, 20) 3.14159265358979323846 ``` ## Winning: \*\**Some system limitations may be present which make your function less accurate/usable.* In these cases, supply the best possible calculation you can within those limitations. For example, I have a solution in my preferred environment, VBA in Office 2003, which only allows me to round up to 307 digits, while the IDE will only let me use values up to 15 significant decimal places. (I will eventually post this example here.) With your answer submission, please post the highest values of `n` and the largest number of significant decimal digits for `x` for which your function will run. If you cannot meet the minimum requirements, that solution is disqualified, no matter the code length. (i.e. my own solution described above is invalid) While this is code golf, and the shortest code will generally win. If two answers exist with different maximum values for `x` and `n`, the solution which works with the highest input values (measured as `x * n`) will win. If these two solutions meet the same limitation while fulfilling the requirements of the challenge, then the shortest code of those two will win. If no solutions meet the requirement, then the best limitation score (shortest code length in the event of a tie) will win. Example submission given the rules above for my own code: ``` <CODE HERE> Max n = 307 Max x digits = 15 Limitation Score (x * n) = 4605 ``` [Answer] ## Q (29 Characters) ``` {("i"$x*10 xexp y)%10 xexp y} ``` Sample usage ``` {("i"$x*10 xexp y)%10 xexp y}[1.23456;4] ``` Works by multiplying your x input by 10 to the power of your y input, casting to an int and then dividing again by 10 to the power of your y input. [Answer] Python (153 chars, max(x)=infinite, max(n)=13) You can input a float, however it works much, much better (max(n)=infinite instead of 13) if you input a string. ``` def Round(x,n): x=map(str,str(x)) if n==0:x.remove('.') n+=1+(n!=0)+(x[0]=='-') if n<len(x):x[n-1]=str(int(x[n-1])+(x[n]>='5')) return''.join(x[:n]) ``` Explanation: `x=map(str,str(x))` Seperate each character of `x`. (e.x. when x=5.4, running this makes x equal to `['5', '.', '4']`. `if n==0:x.remove('.')` A hack to get around Test Case 3, `Round(-0.5, 0)`. Removes the decimal so we don't get the output `-1.` `n+=1+(n!=0)+(x[0]=='-')` `if n<len(x):x[n-1]=str(int(x[n-1])+(x[n]>='5'))` `1` compensates for the decimal point. I think. `(n!=0)`: Compensates for the removal of the decimal point and allows the next line to run. `(x[0]=='-')`: Makes it so that in the next line, the negative sign (an additional character) will not mess up the calculation. `if n<len(x)`: Accounts for Test Case 2, `Round(1.234, 5)`, because Python errors when you try to access the `n`th item of a list if it's not there. (`x[5]` is called in the test case, and `x` does not have a 6th term.) `x[n-1]=str(int(x[n-1])+(x[n]>='5'))`: Gets the `n-1`th item of `x` (which is a string, so it needs to be turned into a number), and adds 1 to it if the `n`th item of `x` is greater than or equal to 5. Then it gets turned back into a string. `return''.join(x[:n])`: Returns the concatenation of everything up to the `n`th item in `x`. [Answer] ## Python, 55 46 chars ``` R=lambda x,n:int(10**n*x+(.5,-.5)[x<0])/10.**n ``` Translates the decimal point, rounds half up using `int(x+.5)`, then translates the decimal point back. Negative numbers use `int(x-.5)`. Should be as accurate as a 64-bit IEEE can get (15+ decimal digits). `n` can be up to about 300 or so (less if `x` is big). [Answer] # **C, 51 Characters** ``` float round(float x, int n) { return(long)(x*pow(10,n)+(x>0?0.5:-0.5))/pow(10,n); } ``` Not including the function headers, it's 51 characters. ]
[Question] [ **Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers. --- **Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/3241/edit). Closed 6 years ago. [Improve this question](/posts/3241/edit) I'm too lazy to write a [JavaDoc](http://en.wikipedia.org/wiki/Javadoc) comment myself, there's a lot of typing and it is mostly boilerplate. Write a program to generate a JavaDoc comment with `$` as a placeholder given a method specification. Example input: ``` Integer method(int arg1, String arg2) throws InvalidArgumentException, NullPointerException ``` Example output: ``` /** $ @param arg1 $ @param arg2 $ @return $ @throws InvalidArgumentException $ @throws NullPointerException $ */ ``` Some notes: * There won't be any `static`, `private`, or other qualifier on the method, just the return type. * There should be no `@return` tag if the return type is `void`. * It is possible that there won't be any `throws` clause. * You should accept the one-line method spec on stdin and write the result to stdout. Shortest code wins. [Answer] **Perl 5.14 - 192 bytes** ``` #!perl -n print'/** $ ';@F=split/\(|\) throws +|\)/;print"\@param $_ \$ "for values{split/[, ]+/,$F[1]};print(($F[0]!~/^void /?'@return $ ':''),(map{"\@throws $_ \$ "}$F[2]=~/\w+/g),"*/") ``` [Answer] ### PowerShell, 209 ~~213~~ ``` '/** $' ($i="$input")-replace'.*\( *| *\).*'-split','-ne''|%{"@param $((-split$_)[1]) $"} ,'@return $'*!($i-clike'void *') if($i-match'\) *t'){$i-replace'.*\) *throws *'-split' *, *'|%{"@throws $_ $"}}'*/' ``` [bash](http://svn.lando.us/joey/Public/SO/CG3241/Tests/test) and [PowerShell](http://svn.lando.us/joey/Public/SO/CG3241/Tests/test.ps1) test scripts. but I'm probably missing a few cases still. But 22 tests are better than only one example, I guess :-) [Answer] ## Ruby, 177 182 186 ``` a,e=gets.split /\bthrows\b/ a=a.split /[\s(),]+/ puts'/** $',3.step(a.size,2).map{|i|"@param #{a[i]} $"},a[0]=='void'?[]:'@return $',e ?e.scan(/\w+/).map{|x|"@throws #{x} $"}:[],'*/' ``` [Answer] ### scala 579: ``` import scala.util.parsing.combinator._ object M extends JavaTokenParsers{def i=ident type P=Parser[Any] def r:P=n~"("~rep(p)~")"~opt("throws"~rep(t))^^(s=>"\n/**\n $"+s._1._1._2.mkString("")+s._1._1._1+"\n2:"+(s._2.getOrElse(""))+"\n*/") def n:P=i~i^^(s=>if(s._1=="void")""else"\nreturn $") def p:P=i~i~opt(",")^^(s=>("\n@param "+s._1._2+" $")) def t:P=i~opt(",")^^(s=>("\n@throws "+s._1+" $")) def main (args:Array[String])={val i=parseAll(r,readLine()) println(i.toString().replaceAll(".:.*","").replaceAll("[~(),]","").replaceAll("^[\\[].*","").replaceAll ("\n\n","\n"))}} ``` I'm sorry, I'm not experienced with TokenParsers. I guess I'm doing it wrong, and there is much room for improvement. ]
[Question] [ [Last time](https://codegolf.stackexchange.com/questions/241791/dont-output-the-file) you were required to write program that output a file, such that no byte is same as original file. The request meant to let everyone carry part of information, but it ends up that everyone carry same info to reduce their storage... This challenge is similar. Write at most 1024 programs that output at least 8524 bytes each. Say the \$j\$th byte of program \$i\$'s output is \$a\_{i,j}\$, and \$x\_j\$ is the \$j\$th byte of the file given below, then it's a requirement that: $$ \left\{a\_{i,j}\middle|1\le i\le 1024\right\}=\left\{0,1,2,...,255\right\}-\left\{x\_j\right\} $$ i.e., for each index \$ j \$, the \$ j \$th byte of the output of each program collectively includes every byte value 0 to 255, *except* the \$ j \$th byte of the file given below. Your score is the longest of your programs. Lowest score in each language wins. xxd of the file: ``` 00000000: fd37 7a58 5a00 0004 e6d6 b446 0200 2101 .7zXZ......F..!. 00000010: 1600 0000 742f e5a3 e06b 6f21 0a5d 0026 ....t/...ko!.].& 00000020: 9509 6f34 76f2 ffad 4150 0e26 f227 9480 ..o4v...AP.&.'.. 00000030: c74d a805 e4ee 9f38 d9f3 6e03 5db2 d32e .M.....8..n.]... 00000040: a0c3 cc6a 167c ca6b 36e7 ba6a ac7b fdc3 ...j.|.k6..j.{.. 00000050: 4388 c9ed 6ae5 4f42 3b2f be2c cd16 5588 C...j.OB;/.,..U. 00000060: 1f3a ba35 dfde 7adf 7f73 db53 9474 93dc .:.5..z..s.S.t.. 00000070: b9f3 0cd6 4143 0731 f96e 6b93 4b13 4dcd ....AC.1.nk.K.M. 00000080: 07bd 4b4c b31c 82a2 3276 3cfb b11f b04f ..KL....2v<....O 00000090: a764 5640 6c43 e7e2 bb2b 8024 9a9e 9e1b .dV@lC...+.$.... 000000a0: abbc 3f53 322a 370b 9f4f b92a f43b b07e ..?S2*7..O.*.;.~ 000000b0: dcd3 3951 979c 750f a8f2 56b3 ffb0 81ac ..9Q..u...V..... 000000c0: c3f9 4452 9fd7 96a7 1160 eae6 33e6 6b0c ..DR.....`..3.k. 000000d0: de0e 39bc f867 fc8e bee8 7dd1 8d84 59b9 ..9..g....}...Y. 000000e0: 3723 2c8a ea02 1d07 d892 b50f bae1 a30b 7#,............. 000000f0: cc02 779e 1249 fb3e 354a 7e1e cd28 5eeb ..w..I.>5J~..(^. 00000100: e586 3538 291a 9284 497f c821 f5c2 918d ..58)...I..!.... 00000110: 28d1 54c9 75b8 1efd fb70 72d1 fa08 e48c (.T.u....pr..... 00000120: 5af1 5ea3 b4ff a571 1331 5f43 42b1 a55f Z.^....q.1_CB.._ 00000130: 0cb9 a676 d250 3931 5293 60f5 6253 2dce ...v.P91R.`.bS-. 00000140: c157 8f35 62ac bd7f 8295 527b e7bd 2441 .W.5b.....R{..$A 00000150: 7e7a e654 f1a2 2cda 88c8 34e7 e5bd 4899 ~z.T..,...4...H. 00000160: aac7 ce13 ff11 6ead 5c2a 90f3 f172 f62d ......n.\*...r.- 00000170: 5cee df9f f834 49c7 9ccd 44a6 1053 3d61 \....4I...D..S=a 00000180: 9b97 4634 9d8c 09a8 3901 128a 7e88 123b ..F4....9...~..; 00000190: 8427 7670 467d 47d8 36fd 24ba 0654 9a15 .'vpF}G.6.$..T.. 000001a0: e2c5 e618 a79c 30b1 e06f 32e0 55e1 6f19 ......0..o2.U.o. 000001b0: 779a b7ad fb1b 8a53 6b77 c7c3 f2fc 53a1 w......Skw....S. 000001c0: fd28 4da1 06e8 9b77 9e44 e87d c761 e78c .(M....w.D.}.a.. 000001d0: f512 7fef f26c 8248 a271 95fa fa4d dd56 .....l.H.q...M.V 000001e0: e6b1 75f2 ba45 8cdc 548b 1aea ae4b 901d ..u..E..T....K.. 000001f0: 3cc6 03fd 9b48 0431 19f6 9c4d dfcd 1d2e <....H.1...M.... 00000200: d9eb dfd2 c3d4 87b0 1720 1591 1aad ae91 ......... ...... 00000210: 9a3f c0a0 f9aa 20e3 b601 7c29 6f11 5839 .?.... ...|)o.X9 00000220: 3212 ca01 931d 0a09 7317 1d8e c7a4 cd43 2.......s......C 00000230: d699 594b bc94 db52 9732 41e6 377b 997f ..YK...R.2A.7{.. 00000240: 5c44 d10d 30a0 119f cfde 0805 56be 0b62 \D..0.......V..b 00000250: 859c ed37 3d33 344d 604d f57d a5a7 24e1 ...7=34M`M.}..$. 00000260: 706e 9dfb dbdf 89cd 4292 5cb5 e306 7353 pn......B.\...sS 00000270: 7ba8 c7cc 7cca d56c 6692 d585 aaaa e5af {...|..lf....... 00000280: 5019 c69b 036a 7096 cfa5 fc57 666c c812 P....jp....Wfl.. 00000290: 1a2c 844f dceb 674c 8cd8 480c 5090 6351 .,.O..gL..H.P.cQ 000002a0: 422d 9885 10f2 8864 5b83 663b 19a2 abc5 B-.....d[.f;.... 000002b0: c332 e7df e10c 6020 f48f b0e9 7543 33ff .2....` ....uC3. 000002c0: 3142 da40 041e 3990 e0b2 ef3e bf45 2d70 [[email protected]](/cdn-cgi/l/email-protection)....>.E-p 000002d0: ff57 bccf 45f4 7690 598f 1602 63e0 d61d .W..E.v.Y...c... 000002e0: 4dff 3dba 8f8b 2128 e22a d802 7587 e13b M.=...!(.*..u..; 000002f0: 27fa f341 498a d39a 3f61 31ca f4ad 1a2b '..AI...?a1....+ 00000300: ab86 0fda 8a2d 2532 dca6 5f9a a54c 560a .....-%2.._..LV. 00000310: 7dbe e797 9cdd 1960 d3f5 0126 f691 3718 }......`...&..7. 00000320: 5b22 1bfa c704 8ca3 bad0 472a 20c4 c775 ["........G* ..u 00000330: 964c b0cf 6911 2fe8 b953 bcec 7917 5675 .L..i./..S..y.Vu 00000340: cdc2 b154 1df5 404d c8ef 4f01 13f0 f7ba [[email protected]](/cdn-cgi/l/email-protection)..... 00000350: af6f c020 4ebe f4d8 099e 096e e70d be41 .o. N......n...A 00000360: 748a dbc0 5614 cb7a 35fb fb9d bc29 f8ae t...V..z5....).. 00000370: 668a 8ec3 26b5 b99c 6a93 d416 586a 06f6 f...&...j...Xj.. 00000380: 8698 c14e 10e4 168e 375c 5f2b bcf5 053d ...N....7\_+...= 00000390: 4c4d fa30 f3b0 0c22 294a a3e8 1b61 faac LM.0...")J...a.. 000003a0: 55ca c78f 6ae5 6b76 80fa a1cb 5023 a652 U...j.kv....P#.R 000003b0: 0c72 c54e 4223 9010 4a34 c28f b665 3031 .r.NB#..J4...e01 000003c0: 9127 8f42 78f3 f02e 6948 a53a b847 cd83 .'.Bx...iH.:.G.. 000003d0: 9728 9cfc 5440 de73 ddd1 3d30 c450 5b29 .([[email protected]](/cdn-cgi/l/email-protection)..=0.P[) 000003e0: e4b9 a5dd a67e c20b 468e 522a d29a 7931 .....~..F.R*..y1 000003f0: 857d 3ad7 a436 946a be62 66ef 4fb6 8ee3 .}:..6.j.bf.O... 00000400: 0989 0ce4 b675 45e9 e0b5 cb3a 6874 9818 .....uE....:ht.. 00000410: 1f2d d149 956f 5924 13ba 512d 97b6 31e6 .-.I.oY$..Q-..1. 00000420: 6680 c808 2bb0 0197 2314 a622 ff67 7121 f...+...#..".gq! 00000430: fa94 a17e 9b3a e7c0 9b28 acdb 8b1e ce84 ...~.:...(...... 00000440: a03c 14ae 02a4 ddbf 9b6e 1db9 e946 7c10 .<.......n...F|. 00000450: e3fc 522a 37c1 cc2e e3be 0f00 8007 7005 ..R*7.........p. 00000460: 43e2 8cda a297 6ed2 ee51 37f4 64f9 71ae C.....n..Q7.d.q. 00000470: 8d92 0bfd 527c 68eb 95d3 1d70 81a7 4f0a ....R|h....p..O. 00000480: 43e3 8ffd fc8a 2984 1443 c0d7 1b53 2ce1 C.....)..C...S,. 00000490: eff5 fcbb 0c1c 1639 6a38 d3a6 5950 ae13 .......9j8..YP.. 000004a0: 5dc4 7c6a 7c67 9409 e0e8 28fc d28c 0ee3 ].|j|g....(..... 000004b0: 2d7a 4875 9389 a23c 3130 7a97 5253 e4f7 -zHu...<10z.RS.. 000004c0: 453f 3ece 021c 2ea1 52df 3010 4f5c 48d8 E?>.....R.0.O\H. 000004d0: 7fc8 e4d3 0f81 4f18 5a25 4e5a 9e1e c589 ......O.Z%NZ.... 000004e0: 0c60 73c3 5187 38c9 0dbb 16a3 8b8c 70a8 .`s.Q.8.......p. 000004f0: 09e3 8644 96c7 56ce 8d5f 7156 6c5e da52 ...D..V.._qVl^.R 00000500: ccee 74ae 1a7e 664e ab2a ae8f 0b74 9935 ..t..~fN.*...t.5 00000510: 5a18 e53e 4d5d 1d85 acef 6d34 71f7 bd25 Z..>M]....m4q..% 00000520: 452d 5118 7a12 4314 9b56 d0b8 ee13 97a0 E-Q.z.C..V...... 00000530: fb7c de5a fe0f 89da f5bb 057b 216a ed15 .|.Z.......{!j.. 00000540: 2e46 46de 5f30 80eb da94 2e6d d05b c51b .FF._0.....m.[.. 00000550: c811 2dcb 0260 4b0c 41ce 63fe 875b ad18 ..-..`K.A.c..[.. 00000560: 45af b32b 2d10 9870 6fe8 a133 3f70 77c1 E..+-..po..3?pw. 00000570: 4d04 d881 758f c77a 8a9c a17f 27a4 4886 M...u..z....'.H. 00000580: 82c5 4186 cd55 a05e f4d0 e711 468c ebfc ..A..U.^....F... 00000590: 6d6d 1dff 83fd 5e7f 4046 cfed aef9 cfdf mm....^.@F...... 000005a0: 914f 70c2 8ffa 469d 46c0 58a8 ea4e 1e78 .Op...F.F.X..N.x 000005b0: 3326 2e35 1e2c b273 e12d 25d5 587b ce27 3&.5.,.s.-%.X{.' 000005c0: a211 356e 2002 2745 ad8c 79fd 4021 11b3 ..5n .'E..y.@!.. 000005d0: 3a15 20e1 36c0 0c6d a030 e0a9 e124 ed12 :. .6..m.0...$.. 000005e0: 6bdd 5952 48b8 2b81 4fa8 8f76 a421 f7cd k.YRH.+.O..v.!.. 000005f0: 30be 33f8 3a4d 3847 ad8c 1606 edf9 1fa2 0.3.:M8G........ 00000600: 53b5 f6fa 44e0 03ba 35d8 cf75 71a4 ae00 S...D...5..uq... 00000610: f0a8 bbd5 b7ae 5db9 dab0 093a 7375 3ab0 ......]....:su:. 00000620: 372c 9041 29d1 88d9 4ee4 0941 3e21 1d70 7,.A)...N..A>!.p 00000630: d133 d427 bf00 e6eb 1ce1 31f9 2271 de63 .3.'......1."q.c 00000640: d948 3989 0f45 c35e ad5e cb7f 0f6b 28fb .H9..E.^.^...k(. 00000650: 14b3 bb61 a836 0796 df1d aad1 3504 e2fa ...a.6......5... 00000660: aa0f 8822 e296 2cd3 1ba1 7353 5eee 18b8 ..."..,...sS^... 00000670: d7fe ad67 8de8 3841 6d5b 6e77 caec d781 ...g..8Am[nw.... 00000680: 427c 4fd1 a827 a7b9 97a7 5346 adf2 c483 B|O..'....SF.... 00000690: 156b f952 31cf 89ed 3db7 67d1 6edd 3054 .k.R1...=.g.n.0T 000006a0: 92e2 a7f8 19c8 3b24 3b38 289a a4fc 8e75 ......;$;8(....u 000006b0: 6e85 d998 8987 1e5d f9b8 c8e5 7624 03a2 n......]....v$.. 000006c0: 0541 a6d5 6ae2 869e f11a efac c214 dab5 .A..j........... 000006d0: b4af dcae 7ded 11c9 e305 17a7 3958 f8bf ....}.......9X.. 000006e0: 758b 2849 486a 3477 3766 ba83 cc22 818e u.(IHj4w7f...".. 000006f0: c399 d295 3dab 2802 b8c1 0aa3 992c f100 ....=.(......,.. 00000700: 1a95 81aa 5eea 9b64 5e02 ba91 0b26 8f05 ....^..d^....&.. 00000710: 987f cd68 45e9 e24d e0c7 5808 335a 879e ...hE..M..X.3Z.. 00000720: a4f4 8354 2bb8 ce16 a635 dd49 2161 4e50 ...T+....5.I!aNP 00000730: d5db 31be e098 ae00 e186 1405 f972 1fd0 ..1..........r.. 00000740: 680f de2d bda2 a346 2104 b6f0 19d6 f109 h..-...F!....... 00000750: 1808 e37f 4729 b97e dad0 dc0f 7303 67af ....G).~....s.g. 00000760: 5006 35c5 63b3 d1e1 9d88 1b47 720d d115 P.5.c......Gr... 00000770: 2db9 9188 f4da 325c 3ab1 71c9 be33 080a -.....2\:.q..3.. 00000780: 683e cd19 df20 7978 ba8a 32fd 91b5 f4b4 h>... yx..2..... 00000790: d15a 340b a1a8 88be f333 e4de 6a6d 0916 .Z4......3..jm.. 000007a0: a7f4 5c5c 410b 0c8e ffdb 8bfa e5d4 24a9 ..\\A.........$. 000007b0: 11de c9b6 367d 3b05 3e54 d95a 3434 e069 ....6};.>T.Z44.i 000007c0: 47ae 90d0 163c ef7a 926e bb2b bee5 af40 G....<.z.n.+...@ 000007d0: ffee f65c 1f1d 0350 b36e 0011 f5f6 0696 ...\...P.n...... 000007e0: fab0 6dc8 a178 9ce8 f06b 34ca 05c8 154f ..m..x...k4....O 000007f0: 98dd b90b b7c8 e552 3058 2bd0 13db 0a2d .......R0X+....- 00000800: 4583 348e 2ddb 06e7 0460 5745 621f bd36 E.4.-....`WEb..6 00000810: 3fee e60c 7e9e 2de5 54ea 802d 7502 605c ?...~.-.T..-u.`\ 00000820: eae8 e17b 7d21 b9ed 5c3d 6ccd 22a7 07b9 ...{}!..\=l."... 00000830: f302 75da 147e 04cf af83 ee16 2a62 a550 ..u..~......*b.P 00000840: 1423 37f6 6205 2246 0bda f9f3 0223 906a .#7.b."F.....#.j 00000850: b3f6 8350 57bf 2275 3594 1b20 3e11 1f64 ...PW."u5.. >..d 00000860: 6600 9895 936d 135b c4a4 42bc 99de 7a4e f....m.[..B...zN 00000870: cbff ddf1 7ccb b344 6498 3fc6 a747 1895 ....|..Dd.?..G.. 00000880: 6802 b354 d53d 07c2 c571 4754 bed8 34ed h..T.=...qGT..4. 00000890: 8829 673f eb76 fc34 2b62 0f5a 9a70 1cdc .)g?.v.4+b.Z.p.. 000008a0: 56b0 d3dc 0b5d f07c 47f5 2922 8366 fd47 V....].|G.)".f.G 000008b0: 4147 0fc2 8414 50e8 8213 a96a 40ae 948a AG....P....j@... 000008c0: a273 c18e 1ab7 a221 198f 3f07 0269 238f .s.....!..?..i#. 000008d0: ed53 2249 6db3 c87f d7d0 be48 187d 7c30 .S"Im......H.}|0 000008e0: 7155 5466 39f2 89e6 285a 9c13 44fe 92a0 qUTf9...(Z..D... 000008f0: eb45 1df9 c961 0d73 eebe b652 ba53 df68 .E...a.s...R.S.h 00000900: b556 fedc 8194 663a 6c24 c9d5 4e7d ad22 .V....f:l$..N}." 00000910: 0d93 5127 0545 b9a8 e4bd 858e fcf2 4705 ..Q'.E........G. 00000920: 80b4 7eb5 5cff f2ea fcb9 ec31 c3ce 9da1 ..~.\......1.... 00000930: 81b1 d007 8178 450b 1c8f 1bee e286 c01e .....xE......... 00000940: d7df 8073 235c 7e77 5e77 c320 3f9d 21ef ...s#\~w^w. ?.!. 00000950: c94f 7898 6374 908f 214c 8790 ce00 ffc2 .Ox.ct..!L...... 00000960: c46e 3f68 da38 ad1c d8fb ccbb dbab 22b4 .n?h.8........". 00000970: 93eb 8ff2 6600 5a44 f0c3 9b79 49e4 f161 ....f.ZD...yI..a 00000980: 8d30 7d3e 4cfd ed89 7e72 5be0 08de ff9e .0}>L...~r[..... 00000990: b919 03ec c9be 04d2 df93 bc6a ce12 bbd0 ...........j.... 000009a0: 2b06 5e46 2d23 da45 99de f38f 723a c7f7 +.^F-#.E....r:.. 000009b0: 6df0 cd05 543e 2d1c 1c87 b621 f5b5 896b m...T>-....!...k 000009c0: 7694 b976 ef08 6cf0 f445 b777 0aca 776e v..v..l..E.w..wn 000009d0: ed69 08fb 7b36 3982 0305 0bad 7bad feba .i..{69.....{... 000009e0: be3d 7e5b 52cc 5fe4 0424 0da1 f77b 1eca .=~[R._..$...{.. 000009f0: 8618 228d d80c cd70 7dde 0813 3c71 7a59 .."....p}...<qzY 00000a00: 209f 9927 6988 78ba 99ff eecf cacb b10e ..'i.x......... 00000a10: 59bb 37af 0b51 e354 9528 2696 17fb 6150 Y.7..Q.T.(&...aP 00000a20: b56a 9363 ddea b14d 2881 8954 4cc7 cea0 .j.c...M(..TL... 00000a30: 13fb 6bb9 ce8d 394d 0d5f 77cd e806 6bb1 ..k...9M._w...k. 00000a40: 739d 62b4 92ea 4523 006f 8c66 0ec5 d3d8 s.b...E#.o.f.... 00000a50: ea08 20ca 13db 7171 24e2 146c a697 1601 .. ...qq$..l.... 00000a60: ea18 f433 dc7c 96d6 8b98 dd1f 194f 051f ...3.|.......O.. 00000a70: 6ed6 9f28 5ef6 ade7 a003 42ff be9e cbbd n..(^.....B..... 00000a80: e613 cea6 7817 ee40 3d7c d40b 6342 5abe ....x..@=|..cBZ. 00000a90: 4380 fd42 cfe4 ec95 289e e537 0b43 b09a C..B....(..7.C.. 00000aa0: dc7e 4b92 52d2 6582 9b3c 17cb b3c9 0f7f .~K.R.e..<...... 00000ab0: 846b 9762 c954 c185 452c c6a5 a5e0 8c68 .k.b.T..E,.....h 00000ac0: d63e 6ca6 499d 66a7 aef2 a9b2 f122 a481 .>l.I.f......".. 00000ad0: 6e41 de65 afee 761e e617 a6a5 a416 0042 nA.e..v........B 00000ae0: 4180 edce 934c c6f4 2cd0 f624 e026 0097 A....L..,..$.&.. 00000af0: 3802 9547 6d67 3e23 2691 79b7 1fca 5e1d 8..Gmg>#&.y...^. 00000b00: 3b6d e740 d590 5941 2ebb 65e8 a17a 1120 ;[[email protected]](/cdn-cgi/l/email-protection). 00000b10: 109f 7ccb c577 b0f7 2525 e664 50aa 556a ..|..w..%%.dP.Uj 00000b20: 40f7 cbfb 7994 e75d 401b cade e1b6 83d9 @...y..]@....... 00000b30: 617a e3ee 5914 e211 da57 4fcb b3e1 51da az..Y....WO...Q. 00000b40: e2e4 f449 1e4c 5ea4 a58d fedd 9698 821c ...I.L^......... 00000b50: d6ed 8d68 9bd9 c0a1 fe68 9583 4c2a f311 ...h.....h..L*.. 00000b60: c800 46f3 13ef b482 4050 0ee0 a729 03ff ..F.....@P...).. 00000b70: e812 25f0 638c 9c91 2e76 7cc7 2991 8ea4 ..%.c....v|.)... 00000b80: a1cb a83a 1f82 accf 7636 2bde 3623 dc9c ...:....v6+.6#.. 00000b90: 77bc fc3f 73a3 d888 3a4c 911c 2568 5aa7 w..?s...:L..%hZ. 00000ba0: 5819 bc15 cba7 69ea a733 794b 300c 4be1 X.....i..3yK0.K. 00000bb0: 5290 6777 42ca 694c 51aa e691 7dbf 9926 R.gwB.iLQ...}..& 00000bc0: 2be8 fd3d ee4f d2a5 fcf9 9b55 1ee6 deb2 +..=.O.....U.... 00000bd0: ddc4 d4fd c4a8 2697 3d61 49d7 a16c 2ed4 ......&.=aI..l.. 00000be0: 5a4a dacf 2d4e f249 87d4 2344 5496 e84c ZJ..-N.I..#DT..L 00000bf0: ec7c a33b f12a 3e47 d282 af82 6a02 bc69 .|.;.*>G....j..i 00000c00: 207b 5bed 064e 3f6e 72e1 ddd6 e5f3 04cd {[..N?nr....... 00000c10: 6b19 ec6c 3fb6 0616 1e9d d5eb 5da1 0a22 k..l?.......].." 00000c20: f838 10bf 1ce9 bf6b 022f 1ae5 1432 1a06 .8.....k./...2.. 00000c30: 437a dc54 8ada efaf e050 eba6 e145 27db Cz.T.....P...E'. 00000c40: ae49 2def 5326 7418 88aa df6c 4da5 6630 .I-.S&t....lM.f0 00000c50: b990 da6e 2e02 2b9b 284a 1127 5769 f5d4 ...n..+.(J.'Wi.. 00000c60: 07e2 e182 6e92 ee20 73e4 5e1b d4f8 4b86 ....n.. s.^...K. 00000c70: e7e8 0661 7a73 4b33 44c4 40b6 3b34 ce40 ...azsK3D.@.;4.@ 00000c80: b57b bf26 e244 a055 5cf6 cd83 1edd 9c74 .{.&.D.U\......t 00000c90: e690 368f bef0 4119 191c 00f3 4842 19bb ..6...A.....HB.. 00000ca0: f4f8 30f8 c219 3897 2506 5224 86bf fcc3 ..0...8.%.R$.... 00000cb0: 6ed4 71c1 fdf5 4b7f d072 b9ed bff3 2764 n.q...K..r....'d 00000cc0: 0c31 0679 f25c 2a1d 73f5 c796 ac5a 9939 .1.y.\*.s....Z.9 00000cd0: 03c2 7bd3 6d8f 9acf a98e d71c b8c3 281d ..{.m.........(. 00000ce0: b281 7b65 15de dd95 f6e7 fe89 f5a8 4cbe ..{e..........L. 00000cf0: 5e45 3b9c 7083 bfef 071e 1f9f 1fd4 6c27 ^E;.p.........l' 00000d00: cc91 4f98 215f 58de 44e9 f739 d8a5 facb ..O.!_X.D..9.... 00000d10: 2126 e790 251e ed65 2831 a262 cabd cb9c !&..%..e(1.b.... 00000d20: 9de8 788c 3f41 3655 fb07 c91d 192b 2430 ..x.?A6U.....+$0 00000d30: 8bac 732c 88cc 7b65 beac d32a 6249 c133 ..s,..{e...*bI.3 00000d40: f932 f142 7168 3028 6874 ec19 f4c3 1834 .2.Bqh0(ht.....4 00000d50: 9b0f 01f2 9239 2e6c e557 3102 7626 dd3f .....9.l.W1.v&.? 00000d60: e4c2 79bc 45ec 58d9 df89 77ca 696b ce54 ..y.E.X...w.ik.T 00000d70: 1ff7 8cbd f06b 45c0 71a0 fe11 7c31 8cf7 .....kE.q...|1.. 00000d80: f423 400d 51d3 593e d300 97df 4a0b e7fc .#@.Q.Y>....J... 00000d90: 35c0 6226 90d0 ea0d 9fc5 d6ae 55ec f8e4 5.b&........U... 00000da0: 96c6 e5b7 0364 b515 d906 50fb e58b b1ac .....d....P..... 00000db0: 5146 dd4b 0045 42e8 bab2 2eaa 3dbb 006d QF.K.EB.....=..m 00000dc0: 1ffe 0ca9 0682 35c8 b90a 18a1 ce24 60e4 ......5......$`. 00000dd0: b4a4 eefd 1c8e 7c44 2048 c5ef ae59 d6cb ......|D H...Y.. 00000de0: f770 9d31 0195 7626 bfc4 72d2 0518 a2f0 .p.1..v&..r..... 00000df0: 023c 3507 593d 52be 1752 45e1 ba26 4e9c .<5.Y=R..RE..&N. 00000e00: c54c 38ca 4eec dd13 b073 c8c6 1bef b996 .L8.N....s...... 00000e10: 231d be77 85c5 80c6 60d7 b9d6 674b 9f09 #..w....`...gK.. 00000e20: 8276 46e8 4435 c0ae bb5d 6da2 ccec 8e6a .vF.D5...]m....j 00000e30: b8a0 041f 006e bbb9 6ab0 21b5 dfd6 c037 .....n..j.!....7 00000e40: d2de 255a 9735 4b74 e708 1c89 40bf baa7 ..%Z.5Kt....@... 00000e50: 3c12 e1e7 be25 e87d 6531 74b3 e344 6b47 <....%.}e1t..DkG 00000e60: b2d9 a33c 0d1b 0161 c2a0 7086 3d28 b356 ...<...a..p.=(.V 00000e70: 4f46 572a 4d67 bcd9 4c3d c1a6 e36b ddaf OFW*Mg..L=...k.. 00000e80: 57cb 44b9 c495 f5de 763a dd67 02be 57ba W.D.....v:.g..W. 00000e90: 33e2 a610 7471 b0b6 6da3 edda bcd3 a93a 3...tq..m......: 00000ea0: 4fc8 899b 472d 8344 3667 d792 9124 09c4 O...G-.D6g...$.. 00000eb0: ea1f 1c70 2e14 13c5 4113 37a3 8247 df99 ...p....A.7..G.. 00000ec0: e0d3 a729 80be 73a5 bf4a 466b f895 40eb ...)..s..JFk..@. 00000ed0: 7b6e 4790 17de 9ece 8859 80d5 81f3 6431 {nG......Y....d1 00000ee0: 8a7a c5e2 c10e e746 846d 346f 94f6 180e .z.....F.m4o.... 00000ef0: cd30 8234 dd65 25e5 9246 60f8 91b5 f547 .0.4.e%..F`....G 00000f00: 3c3d f599 8465 5df5 2c32 3bdd 2d43 f34f <=...e].,2;.-C.O 00000f10: 7e62 e9e9 b646 dd23 c281 7fb3 dc92 32fb ~b...F.#......2. 00000f20: 0616 f98e f783 7c25 b36f 9b32 8cd2 63f8 ......|%.o.2..c. 00000f30: a9e6 5444 6051 edcd a6bc 9284 4232 f3ca ..TD`Q......B2.. 00000f40: 1d01 fe32 139c a0b1 0e19 f60c c1dc 0bf8 ...2............ 00000f50: a872 ff88 f03f 44b9 e773 3e9d 3b91 38e8 .r...?D..s>.;.8. 00000f60: 6e79 03bf 68c8 6192 3054 9986 4f47 e935 ny..h.a.0T..OG.5 00000f70: 13ed 881a b18e 3ad0 4903 86d3 ee71 1e66 ......:.I....q.f 00000f80: 8fec 8f03 a0e5 9281 6db8 739e c702 0961 ........m.s....a 00000f90: 7973 4ff0 0a3a 9a25 7acb 5cb6 34c8 0f2a ysO..:.%z.\.4..* 00000fa0: 4d6f 2381 450e ddde 589e b109 a1df c536 Mo#.E...X......6 00000fb0: 213d 392e 985e c8e3 486b 27f8 f568 6718 !=9..^..Hk'..hg. 00000fc0: 77c9 add9 89c0 bed3 3d75 ff56 1778 c4ed w.......=u.V.x.. 00000fd0: ee63 1f72 58a4 8b2d 4108 68e3 9cbf 1d2b .c.rX..-A.h....+ 00000fe0: 8112 3d18 e321 56d4 70ac e3a4 bad8 eb75 ..=..!V.p......u 00000ff0: dae9 f326 305e e137 1bb8 6588 53c4 37ee ...&0^.7..e.S.7. 00001000: c922 5adc ba7b f95b ca63 f473 d4fb b258 ."Z..{.[.c.s...X 00001010: 5926 c6cf 073d 0608 3b5e 45ce 696c 87fa Y&...=..;^E.il.. 00001020: 5de9 76a1 a51b bbb8 ebfe f537 3f77 fb20 ].v........7?w. 00001030: 572b ce20 a2b1 b0fc e09f bd02 2624 66d5 W+. ........&$f. 00001040: 59c6 f759 7043 1447 382c 8986 3fee b9eb Y..YpC.G8,..?... 00001050: 0f7e d0f9 69cf 7bc6 dd34 9d6a 3599 1cb1 .~..i.{..4.j5... 00001060: 4b0c 8056 69e7 849f 5322 7050 2307 c25e K..Vi...S"pP#..^ 00001070: 9214 c733 c8fb 4552 9bbd 79fd b0ee 2107 ...3..ER..y...!. 00001080: 7dae 9b4e 18cf 355f 3a93 87c5 2493 57da }..N..5_:...$.W. 00001090: 2ea8 fa78 046c 1bc6 58a0 e767 b14f 008c ...x.l..X..g.O.. 000010a0: 3b18 37df 9d44 b996 1097 ae3c da03 865b ;.7..D.....<...[ 000010b0: dfb8 1732 2292 8f40 f0cf 4c50 605c 7aff ...2"[[email protected]](/cdn-cgi/l/email-protection)`\z. 000010c0: 336e 5e7f 1395 edb4 13ea 9923 11fb ebcf 3n^........#.... 000010d0: bc7f 45e5 dcf5 859a 8b7a fb03 3cc7 9759 ..E......z..<..Y 000010e0: 8b0b 8bf8 9c9d a2f8 83f6 e78e e65f c0bd ............._.. 000010f0: a592 cde2 7bfb f308 5996 0e75 9d95 22e0 ....{...Y..u..". 00001100: 1ccf 0055 39b2 d7d4 2aa6 cec4 9bee a1d3 ...U9...*....... 00001110: ee12 d3a4 b9e7 de37 109f 5e5f 2f36 6c8c .......7..^_/6l. 00001120: b583 b59b 441b 1694 bf03 13b9 57db e958 ....D.......W..X 00001130: 4feb e1e3 77f9 d2c7 61aa ce5d e08a 55dd O...w...a..]..U. 00001140: 9e34 1abd 78d1 7c53 535f e649 364c c8f8 .4..x.|SS_.I6L.. 00001150: c0fd e4c5 22b5 27bc 4357 a17a c36f 504b ....".'.CW.z.oPK 00001160: 9009 3771 77a7 1252 6b54 73cc 6e39 3e4b ..7qw..RkTs.n9>K 00001170: d8a2 4194 ad40 d87a c3db 1118 3cd9 8544 [[email protected]](/cdn-cgi/l/email-protection)....<..D 00001180: 68c5 5706 86f2 4dee 8c24 3dea 261a 1847 h.W...M..$=.&..G 00001190: 39db 4044 cc85 9761 6a18 289f 1f52 7489 [[email protected]](/cdn-cgi/l/email-protection).(..Rt. 000011a0: 1f99 704f 4d7b 67e9 e668 c5e3 647e cb2f ..pOM{g..h..d~./ 000011b0: 6ab7 2251 752b c623 3c30 0504 9f36 d893 j."Qu+.#<0...6.. 000011c0: b941 1ebe bbc2 73ef 7850 d541 18ee e5e9 .A....s.xP.A.... 000011d0: 48a2 1efc 4691 6d21 9c66 76de 792b 8c92 H...F.m!.fv.y+.. 000011e0: 8594 47b2 edf2 0d60 889e cac1 0734 071e ..G....`.....4.. 000011f0: 073c 0acc 1949 e032 cdbd 1c6f e04c 57f9 .<...I.2...o.LW. 00001200: 2718 37e7 b1c7 79cf 6ed6 67a3 c396 1bdd '.7...y.n.g..... 00001210: 9ff4 5d46 e960 adab fb1f 079c c633 4e91 ..]F.`.......3N. 00001220: 5a5f 9b36 50f2 9810 d927 e483 9b8f d600 Z_.6P....'...... 00001230: 6437 4943 ff06 eb44 59d2 a56d b4c0 97df d7IC...DY..m.... 00001240: 7466 b5ef 84de 54b4 bb58 4717 36b1 5ce9 tf....T..XG.6.\. 00001250: a592 2362 752b d9d8 8cf6 4901 3ef9 b564 ..#bu+....I.>..d 00001260: d1c3 bbbb f1e5 3a30 cd28 000d 3d9a b085 ......:0.(..=... 00001270: c373 5c55 d791 f79d a71d 60ce 2c87 9a77 .s\U......`.,..w 00001280: eab7 b258 27f8 bd68 1162 9823 2328 e3f8 ...X'..h.b.##(.. 00001290: 4ad0 415a 73ef 7faf d7f9 df22 da72 3ac5 J.AZs......".r:. 000012a0: 09b8 7e76 2c98 8437 5a9d 5ad5 a80e 052f ..~v,..7Z.Z..../ 000012b0: 754a 8204 4556 7ecc 9973 c432 a3aa 8992 uJ..EV~..s.2.... 000012c0: ea73 587c f23a 5e39 f521 a918 257c e2b2 .sX|.:^9.!..%|.. 000012d0: 1f0b 107b f569 4675 301d da50 6cbe 8eea ...{.iFu0..Pl... 000012e0: cab6 042b e631 0cca fe83 ae1c 7bfe fbb8 ...+.1......{... 000012f0: 2603 7bbc 0905 87a3 44a8 f57d d253 7845 &.{.....D..}.SxE 00001300: 7e87 6ebb de1d 881f eb41 7a98 fcca 074c ~.n......Az....L 00001310: 8b90 88d2 8c7c d77e da09 314f c181 6496 .....|.~..1O..d. 00001320: c890 2ec8 32f5 80da 40bc e8ad 9b17 de5f ....2...@......_ 00001330: 2714 43ff 5923 0604 8e06 e806 8a8b 388b '.C.Y#........8. 00001340: 3769 3502 5321 aa55 f435 d407 096d 7c49 7i5.S!.U.5...m|I 00001350: 1a5b ef89 17b7 12f3 bf8f 3538 b909 d578 .[........58...x 00001360: 7eab ee03 4338 fc04 3484 bf1e 18ce 5373 ~...C8..4.....Ss 00001370: 3ac9 cb34 72a6 c5ff d0e7 388a 8e37 f4bb :..4r.....8..7.. 00001380: 5982 cad2 c8cf c7d1 c46a d856 7ad3 20a3 Y........j.Vz. . 00001390: d36d 3edb 1deb 7dd4 a862 9ccf daac 268a .m>...}..b....&. 000013a0: 612a 1437 d6ac f04a af79 44bf 741c 9b71 a*.7...J.yD.t..q 000013b0: 79e2 1917 c03c f928 ca26 ae00 3d61 7077 y....<.(.&..=apw 000013c0: 66bc 7fc0 8f03 7aef 965b 40b6 867f ae34 f.....z..[@....4 000013d0: d89e a9f6 7c68 6048 fe90 f1e9 c410 6eef ....|h`H......n. 000013e0: 35c2 d76b c447 5cd7 67f8 9390 f325 0761 5..k.G\.g....%.a 000013f0: e77f b30c 8d36 877a c55b b3d4 4063 affb .....6.z.[..@c.. 00001400: 5587 4ccd e9bd 6e4d 3d01 9f8f 1db9 e8f8 U.L...nM=....... 00001410: 4cae cf5e 65e8 5f79 f8a8 4405 d0a2 380a L..^e._y..D...8. 00001420: 1221 cfa9 0d9b f840 f2a0 8db6 aca4 0c24 .!.....@.......$ 00001430: 13b3 30d7 105b f0c0 ff7c b4c7 166d deb8 ..0..[...|...m.. 00001440: 143a 8e99 f450 e486 05d1 5e7b 6863 433d .:...P....^{hcC= 00001450: 1bc8 0acd 7912 99a8 1386 3039 1563 a6ca ....y.....09.c.. 00001460: 5942 1af0 3c5d 9d3d 152b be57 6c4f 2efe YB..<].=.+.WlO.. 00001470: 7481 83da 2825 2784 3fa0 4d97 b87f b06f t...(%'.?.M....o 00001480: da85 ff88 2af4 8ca0 da00 92cd 3b10 aea8 ....*.......;... 00001490: 2de6 906d 0011 ccfc 8adc 7be8 ce9e 8846 -..m......{....F 000014a0: 6fcf 5b57 184b 2570 7b9c ba57 2aea df4c o.[W.K%p{..W*..L 000014b0: 0017 5a25 d68d c040 38df ddb7 ac50 f2c4 ..Z%[[email protected]](/cdn-cgi/l/email-protection).. 000014c0: ef41 291f 178c b17d 8508 cf4c 8394 f3b5 .A)....}...L.... 000014d0: c89d 88ca 00a7 ef2f 9a6c 8c72 2f22 46e9 ......./.l.r/"F. 000014e0: 71ff df1f f1c3 91ed a982 5d17 48b1 e62c q.........].H.., 000014f0: 4d80 6085 4c9b dee5 adea 0619 5d97 f782 M.`.L.......]... 00001500: fce4 1b12 c132 2ef3 b5c1 2835 2738 25e6 .....2....(5'8%. 00001510: 840b 4582 c1d0 ff10 3f2a 3c3f 7322 d170 ..E.....?*<?s".p 00001520: 97d7 98c1 e012 1f34 9daf c129 b409 cdda .......4...).... 00001530: 7c24 b05f b44c fc1a 3560 51df 8390 fee8 |$._.L..5`Q..... 00001540: 53e4 63eb 5040 17b7 0c69 4d0a 2ff9 bbba [[email protected]](/cdn-cgi/l/email-protection)./... 00001550: ef2a 7be0 f104 3a07 38ef 8d1b 7e05 48cd .*{...:.8...~.H. 00001560: 8cc6 3b97 44c4 fdfa 8438 4a75 f7ac 0281 ..;.D....8Ju.... 00001570: b331 1a1c bdfe bd1e 9f15 d688 b04b 47c8 .1...........KG. 00001580: f1a6 2e99 767b d82b 2a31 e371 f524 6b3e ....v{.+*1.q.$k> 00001590: 36fa 4b80 3c23 e9d7 be23 8ac5 7b4d 51a2 6.K.<#...#..{MQ. 000015a0: 0852 b186 b552 3ff3 7f81 9ff9 22c4 a380 .R...R?....."... 000015b0: d157 6996 e688 f0c9 87c6 595d b8cf 0418 .Wi.......Y].... 000015c0: 16e4 6f58 de84 b15d 975b 496f 798e fc72 ..oX...].[Ioy..r 000015d0: e690 1eb6 2369 ee49 53f1 926b 82d5 f5ed ....#i.IS..k.... 000015e0: eabd 15f6 0535 266b 0cea 17bc 1866 356b .....5&k.....f5k 000015f0: 9725 c0b5 316b d7f5 030b 9dac 2b9d eca4 .%..1k......+... 00001600: 13a1 acd4 d740 fc85 8ca4 45f8 b595 c536 [[email protected]](/cdn-cgi/l/email-protection) 00001610: 57a0 44a0 eb6f 2261 7fb2 31dc 6af5 0dd1 W.D..o"a..1.j... 00001620: a8cb c75f 3cde 11da 3fa0 7588 3185 3599 ..._<...?.u.1.5. 00001630: 8301 8179 d3c7 b490 c84d 5410 8afe fcb2 ...y.....MT..... 00001640: 46eb de8e 824b c582 042f 742f a4c6 0ed7 F....K.../t/.... 00001650: f478 9d2a 524e 5f87 10bd 49e0 4c78 6260 .x.*RN_...I.Lxb` 00001660: f1b6 3e12 938f f37e 3ce0 2b6e b785 fffb ..>....~<.+n.... 00001670: 9303 d679 555e e187 6f77 43fb 683c a498 ...yU^..owC.h<.. 00001680: 0be9 1665 51e9 0e5f b633 a97b 0496 421b ...eQ.._.3.{..B. 00001690: dad3 33e2 e428 b847 2377 c7d2 c522 5bba ..3..(.G#w..."[. 000016a0: 7274 db92 75a4 00b7 891f 91c6 0ffc 450f rt..u.........E. 000016b0: 611c f45a 5e25 5fde a025 4f6e be67 4177 a..Z^%_..%On.gAw 000016c0: e414 956d a9c3 1d14 3398 1cdf 1b71 836e ...m....3....q.n 000016d0: e1d1 ff53 6c47 57f9 cf80 3ba3 1f51 1d2f ...SlGW...;..Q./ 000016e0: 3d3a e1e4 346c 47ed 48fd b050 f011 ecb3 =:..4lG.H..P.... 000016f0: 1b61 7da8 6fa2 354a 7700 3c4f 058a 1db3 .a}.o.5Jw.<O.... 00001700: cb92 acc9 0867 ffc2 4479 5832 fe86 5e0d .....g..DyX2..^. 00001710: b820 d226 7b3e 82e8 256a c255 7aa5 3b6a . .&{>..%j.Uz.;j 00001720: c5ac 8304 6c17 305b c8fd de6c 9aa8 35a1 ....l.0[...l..5. 00001730: 2dcc c073 cda5 8808 f04c bace 32cb 3a8f -..s.....L..2.:. 00001740: 5be9 c9b1 03a7 99c2 a0df af3b c84a 2532 [..........;.J%2 00001750: 3d1d 6f2f d7c0 bc4e a77e 0254 b46f 4096 =.o/...N.~.T.o@. 00001760: 0dac 71d3 baac 4f2b 155a 9497 9609 f1e8 ..q...O+.Z...... 00001770: fbd5 a6c9 b52c c54f 0ea9 524c 1503 af88 .....,.O..RL.... 00001780: e686 1caa 2579 0e54 8e04 d6fd 71ac 6a1e ....%y.T....q.j. 00001790: d7c8 8974 467e 3d35 feca 4080 49c3 ecf2 [[email protected]](/cdn-cgi/l/email-protection)... 000017a0: 3dae 82dc 03bb 5de7 bec4 334e 6a5d c8ff =.....]...3Nj].. 000017b0: 87e5 e2dc 6d7c ceb1 ee68 aa69 d20d 9537 ....m|...h.i...7 000017c0: 1b1f 4f57 0bba e6aa a8ca 3f46 b54b 8c54 ..OW......?F.K.T 000017d0: fa84 9574 b723 69bd 9048 b0b3 077b da07 ...t.#i..H...{.. 000017e0: 63c3 b537 e475 ff3f 834a a392 c990 84e9 c..7.u.?.J...... 000017f0: 1e5a cab4 3acf b033 eac5 037d 2afb a72a .Z..:..3...}*..* 00001800: 2bd0 9574 04e2 1d95 c0c7 a554 2478 a213 +..t.......T$x.. 00001810: 0542 660b dfbd 4ad6 a934 85a8 56df b304 .Bf...J..4..V... 00001820: 89bb cefd 4a8e b906 8aa8 3439 3d18 9dd0 ....J.....49=... 00001830: 8a60 8294 9aff 75b0 aa97 2efc 9f7f c513 .`....u......... 00001840: 8c61 5fbb 640e d992 67cf bfc1 55b0 25c1 .a_.d...g...U.%. 00001850: bb64 8710 9c4d d4fa d75e ae95 ae5b 524d .d...M...^...[RM 00001860: a3d9 b8b4 6f39 7fc7 8006 3eda 34d9 70f9 ....o9....>.4.p. 00001870: f790 80c6 6ef1 85d9 7a64 8f1c 734d 5457 ....n...zd..sMTW 00001880: 6fa2 cea1 910f d3ca 4492 f5d4 3d42 f5e3 o.......D...=B.. 00001890: 8a5e 57bf c63f 8afc 39a7 6251 7a88 d350 .^W..?..9.bQz..P 000018a0: dde0 3594 ef1f 8205 49ba 0b27 5b62 6083 ..5.....I..'[b`. 000018b0: ceca a49b c600 df3c b21e 4d0e ebbd 93dc .......<..M..... 000018c0: 20d9 30d4 ecf4 4311 07fa 86f2 b660 8481 .0...C......`.. 000018d0: 9537 a554 b827 3d11 5d20 ad05 123f 7e20 .7.T.'=.] ...?~ 000018e0: 6cec d6f3 f540 9953 9564 bf3d b28f 875a [[email protected]](/cdn-cgi/l/email-protection).=...Z 000018f0: 50bf 6941 f4f1 dcfc 3af1 1253 b584 b66d P.iA....:..S...m 00001900: bc75 3959 ece5 2daf f2f7 eadb 574a 535b .u9Y..-.....WJS[ 00001910: edef fc86 2916 560c 569a 3fa0 1af6 2c7a ....).V.V.?...,z 00001920: 864b b8e3 a4b6 3e5c 8b8b 625d ad02 7f80 .K....>\..b].... 00001930: c8a9 5054 b6d4 7410 e99a 871d ea2f 2de5 ..PT..t....../-. 00001940: d1b4 8f16 b283 03a1 512b b32f 3309 49ce ........Q+./3.I. 00001950: 0f12 d667 0716 6707 038d 8040 2b20 47a1 ...g..g....@+ G. 00001960: 050e 41e8 6e0a cc80 081e 85bc 6932 d7a9 ..A.n.......i2.. 00001970: 0f4f 3f4a 8bd4 c163 7442 d7e4 1084 0b69 .O?J...ctB.....i 00001980: a9d3 0e5d fb62 ed39 f315 29fb 6c89 ff4e ...].b.9..).l..N 00001990: ef07 0889 8432 e410 927a 6330 f6fd 664e .....2...zc0..fN 000019a0: 0b4c 3706 a419 3834 b426 71b4 142b d7c7 .L7...84.&q..+.. 000019b0: 1660 7ec5 a405 4924 b1f7 c722 85aa 3603 .`~...I$..."..6. 000019c0: 0e77 c1f7 e50a 1474 4e0b 1b00 7395 6191 .w.....tN...s.a. 000019d0: b224 063d 6b58 fe63 d5f3 a4c2 e21a 951d .$.=kX.c........ 000019e0: bd65 64dd bee6 7d57 bff9 7db3 5631 7283 .ed...}W..}.V1r. 000019f0: 14c1 3dbb 68e0 5b72 912c d0c5 2400 6bad ..=.h.[r.,..$.k. 00001a00: e600 da89 7415 53a5 2f8b 11bd 8cf6 c70c ....t.S./....... 00001a10: d24e 2b98 3b2d 4300 1e0c 003a da36 b7e7 .N+.;-C....:.6.. 00001a20: bc67 27ff dff2 43ca 7487 cb95 37e8 8e52 .g'...C.t...7..R 00001a30: 4840 3199 87cc 81a6 258a 7e56 03d4 1ffb H@1.....%.~V.... 00001a40: 4283 39da cc9a fc01 f43e c4a1 93a0 7b76 B.9......>....{v 00001a50: 77be 07b2 667a 014d 5c90 aca2 6b59 3391 w...fz.M\...kY3. 00001a60: e1cb f343 7505 d89b cf53 ed71 01e2 7af2 ...Cu....S.q..z. 00001a70: ae06 ba5a 000c 8d88 ce37 81fa 2ad5 1700 ...Z.....7..*... 00001a80: e4a9 b1dd 882e 7e7a fd48 0841 59a2 b119 ......~z.H.AY... 00001a90: 69f6 eea0 6029 d134 0a9b 5f32 300f b20d i...`).4.._20... 00001aa0: a7a0 6254 fa05 b185 c305 cf3f ba79 2de0 ..bT.......?.y-. 00001ab0: 0ab1 e248 2c9f ed81 4510 b262 a48e cb22 ...H,...E..b..." 00001ac0: 3b86 4986 96fd ebe2 eece 1450 955b 82ea ;.I........P.[.. 00001ad0: 9e41 8fdb 486b 1e3e 4b27 b326 3f45 db73 .A..Hk.>K'.&?E.s 00001ae0: c0af 66c8 0654 5bfb 751c e5d0 e0b3 9b3c ..f..T[.u......< 00001af0: 5fbc 7fb8 e0ea 932c 3829 d3ab cba1 4bdd _......,8)....K. 00001b00: e026 11fc 3950 d17b 9395 d052 8744 d1cd .&..9P.{...R.D.. 00001b10: e58f 6090 3c91 f94a 7963 d7a4 478e db77 ..`.<..Jyc..G..w 00001b20: 260e bd60 b55e dab3 c3f8 5e3f 9313 787e &..`.^....^?..x~ 00001b30: 2e03 5344 2bf9 e542 2b6c ad8d 45e0 e310 ..SD+..B+l..E... 00001b40: 59a5 5a50 12f8 caac beb3 37aa d94f 64ce Y.ZP......7..Od. 00001b50: e688 a13e c005 abdd d7ae 65b2 7f4b a316 ...>......e..K.. 00001b60: ae48 9244 a8b1 d6a6 0598 dbf9 d91c 1433 .H.D...........3 00001b70: d07f 9e58 824b df1a 4eff b951 8f0e 1296 ...X.K..N..Q.... 00001b80: df3e 83b5 cdfa cc48 0699 f50f 4709 2e84 .>.....H....G... 00001b90: ae53 650b eb96 3745 f309 86fe 4a10 acdd .Se...7E....J... 00001ba0: 555e 2ae0 62d3 2e42 fa5e 713b d3c4 6e46 U^*.b..B.^q;..nF 00001bb0: aef4 1349 37d5 78d7 2e17 da45 7c87 a9d3 ...I7.x....E|... 00001bc0: fad5 171c fd49 9a97 54c8 4766 bbd8 022f .....I..T.Gf.../ 00001bd0: 7666 2735 5cee f889 9ad3 58f1 5e59 81b0 vf'5\.....X.^Y.. 00001be0: ff86 cb27 2d99 fb0c fc3e a969 5c03 0c1d ...'-....>.i\... 00001bf0: 7a90 c677 a77f 88a6 839d 2ae1 52ca a777 z..w......*.R..w 00001c00: 6fc4 b0a8 7940 ea6f b3c4 dfc7 11a9 9d46 [[email protected]](/cdn-cgi/l/email-protection) 00001c10: 9273 8ef7 175e 30e3 ae81 a27f 05d8 d0e3 .s...^0......... 00001c20: 54f4 7e0e 4eb7 9f9d 1bec f66d ea68 653d T.~.N......m.he= 00001c30: e0bd 765e 6a32 2dde 8323 f441 cfed 33e8 ..v^j2-..#.A..3. 00001c40: 42fb 93f2 e46d 9753 e58a e821 971c 2e72 B....m.S...!...r 00001c50: b526 6492 f1fd b642 c11a a39b 1165 4b97 .&d....B.....eK. 00001c60: 194d e637 bf7a cd2a 8888 ed92 fa47 e6cf .M.7.z.*.....G.. 00001c70: 0ee6 a337 c0cd 3b21 ca63 e8d0 7d01 a3b1 ...7..;!.c..}... 00001c80: 2828 ddae b956 bbaf cdf6 cd75 eec2 d8dd ((...V.....u.... 00001c90: fb6a 799f e710 c151 5018 0be6 5f06 5733 .jy....QP..._.W3 00001ca0: 1048 a6b7 3767 8ec4 f489 d4c4 a272 5a1f .H..7g.......rZ. 00001cb0: e941 ce15 0630 e075 6c1a 27d8 b9ab 392a .A...0.ul.'...9* 00001cc0: 694f 6f24 18fc 9da9 1b62 6e8d 5a68 16eb iOo$.....bn.Zh.. 00001cd0: 173d 2db3 28d2 83ab 93ab c171 fee0 7c3d .=-.(......q..|= 00001ce0: b849 91dc d76d 855e 0abb d18a dd62 089c .I...m.^.....b.. 00001cf0: 2b8d 13d3 32f2 b1ef 363b ac52 65b6 1f64 +...2...6;.Re..d 00001d00: ce78 54fa 8019 567e 1341 de84 571a 644f .xT...V~.A..W.dO 00001d10: 888f 525a 37c3 ee72 a08c 1a86 f356 8ca2 ..RZ7..r.....V.. 00001d20: 7671 137f f718 86e9 6ce8 e6f4 90d0 4bb6 vq......l.....K. 00001d30: e3c0 00ec 3d22 e956 d348 6669 dc3c 5f6a ....=".V.Hfi.<_j 00001d40: 82c6 3f6a c8b7 dbb1 72d9 7ae8 0cdc f023 ..?j....r.z....# 00001d50: d7dc 7bfb fed0 3308 982f 6e43 461c 0969 ..{...3../nCF..i 00001d60: cca4 3d7d f6a3 1376 dffb c284 26a7 47e2 ..=}...v....&.G. 00001d70: 1ed1 e6fd 16e2 d77d 4374 aeb5 d94e 1f49 .......}Ct...N.I 00001d80: 5070 4660 d56b d4ec bf34 239f 9a56 bdf6 PpF`.k...4#..V.. 00001d90: 060e cd9f e68a 37b3 1638 10f2 72fb 7aac ......7..8..r.z. 00001da0: 6279 e086 c50a 4fb6 6c14 eb5d b6a9 71bb by....O.l..]..q. 00001db0: ce55 14ea 5a79 4246 a3cb 96b4 e02b a3b9 .U..ZyBF.....+.. 00001dc0: 5d4e eab5 677a ea09 9509 0b86 63d3 f2bf ]N..gz......c... 00001dd0: adf8 f6eb edc3 2f9c 558b d2f6 3c11 ee16 ....../.U...<... 00001de0: 0088 3711 9287 f32b 2a64 19da 419c 2a01 ..7....+*d..A.*. 00001df0: c685 685c 4256 eda3 be88 16af 9099 78fd ..h\BV........x. 00001e00: ffa9 4cbd bf92 be20 cf16 6980 65ee dc44 ..L.... ..i.e..D 00001e10: 50f9 f2e0 b9d5 3ce5 0d3b 8b87 52cd 7376 P.....<..;..R.sv 00001e20: 5cb2 cc70 b790 3a7c da8f 4c54 73d5 33f7 \..p..:|..LTs.3. 00001e30: 4cfa 0f49 897f 19cd a2ca 45c4 351d 52b5 L..I......E.5.R. 00001e40: d58a 3bcf 97ce ff16 c7f0 078c 77b5 ab08 ..;.........w... 00001e50: 6020 dd7f cb76 e335 115d b73a 60b2 9955 ` ...v.5.].:`..U 00001e60: 87b2 9756 2ca1 1903 a025 5165 fad2 bf41 ...V,....%Qe...A 00001e70: 7362 e7b6 11f5 487b 253f 58e4 7937 c614 sb....H{%?X.y7.. 00001e80: 45e3 cc13 d04e 1e36 6fd5 4d77 c1fa 06d1 E....N.6o.Mw.... 00001e90: bbab 0aed 1c3f 3368 d42c 9bf1 6125 503d .....?3h.,..a%P= 00001ea0: f582 e338 cb31 9d5d 4802 4693 6c23 505b ...8.1.]H.F.l#P[ 00001eb0: 1d0c 1066 a3b2 2bea b3b3 33ea d2ed e036 ...f..+...3....6 00001ec0: 44b4 613a d397 9abe c16f 9f6b 15c5 97cd D.a:.....o.k.... 00001ed0: d4d3 105a 64f8 9c8a 6c23 f561 7d7f 8b11 ...Zd...l#.a}... 00001ee0: 88f9 52d9 2c45 92e5 2431 2d9b b6cb e8cf ..R.,E..$1-..... 00001ef0: 0d61 7de2 1541 543c 5850 c346 234c 35db .a}..AT<XP.F#L5. 00001f00: 6c63 bdb6 d915 9af4 c347 1e35 a491 016d lc.......G.5...m 00001f10: 7406 35f5 a0b9 673c 4d48 7c4e 0a71 d59c t.5...g<MH|N.q.. 00001f20: 9ebc d342 132e 7115 9f08 a85f f7c5 7640 ...B..q...._..v@ 00001f30: ed0f 143f 8b92 6250 df8f 378e 5e8b c6ff ...?..bP..7.^... 00001f40: 835e 3548 f042 bfa8 37ad 1171 41db 90f1 .^5H.B..7..qA... 00001f50: efe0 424f 3e32 23b6 74f7 0d9b 290f 5b35 ..BO>2#.t...).[5 00001f60: 93fd 7c02 25d8 b4ee 2378 5cc2 bb01 f340 ..|.%...#x\....@ 00001f70: 9b2c 4e54 d6af 66c6 b63a f6db 3774 a5b4 .,NT..f..:..7t.. 00001f80: 1bd5 f901 45ea 212b b983 a4c9 ea2b 336f ....E.!+.....+3o 00001f90: 44cb 79e7 1d1a aa4a 8de1 eca8 2ef1 48c5 D.y....J......H. 00001fa0: 96fd 9ecc 919a 54ce 6aad 73ef 7a8d 0d00 ......T.j.s.z... 00001fb0: 4cc7 3ab5 564c aa1e 1932 c175 a621 901a L.:.VL...2.u.!.. 00001fc0: 8d87 42cf 06df 968d 002c 7c0c 2da8 20cf ..B......,|.-. . 00001fd0: 83d9 0cfa d19c 129e 3be9 c68e 7683 32b5 ........;...v.2. 00001fe0: d494 36d1 ec47 33b9 2c04 8d51 61d8 57aa ..6..G3.,..Qa.W. 00001ff0: 3ac6 0d46 a1f7 ad3b d84a 1422 dad0 7e9d :..F...;.J."..~. 00002000: 6be6 2745 fd24 d361 102c 5fd9 a8cf 19e1 k.'E.$.a.,_..... 00002010: 6a30 2d9d 9baa 1133 c8c4 2b3d 4e35 0820 j0-....3..+=N5. 00002020: caaa ef4f b16f 9035 90ef a81b 086a d606 ...O.o.5.....j.. 00002030: 8b20 a03a 1a8f 0bb0 9d23 456a 739e 51a6 . .:.....#Ejs.Q. 00002040: 01c0 90bc 3b89 9727 b554 870d 0906 9bd3 ....;..'.T...... 00002050: d642 2207 aef4 9705 79fe 37c6 0b48 2165 .B".....y.7..H!e 00002060: c6b7 3f50 6e9d 71ee eb98 920a f977 23d4 ..?Pn.q......w#. 00002070: 6f26 0369 3fa0 d89f d4fb efd4 9898 e4b7 o&.i?........... 00002080: 9ddc 5e94 17e0 5853 10c1 d392 0526 8b6f ..^...XS.....&.o 00002090: 87dd ff7b 955b 3225 9c41 2d43 b07b 9d51 ...{.[2%.A-C.{.Q 000020a0: 921f 8c3a 2109 a229 f34d aa42 bf59 7510 ...:!..).M.B.Yu. 000020b0: 7d7f cc88 e92a ffcb de55 84fd f3fd d0d0 }....*...U...... 000020c0: a9d9 8bd3 0d7f c127 984a 912c 3940 ce3f .......'.J.,9@.? 000020d0: e2c1 fe5c 006f 1530 f5ba d203 8de1 8924 ...\.o.0.......$ 000020e0: 515d ecf5 99dd 3ddb 7be1 dbed ef04 1048 Q]....=.{......H 000020f0: 9c24 fd19 5c58 38b2 9fca 4f26 0590 d4cf .$..\X8...O&.... 00002100: fbea 2713 0f4d 5a90 c379 2123 15bc 09e2 ..'..MZ..y!#.... 00002110: 924d e552 fddb 6488 90c1 f2eb baac 3e2f .M.R..d.......>/ 00002120: 8f03 8d7b 03fa b8b4 4c00 0000 983d c704 ...{....L....=.. 00002130: 8db2 d015 0001 a642 f0d6 0100 6343 5a38 .......B....cCZ8 00002140: b1c4 67fb 0200 0000 0004 595a ..g.......YZ ``` base64 of the file: ``` /Td6WFoAAATm1rRGAgAhARYAAAB0L+Wj4GtvIQpdACaVCW80dvL/rUFQDibyJ5SAx02oBeTunzjZ 824DXbLTLqDDzGoWfMprNue6aqx7/cNDiMntauVPQjsvvizNFlWIHzq6Nd/eet9/c9tTlHST3Lnz DNZBQwcx+W5rk0sTTc0HvUtMsxyCojJ2PPuxH7BPp2RWQGxD5+K7K4Akmp6eG6u8P1MyKjcLn0+5 KvQ7sH7c0zlRl5x1D6jyVrP/sIGsw/lEUp/XlqcRYOrmM+ZrDN4OObz4Z/yOvuh90Y2EWbk3IyyK 6gIdB9iStQ+64aMLzAJ3nhJJ+z41Sn4ezShe6+WGNTgpGpKESX/IIfXCkY0o0VTJdbge/ftwctH6 COSMWvFeo7T/pXETMV9DQrGlXwy5pnbSUDkxUpNg9WJTLc7BV481Yqy9f4KVUnvnvSRBfnrmVPGi LNqIyDTn5b1ImarHzhP/EW6tXCqQ8/Fy9i1c7t+f+DRJx5zNRKYQUz1hm5dGNJ2MCag5ARKKfogS O4QndnBGfUfYNv0kugZUmhXixeYYp5wwseBvMuBV4W8Zd5q3rfsbilNrd8fD8vxTof0oTaEG6Jt3 nkTofcdh54z1En/v8myCSKJxlfr6Td1W5rF18rpFjNxUixrqrkuQHTzGA/2bSAQxGfacTd/NHS7Z 69/Sw9SHsBcgFZEara6Rmj/AoPmqIOO2AXwpbxFYOTISygGTHQoJcxcdjsekzUPWmVlLvJTbUpcy QeY3e5l/XETRDTCgEZ/P3ggFVr4LYoWc7Tc9MzRNYE31faW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u6sK7Rw/M2jULJvxYSVQPfWC4zjLMZ1dSAJGk2wjUFsdDBBmo7Ir6rOz M+rS7eA2RLRhOtOXmr7Bb59rFcWXzdTTEFpk+JyKbCP1YX1/ixGI+VLZLEWS5SQxLZu2y+jPDWF9 4hVBVDxYUMNGI0w122xjvbbZFZr0w0ceNaSRAW10BjX1oLlnPE1IfE4KcdWcnrzTQhMucRWfCKhf 98V2QO0PFD+LkmJQ3483jl6Lxv+DXjVI8EK/qDetEXFB25Dx7+BCTz4yI7Z09w2bKQ9bNZP9fAIl 2LTuI3hcwrsB80CbLE5U1q9mxrY69ts3dKW0G9X5AUXqISu5g6TJ6iszb0TLeecdGqpKjeHsqC7x SMWW/Z7MkZpUzmqtc+96jQ0ATMc6tVZMqh4ZMsF1piGQGo2HQs8G35aNACx8DC2oIM+D2Qz60ZwS njvpxo52gzK11JQ20exHM7ksBI1RYdhXqjrGDUah96072EoUItrQfp1r5idF/STTYRAsX9mozxnh ajAtnZuqETPIxCs9TjUIIMqq70+xb5A1kO+oGwhq1gaLIKA6Go8LsJ0jRWpznlGmAcCQvDuJlye1 VIcNCQab09ZCIgeu9JcFef43xgtIIWXGtz9Qbp1x7uuYkgr5dyPUbyYDaT+g2J/U++/UmJjkt53c XpQX4FhTEMHTkgUmi2+H3f97lVsyJZxBLUOwe51Rkh+MOiEJoinzTapCv1l1EH1/zIjpKv/L3lWE /fP90NCp2YvTDX/BJ5hKkSw5QM4/4sH+XABvFTD1utIDjeGJJFFd7PWZ3T3be+Hb7e8EEEicJP0Z XFg4sp/KTyYFkNTP++onEw9NWpDDeSEjFbwJ4pJN5VL922SIkMHy67qsPi+PA417A/q4tEwAAACY PccEjbLQFQABpkLw1gEAY0NaOLHEZ/sCAAAAAARZWg== ``` [Answer] # Gzip, 140 bytes The following 256 programs were written by `for i in $(seq 0 255); do self=$(printf \\%o $i); comp=$(printf \\%o $[i^1]); temp=$(printf \\%o $[i^2]); cat file.midi.xz|tr -c $self $temp|tr $self $comp|tr $temp $self|gzip --best>file.midi.xz.$i.gz;done` and the zeroes' first is the longest: ``` 1 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+2a0QqAIBAEb/7/pwsriCCwJDWdeSpDut1b78mIFYgE6Xl/ORZERB7j8Bi1Z0yfUTx+ToHX2plHal9VoTEm6vdyaeyRkZZxkmaa65ilzwY3Tw2Fok2aUTckxkFXMnZw94UahdpJcfhYrRS20z5/7MXpXgTX37BdmlgArmDAAkwhAAA= 2 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3WwREAIAgDsLL/0r49BxAxmQCBK1ZtUtyRtvXEQJ6c4ODlBMDhACvfuyJfYxCEmBb2BJibChEduCU6rj3DYzHfrsn58gUGxsq0TCEAAA== 3 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3UQQ7AIAwDQSn+/5975IaqgqCC2Q8Q7E2qGqlDyQ2fRKd1zS8M+rb3t8/D7PHEZPjOq0zWMNYAbuXfs4iMjzAtAhOAugB7AKpA11ApCApQ2+T4VPAD5gG450whAAA= 4 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3YiQ3AMAhDUcnsv3NXiNqiXO8PEIGxkUjVa1LYkKgIwAEJjPJsVFnc0QExW1CYay51ZIy3OQgRQiwwxxzYE8SAV7+2lJmSWRqdWuaCNDnh1Q5wHha0wm8f6aMPPajwTxRMIQAA 5 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3Wuw0AIAwD0Sbef2UkBqCh4JN3LU1sjoiqSQqNiDR964KnJ6usG+NbiK/J5MbAEnAEDFNTn9y5oXtKM/TrFZCv0hwYK1cGtLcAAPAn7d5BVicDTKF4x0whAAA= 6 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3U2w2AQAwDwR+n/5bpAOkEBwnMVhA/4qplUoBesPDXnVD31ilke6iZVr54hVU5mVT5/pnYTMD3AfDNL2k2hLe7xNK+psiGL8M9yVQpUdzr92aY5nxja+wjgKemIxOOPOEAlkXLPkwhAAA= 7 (base64 -d|gzip -d)<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b0BV0qTLPGA4s9t6lgPJ/47PDA13FFiFMIQAA 69 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3U0REAIQgD0eZI/y1dE3qivP3XCSGk6nZC90kbUoDCYAjQOnJxcnBz/cSEOZ3HydaHuW09GZem4ceZf7+OjRjgvGIdNtPJ2BH4DyFcE1XRhhomWFk8zgcDkLy4TCEAAA== 70 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+2V2w3AQAjDlvPtv1JXqKpWJcH+PnHhEThH6mFXntjxNQPC8PhsaCC6oSBXtiX8/A3zVLPLMd54F2WKZt4WgQ7SZsm/UlctiZxMh0UciZi8tauI3NwEDNDwXWiXocTfYnKktsqjsqg/cAH1MSz4TCEAAA== 71 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3XMQ7AMAhD0dvh+9+oW4dOrZSIory/JQtgO0ipukmhgby4AVanbGqRvwmbPfI9DhFRvZuftmAfxGlqwbT0+e2T5cni3BWR4xWAKIPCszRlBWA1WOejzAqfekaOWGIlF7eNU8BMIQAA 72 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3UsRWAIBAE0e6G/juyA58mgPgnhYDbnWMM7Eci0AltwJRzwk2Rd4/vydXmDmxN/H0yAFZ61quD9t2D9IzZOUYBVkEx/wkmOcN+41vtdbprMQqqMduZXOIOmj5MIQAA 73 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3UgRUAIAhCwfVi/4Vaonxa9wdIBGwt3CM9B4d3qvbiohFa9ZRwGWIH4ICZB/FCL6AGv5siBgdhYajVwYczqvpxrU/+YxIrNS99JUbJxsi/qmgDHHmfw0whAAA= 74 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3WuREAIAwDwfbk/huiBSIeey8kEofsoWog2To6GwDs0wO82mdzYX9ZtDx+8ow5kzGKB6iOJ52RNBru0pj63zMKDHJxOaVmDHYRCtrUI4wCPVjQRwXTTCEAAA== 75 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3WURUAQAQEwH62f58r4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BbMgkg+QQljmDGGzMvD1OUrD87MboxMIQAA 117 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3WyQ0AIAgEwKbZ/i3Ar8Rr5q9RXIhVs1STto3hTHHYey5tPgHmKOwIfJTgldtHKeHxoaJX1VpeaHvZKGTzei25IZQ56EAREvARYtmzRAa+MwD+XASHTCEAAA== 118 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3W0REAMQgC0aax/2viPsS8LSBBhElmGknx6be8apos/18ZEaH2yAApEJrnwrLO7LAdAICun5F3+YAXeVhfRs6hti/JV+ZtBoY3qLLYmk/FxDqhL0ZexQdcykl9TCEAAA== 119 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3UwQ0AMQgDwa5x+1dCfpwsZhsINhtm3mQWWHmkYdKeIs6uSCBwSCBY7P9VaatRoFCehQWTxI9lMexNEIDgAOCU3VxA9HmntFCkN5hjvMsHQW1AhUwhAAA= 120 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3VgQ0AIAgDwa3r+s6giQnI/QT4trDWNPLH9PnoUYDdQwbx6JrlVOiTSnV/WkaLd+4MirKfJRlXGmijhj/gILl5m3/FgQvgIA1cE7EGUbAssiggrdn0WfsMTCEAAA== 121 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3UQQEAIAgDwNqsPW8bCNwlUDaoAiaLEYgauWrNB2lF/dQTpxlU9cAv4g2qJhZ4G6/9ziFYEIsqUp83ahZrnQJMh0whAAA= 122 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3VyQ0AIAwDwbZN95SAxAMlYbYC4yOsBeCGUAzZQnYQ+lj7oy52JDc8iD+Mwac/HM4RpcE4tWn0RU0PmY1UGQxQaidhKzVV7YjeWaNXVBO8AS9V2oBMIQAA 123 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3UiREAIQgEwbzZ5C8JPaHoCUBhH6pS9/njjyYsWhVS8U7JTDZPHrAwT2LPj+FyhEZSByfO2K1VSmsL2atxByfIvGUBF4G2vfW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3WTOdOz8+G2WCcV8EpO+OTjZ5tf8hEfKUuNORt9YWI9FaNB/jI0SJMIQAA 138 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3WCREAMAgDQfvBdVX0ge4pgDwMVcBuQgLW3Jg5ROuYoFAfP/U17++ldXAE1MevJdh8Iip5eAYo1eRNHbPjYofF4KmUsgIC0WewBYI0LClMIQAA 139 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3UgQ0AIAgDwf3p0i5hSID7BcT2oWo92TdnCv+STmerqqMzDUAIqQGWDuAqyIVL9YdhPj45gYj4nI1peUcxdgd8OGps9O46YRoPy/H6FEwhAAA= 140 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3XgQkAIAgEwP116WYIikzvBgi0NymTEULtzG6rGAipQkB64bscGyIEZasDoRfcmhzhAui/Fw6+9CWXhk0GvoCtHoS4e2qI1fvT61zCAnMkMfpMIQAA 141 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3VyQ3AIAxE0f4lpud0EHEijPP+HdnMAmvhhZRNyZfX6BO+c5vfOpnhNubgWZEGUP1HhlQocyuCIAjokDzdg6Irej5f8dzrYmQeg12UG+kBZpZBIzwfEKs9HgE3CnNMIQAA 142 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3WQQoAIAgEwP/D9udeEHQxMGeOQZHmQmv9K0+2AN0CJuh6DwOzEAGu7KrmAAC//DnTvQCXBMRfcxQxdai8Gl2HOcelGPyqinN95gZXoXNKTCEAAA== 143 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3UwQ0AQQjDwP4/pOWrYiWOjBtAOIGZk2TA6X805upYYNELSuvih/96eIHqgtrXu4dNGuWI+sijkM5KFArQIFHC2FiE6H3H0h4QlNLR7OYDGWVZeEwhAAA= 144 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3VsQ0AIQxD0f0bszIbXHNCAeu5pIF822Et+qdAcCP21DiU7/Poz2sPycTD7CmM6q27pcM5kDHhJEtYU6gq7MKq4LBjNX4Vd8neMFkvuoiAXNX928QUXPAw+/CoG4a2ppJMIQAA 145 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3YsRHAIAxD0f07tHHaNBTkLhzGTwvEkr4oMgbtUdzw37mpbfTyHglr1KAfrLxyEIYJ9bs15f1FxdZMBEaFlS0wVVGMcZ9/k2etIpp+QZOeexNqf6Jb9YOZQ4PKtu/kRjgyN/HF1QOz/7inTCEAAA== 146 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3VsRUAIAgD0f27uLGlpZ3C498Ekhy4Fg6ZPnw40EsHhVEQnaKOroHZhzX3N6T2BDxA86rCLViU9wbbC/jkoUNo9kuUUS0hrQRQXhUG90hpA7ywxsZMIQAA 147 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3UyxEAIAhDwf6vpmF78Deom6sODMmD1j5Rhh9ph/8sxwERXPjEJa4KDSDGpUO2ZvpTFraLEE8ViZ15qKNTC1V628+wqfykkQMs6f4ks68EpKtmGjvoONekMBeR0gEg83UJTCEAAA== 148 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3VsREAIAgEsP3bZ2EnsJQTLunsEF6s6pTrYZzZ1buqpmod4L02FptxTYv8AfB2SVvUvjZEhbXJk0LsNNP4rdJI26qpm5WgKZpOB712T5NMIQAA 149 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3VsREAIAgDwP17sq8zeDQo/72FkkjVjVRH7zRjGOTeAUbgdAIm9CG669/xxoAa80J0IvQg6wini2g1ACzcnt/s9wN7N7keTCEAAA== 150 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3W0Q3AIAwD0f3/nX27QVWpKpDm3QIQ+4KouieFR8SFQGV2opXeRNy56tL3nVl8fGYkCGV0mT5axobe+QIAjd/DKOxVHvkqxJxkQ0bqkFGLll9PB9AXXD6VC+BL7qlMIQAA 151 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3WSREAMAgEQf8GwG4kkOcW9ChgD0iqNtAFARoUMgy0mOGqjsPdaYYZkLp8Ud4L3FgDTefJIkdEp5OUZSuyo4CzMY7uUMCPD98p60ICD9SgIwRMIQAA 152 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3VgQ0AIAgDwf0XKOu6gzER8X4AbeODVe+RGkTEVq1n+Jw6NlPeabD1hg5A+6FOu0TWqT4/V/R3o6dkMVFygjzbCfJIz5hYvmsD2C2Xro8tQb4bCoRuvQz48x0W+SwLXkwhAAA= 153 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3TQREAIAwDMP8OVrdI4AcbJAY41rYKOovvubWQOXLMPB5nurwY/bRaf0RqoLD83bjcLrxZoRZTjysmsCRXRdzQfhDJrL3t3liR5z2kTCEAAA== 154 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3VAREAIAzDQP8OOreo4GDbx8GacFThIpl9URiG54qWitn2umwXblRhD2wVHm1OODk2lBa+UMHO0JSJNQs/xkSnVRnDky6Ehz0f1gHLuk49TCEAAA== 155 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3UAQEAIAjEwP4VoKwtFPxbA/bTqrl0pdPXpXSs2IDTPSioFwaHBCAbQL8E4skqZoIPAJriYdmRYuBi8AAm8YyY+8S8MFZwAFyduaxMIQAA 156 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3TQREAIAwDQf8Wglk88ICW7glgSC5dCy/Jg1fyYwW4KizDJBopu4DNaavmX6MCwVXKbDOpqT60MKWIGvkzNbg8AFzvFGcxHXcK82m7x3Q9ijj5IzZU1D5hTCEAAA== 157 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3ZSREAQAgDQf8eiNd1sUDRo4Ac8KFqIan1pF1vZNMnIZbjOGKCsvEAuqikP+Vn2kCOIheFy4dhmtVHa9kBwKoCcJo264yYT/TFD7bFmgemIbXrTCEAAA== 158 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3VgQmAMAwF0f13uO7qBoIi1Oi7AVLyL0nXwm7SHc2A2SEQcy0mEsvFqxh0gL8H33sqRdD44SDLLdj4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+KGA8zQIEAzsCaaF3qEdyj/hFJs4yjNjQ19HbBIVETBFhMY58LVTCEAAA== 166 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3WMQ4AEAwF0Pvfo+5pl4hISKreWywGviqtsRbDyE5q5ycnWO8zaatZQMekVvFFouIMF/H9dqCdOTlKh6tQ7iYpX6D0YxE/bdY+fPGQHKB5MNMB6vy440whAAA= 167 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3UsQ0AIAwDsP8fIW8yMjNUFNU+AESTshZ30u4gpqSRh0+LRBi7uMoIJTuTmmtsrC+R//oT5Ueg6JqHGhECByU2r5H5qRo03YyY/LEBidpODEwhAAA= 168 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3V0QkAMAjE0P0XOdfsDkWKbV/+BZEEq2aRo2N3EIuD2HhZhLRLEonMXkb++Eml7I5EK9ChLwJVOAlALkz2LULRMGgw+qauS2YAHSzQOlTxTCEAAA== 169 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3WgQ3AMAgDwf03wVtmhioSguZ+AjDvKFVfSU1gxhTWsSnYt2D29CWUh47CUhcARqnGXrmAYgIENVZ6lt0DRPt17ncr5ak7RTMBXw0A6e5Qupscz8QVB6XVvU5MIQAA 170 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3UAREAQAgCwf5NsOXHcOT3GnCgMwCAMkKBTqmAPcAaRBWNbMCv4OE3sdbR21AM0r3cEBOeCdiRl+Yuom7m4ANu8gAM6CCPTCEAAA== 171 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3XQQ4AEAwEwP9/xX7SA0TigpSZs9CktaI1doqi58fEfMDLyZcqhQJUSYaox3QCbp8eKAT4J8VyNYAknmcH3QBOR0l2bTyu8sda1gEOmLZBTCEAAA== 172 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3WAQkAAAgDsP5VfElTCB62CP6iyW8TuGuDfqEHwga9AwB8KpgkALjMjn5FgiOC0pWSG6UWlZ4Eb0whAAA= 173 (base64 -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P4K0EPKw8cvn6oTCEAAA== 180 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3YwQ0AIRBC0f7bwQa3Cl103r+bzCAQ41r/k6PHAKC83W7tRK1coUmqV83eSXlQjFQdUBaPXDu/rAN4p5b9unkzjpc/rMatQ5Kd8feRjdqFe61ih2MCUQhlfI/w8QtMIQAA 181 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3VQREAIAzEQP9+7vzx6g8DnW4UQJpCMjT4wwwAeKsdX1Dmq1mKoDRA9qTzb+Xu3FjsDCy2VBr23a6WDoBPeKGFmuGByh5YlklITCEAAA== 182 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3WgQ3AIAwDwf33cfbrCBWoQk24HwCB/QGqbiEFBUhCOxjbe+weH0eem32hJPglpZHVkQ+vioRX24c1YOhxo2fioRaXM629vx3Rqmca3TyJrGjVNPIo/9fexNyf4wF2U2tZTCEAAA== 183 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3VwREAEBAEwfwTsukJwEOVB+eqJwDcGmsMYCUi6H9H2axDAqBaY3qVYqSByH+fk8Ao6UZkAGgSk+ojHlw5DblwX/wzObkKNGjzfDNYGvVOim2cFzP6Q/oxAUGKdiZMIQAA 184 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3UQREAIAwDQf+GUntI4MWjYdcBR6Yz7BIJgO4L48xJaysiCIadAvRdg/gj1lf2428j6SsWlsR/M4g+G5/ndnCdQdVIDu6rLLRMIQAA 185 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3VwQ3AIAwDwP03irdjAP4RWHf/Sq1tygyXiACzpSTeFL5JFh93sABcezKlIdh8WrsBOhfWU9GOMoz5tS+zyf8TdWWgUJQNbP1FDtyaKR9MIQAA 186 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+2WyREAIAjE+u8odmcLfkRYk78y7OG4Vi3UnqTRAhIEU0JE4CRJ85Jv5GOitXzWcZ75Rv/q+M6L341I3Tm9EY00nHVr02ELDJpEe2OYR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jASig46y8i0d1VPVQCbiV0gbcCyUvP1bnvhqi2o9BdBe3pN3nhcVfYX1QBdO3aLn3sx3AB+7BhAhhisQRMIQAA 194 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3VgQnAIBQD0f23ips5wQeptlp8N4BicsHWMENEAAYZhWQ0AUVC57ikfB7+IbuwAaCnwFD1nLL3sAEYmpGRfP6zZN/VwCua5bCN4XRnIq2Ln5P1sTw4pwNU9XZ0TCEAAA== 195 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3UMREAMAgDQP+2iLFujN1z/DsgBGZYEQEtnYliaxiCura6qCR4DhUX5wNUxmBtUhUrugEXrySuDJ8fNNZwKABfD1UltItMIQAA 196 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3XwQkAIQxE0f7bGhvbDgRxCZG8f/Ni4swk4FqXZHMqoLxgHzJRw/AN9CaxMKBVdiKIQKf1ndbdARi6rPJYv39dakXCpw/8LXqX7MMoGCPMMVtYj0UimTTc8gFyGoHcTCEAAA== 197 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3WSREAMAgEQf++WF+xkF8I9ChgDyiqAFwR4xIBYUOydKNn4WIx8JHf0Zo3IXOTG+Iaqybzi51VU7pQzh2goCze9SREwSw8pNvZpwMrhAugTCEAAA== 198 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3WsREAMQgDwf77kvtyD59Y8HuxA6RjGJ+DaqICbahgRlehEwwriUQxgIdLmO+vsqmdWArhenOE+/+FjglQqChVo2athCwJ5ooMXknyAB8BRfWKoH4QF3WPZD1MIQAA 199 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3YwQkAIBADwf4bM21ZgwiKZvYtmPOSPBwDVYQgAIDiR4N9WA1acuEmgWG4neN5xvVKwRKA10KUolnVUVUiwgiAGvWcn8tN6/JzTdvh/6SmtpluP3o6TCEAAA== 200 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3UgQ0AIAgDwf0XK2s5g4kGMfcDGOgXq/ZI4UB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gWyacDheYyJsPeP5C6EwhAAA= 234 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3UyQ0AIAgEwP47XbqwAxM/CmamAq6lCkaKEfSapYUgDQD+oR4ZeAj5+sgiFwP3l5sFZvSBc7qLmIGyX7YaF6Zaawda5i7Sj6BobWcB4u4kF0whAAA= 235 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3YwQ0AIQhE0f5blSaswGAMF+H9q174M5jNrtWFeDgZBQ2ABQax106ooSGdPs5X9Uf/IG5moBiqXT10cKosti0f0ybAw1hqhMNPQxQcbW3CionJ9Brav/YWH0Ibl+zn6kwhAAA= 236 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3WCREAMAgDQf9Wg4nKKM+eAgKXTqtOk7pOzAQX7pEn7gePw2ZxNQcrakhk+JdcWU9G7D8MU7P5iThGnSmBuArFAxOksboO0egDxfww8gMtUWu8TCEAAA== 237 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3VAQ0AIAhFwf5d+R3swNQxdpdA30CrgIZIADYIw2orJNhRVvvrZTN8DWItPXUA+Hzc13mXVIrK4CkaXUJdno1EdPziAFZs+thMIQAA 238 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3VCRHAMAwDQf5cZQ4l0U6VeA9AYusZz7xOBothP2S94/Gc2tT02iLozf9kubyi/7MiIdD5c2uRWH40W3TZ2tQBVMDedICghLL0utxSnvXYkjtSlfLIY9VpfwCfZDjDTCEAAA== 239 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3XSREAMAgEQf9mWQvxkE8C9CiAPaii6oIUbqEdxL7lYKrr9o3XODvMjDR/tE46rRLOOfy0xo9O5eUIaR7VPBspqq/lgMyBw5Bsfdh2HGKSSd8gKLtq/wP44tP2TCEAAA== 240 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3YgQ0AIAgDwf2XrSu4hAbB+wVobQOJa2EYYdurd1UcQiAw3gUhfa3oYCgSGeLRIgFcmOrZEcWhofmz+KnX45YC/Taqb2TASgHeKlZKHaW/ndsTNzf29XBMIQAA 241 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3VURUAIAgDwP5tWQNK+CFwV8DHhloFPJFzB2OFGRBdRLtjori23gkJGU+yS/vVkZDg422Pq2ofTqemAQD8CkZH5w1U9GNdTCEAAA== 242 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3UwQ0AIAgEwf67PTqwAn1pAnH2TyTrcVU4knsjYRMAOtT0g0bW8CRRwSZPbAIANCTrP5lIh90ihZJIw/Z9XwFXpuUgv113dkijWIM87oNMIQAA 243 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3VsRXAMAxCwf3XNQukdpfGEc+537hFCOG1XpDt6aBKTJcFuc0puwb+W2jARK5yJJhSrjuYc+90kgigpzFSrk/h+mNtHhDwIa8Y/Yk5bJYOio+pjBMFhs7vAdiZ7bdMIQAA 244 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3WyQ0AMQhD0f7bdRqYAnKLJht5/44EtkG0NkgW193Pu5OzYW6HkgW4Unv7coW8D+g9i4hN6sZKYOsjnRdEEQygQMBC9luliXUA6oYvZae2+1TjgUnAh3+VO03ND9CiyhZMIQAA 245 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3V0Q3AIAwD0f33jf87AVJbJBDh3QAQmXOoOocU8MKF7PaJqUIRjof5emSIgWb7I82HUFD/4v9Z2QNNAw1ujC2U4ZwekAULlWCQVgp69r7c5hfFtQrSHPIA1fSuZ0whAAA= 246 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3WMRLAIAgF0fvf99unSpUqUZk4vK2dQWFBxsBNth7/5Rta3GT79SNl3bRRKnDUY6QEKDY030LpF5PsGTfHqpEWNfIx4l3Js1oSPuHIsZW5ULxH/S5mHYDpD1B9oiuiESlWWs8LDS6pIUwhAAA= 247 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3XwREAIAgDwf4bNl+bENBxrwGVHDCuhT7iKtKSAswk1OeZAYHohCtHDjF/dkL6q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ovdksc7G8qjN4cibZEx21ckRCAAOdUVAEfBCL4fYYQXU82Hpz7tuxhV7JiUf0fVEOSs8DzzsQG1CPYFTCEAAA== 255 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+3VsREAIAxC0f2XFkfQIqeeeb+2CATiGACAXVL6jHnAvexF2VDuNed14cg8giZXZALr+KaZXmO9KSdCRo7vFtIDS/zNQIuD8vU7mxOKPT6QTCEAAA== 256 (base64 -d|gzip -d)<<<H4sIAAAAAAACA+2VsRHAMAjE9l9aZIWkiO8fS6Ubg3jsmTcwiVByUaa9FfD9QMyxmmVnKDDdQTXTIweTYM8i0rniKFuU3tE+SjikAhN+18vB5nkT4d31uOlnddrFVh2e/J8P1CcHlWZqfwBAoQFhTCEAAA== ``` [Answer] # [JavaScript (Node.js)](https://nodejs.org), ~~126~~120 bytes ### Method Each value is encoded with 3 to 5 Bloom filters, for a total of 1023 programs with a maximum size of 120 bytes. Each filter is using a single hash function. The least frequent value \$171\$ is used for padding and therefore not explicitly encoded by a specific set of filters. ### Generator The logic of the generator I used is as follows: * for each value \$v\neq 171\$, create a random hash function of the form: $$h:x\mapsto (p\times x)\bmod m$$ or: $$h:x\mapsto ((p\times x)\bmod m)\bmod m'$$ * build the corresponding Bloom filter taking an index \$i\$ and returning: $$B\_h(i)=\cases{171&\text{if positive}\\v&\text{if negative}}$$ * if the length of the filter code is greater than an arbitrary threshold, reject the filter * if any false positive would put \$171\$ at a position where this value actually appears in the file, reject the filter * otherwise add it to a pool \$P\_v\$ of valid filters * find the shortest subset of \$P\_v\$ that successfully puts \$v\$ at all locations where \$v\$ does not appear in the file * keep trying until all values are processed with 1024 filters or less ### Code and test link Only the first few programs are listed below. Please refer to the TIO link for the full list. ``` for(i=8524n;i--;)console.log(0x4140C81000910300021904291208610E5180A1101E4C5584A0n>>i*38n%201n&1n?171:0) for(i=8524n;i--;)console.log(0x640411351C44008082600030200102404302102041000B8307004014002n>>i*673n%789n%237n&1n?171:0) for(i=8524n;i--;)console.log(0x821080220001000C1180B8010148300A0A0805980183110340B000C03802n>>i*12n%947n%240n&1n?171:0) for(i=8524n;i--;)console.log(0x400408900A828400286988E00CA42800304084E44201081E2006A0130n>>i*491n%913n%241n&1n?171:0) for(i=8524n;i--;)console.log(0x488001268000001240C0D6C004A1880500402004002212602588035128n>>i*88n%523n%232n&1n?171:0) for(i=8524n;i--;)console.log(0x8C802500010201010200010222000102432001100n>>i*355n%398n%223n&1n?171:1) for(i=8524n;i--;)console.log(0x852104001000455700120000000001008000040800A00042n>>i*197n%198n&1n?171:1) for(i=8524n;i--;)console.log(0x82800220010000011500000880090682440430121n>>i*738n%827n%183n&1n?171:1) for(i=8524n;i--;)console.log(0x48020002940A00240008848200080001212An>>i*186n%977n%149n&1n?171:1) for(i=8524n;i--;)console.log(0x1000025004004000A058400200020212020740041200002C041n>>i*75n%208n&1n?171:2) for(i=8524n;i--;)console.log(0x8073028020124020000C001010804034080020802004504n>>i*618n%653n%199n&1n?171:2) for(i=8524n;i--;)console.log(0x504000250040402049200284000010048682802220020020A100800n>>i*50n%219n&1n?171:2) for(i=8524n;i--;)console.log(0x1443120E00040A1005280801210401850204000n>>i*221n%710n%156n&1n?171:2) for(i=8524n;i--;)console.log(0x5000800088020800A0040482810002491024000082102004200912404040n>>i*39n%565n%240n&1n?171:3) for(i=8524n;i--;)console.log(0x68004001C8004000040941002080600008002444415200000A1811090000n>>i*189n%524n%241n&1n?171:3) for(i=8524n;i--;)console.log(0x40D010000080010AC444C20200F502220004104A00024E00n>>i*127n%202n&1n?171:3) for(i=8524n;i--;)console.log(0x8200040000982000064248028020012040020D1010100840011C202009n>>i*367n%463n%235n&1n?171:3) for(i=8524n;i--;)console.log(0x19810003008108405D02024001500808030002n>>i*23n%656n%150n&1n?171:4) for(i=8524n;i--;)console.log(0x404200082183400268A8220418882000100808021n>>i*613n%877n%167n&1n?171:4) for(i=8524n;i--;)console.log(0x128010088800280004008104001100024B8000C500000000100610002n>>i*204n%233n&1n?171:4) for(i=8524n;i--;)console.log(0x20B001100002405020002002040040219100008402005B4050n>>i*88n%205n&1n?171:4) for(i=8524n;i--;)console.log(0x403C41900880200421800802001C811000800190000D000000004215080004040n>>i*213n%260n&1n?171:5) for(i=8524n;i--;)console.log(0x140048090080040472000444910008600060400002014108006000000144n>>i*858n%961n%253n&1n?171:5) for(i=8524n;i--;)console.log(0x800000408000C8000000810008C721000A010510000000060854010C380n>>i*629n%852n%236n&1n?171:5) for(i=8524n;i--;)console.log(0x200008A212000428600000005A8C08120103002B4040112100016040000n>>i*191n%235n&1n?171:5) for(i=8524n;i--;)console.log(0x300A0180113004082218120104400A0087084080002450n>>i*494n%999n%199n&1n?171:6) for(i=8524n;i--;)console.log(0xA02060040A0C0040001100831040C34000C89000840040002240284n>>i*191n%220n&1n?171:6) for(i=8524n;i--;)console.log(0x16200020A00090902002002020006B0D40014001020C08088014000n>>i*397n%750n%217n&1n?171:6) for(i=8524n;i--;)console.log(0x18A00802008004493000800CB00000440008910402400010025241030880n>>i*11n%238n&1n?171:6) for(i=8524n;i--;)console.log(0x20210002000100C0683100000310284282043C0A806n>>i*430n%641n%177n&1n?171:7) for(i=8524n;i--;)console.log(0x141000000400408EA5020800C0842210804200810A2040022000n>>i*189n%206n&1n?171:7) for(i=8524n;i--;)console.log(0x68100000920120000008208002002000202088104030606040Cn>>i*109n%978n%212n&1n?171:7) for(i=8524n;i--;)console.log(0xD002204020008428000800088120908008020E4000048049n>>i*307n%392n%198n&1n?171:7) for(i=8524n;i--;)console.log(0x400208040088000000242100611008400C30084004014A20n>>i*206n%249n&1n?171:8) for(i=8524n;i--;)console.log(0x40060000000A8C0200840800328400403800204n>>i*109n%395n%162n&1n?171:8) for(i=8524n;i--;)console.log(0x3028000400400A820009000100001412200006691n>>i*580n%784n%165n&1n?171:8) for(i=8524n;i--;)console.log(0x2000628088810108800410004001B440034D000n>>i*67n%156n&1n?171:8) for(i=8524n;i--;)console.log(0x140009600860240200C0100005000420100084804C200000000830200n>>i*60n%233n&1n?171:9) for(i=8524n;i--;)console.log(0x112062801184002004885608000024800048040210400Cn>>i*135n%196n&1n?171:9) for(i=8524n;i--;)console.log(0x10261003012200840800240AC080000060100200C401840000040040n>>i*205n%228n&1n?171:9) for(i=8524n;i--;)console.log(0x420040202414000440001800000081041084200240025100001004010200000n>>i*235n%253n&1n?171:9) ``` [Try it online!](https://tio.run/##lL1bry1Jdp33zl9RJtBml0m14poZIZoy1llnFyBAfiL8JAtCXsmmqep2d4miLPC3y9@YEZkr97aBztWXqnP2ZUVmxLyMMW/xD9M/TX9c/vDb3//yr37@3br9j@V3P//xlx8eP/zND3@xr3Ecp1zy5PSftA3rMKc0uOBc8M77wb7uxhT2LU9xc8M87Hxnyis/MdTs6rDHNPLFfZ/W5LNzW@BvYaypuGVM61Rc3tK21T2WlX8Mm4t5ncMawza5JS7LMPlhXJZpmPnmOE/DNC3jvK9LTLGUpW7rMG057SnEOezzFpZl9UPOpfg9TvPEx@3rNk7rPu5jXOccaxpTjesys55b1iH5FN0Y/V6HbZhrTLOPaV1WN85rmtMyR7@UMIUYxiEu@zx7v88u7dM4pDwkNywpbuMW5jnMxYVUp7rVzc/TPC9xzzGGMMXRsVza5xqmPcV5duPGEjHW7OtYlzG7fSp7yLzmzqcXPy38ck0ph7qvYx2mURu@TdsQ4zYMM0@@uS3WednLMO5L2eZtK@O6@rKWlCsvMvLIS5nYyOB5m7XUMLPOPG1@im5eFhfGkSflkfc5bjGnadz8tqyh5I2Py2WIOZZQ/VRDSalqmeD3vPClwk@tPqeljnkuftvXfR7dGFa/T65sqSx52n3epjgnTj/z@DH6zMunMPsp591xAtMwDmvILla@F2oc3J6HkGNYl23xeSx75O/TMq/jzoPkHMYZKVhDSn7kVLeBo/dTCAuiVJYSEyeRObdSqwRl2Tz7yc5t08pjT9Xtcfdj2IfA37dt3eu@81uJI6hITkrT4B1ntg6eLRzTEFNdy@LqVGJF5kNhj5AtpK0ktm8YXRrGNbG7cdh5rnlyPFOdePWw5G3w/EJd2G6Pfu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tdKcy1vVl71aFsSqlkmxKUCdiwgvIuSMPUmK/17EuRdhUjL@dVsVg/KlIDRYe9WhHIOD048yGuLwrvrxyRio2xjQ1GFZXCRfrxSSOrBXYthRUeFqADCUDKupE8Va@AfrifVAVFQwWYUiTRNwKtoBbJRakg7IWCpNLX3rL@6RDMMB1F@ttEYoA/Xfp2gyElQUouc95DQc13mQCPEMCTGkvZmLhp0loCn1zljNN7btuOKhBuEKTIiwJLJPCFx61SZlq7@IJyqp6bfY18JLs9d5r9RgdzPDxjYmMkjj10bpPv6muYKXpR3J5XbLW38g6Vdq@9etnAd10JUVQMtfU0Z0Uz7TtrWw9Lmuo8KG5yX9@nr0c5U7lddxyuJk/@kVxpPGtaeHE7cba8Ml62HLNMx@VGo3uv@Pw "JavaScript (Node.js) – Try It Online") ]
[Question] [ Part of [**Code Golf Advent Calendar 2022**](https://codegolf.meta.stackexchange.com/questions/25251/announcing-code-golf-advent-calendar-2022-event-challenge-sandbox) event. See the linked meta post for details. --- While [other Elves are busy carrying air blowers](https://codegolf.stackexchange.com/q/255464/78410), [Fen](https://codegolf.stackexchange.com/q/255274/78410) comes and shouts, "I've got a spell for this job!" To recap, a chimney is modeled as a rectangular grid. The number in each cell represents the amount of smoke in the region. The left and right sides are walls, and the top and bottom are open. ``` ||========|| || |90| || ||--+--+--|| || | |24|| ||--+--+--|| ||36|12| || ||--+--+--|| || | | || ||--+--+--|| || |50| || ||========|| ``` Fen can use "Vick" spell at a selected cell in the grid. When he uses it, the following happens: 1. The smoke at the selected cell is blown into three cells above it. Upper left and upper right cells get `floor(n/4)` amount of smoke each (if such cells exist) and the remaining smoke goes to the upper middle cell. ``` | | | | |12|26|12| +--+---+--+ -> +--+--+--+ | |50*| | | | | | || | |... ||10| 3|... ||---+--+... -> ||--+--+... ||13*| |... || | |... ``` 2. The Vick spell itself moves to the cell above it. 3. The steps 1 and 2 are repeated until the Vick spell escapes the chimney. Given the initial state above, casting Vick spell on the 50 (row 5, column 2) will result in the following: ``` ||=========|| || |90 | || ||--+---+--|| || | |24|| ||--+---+--|| ||36|12 | || ||--+---+--|| || | | || ||--+---+--|| || |50*| || ||=========|| ||=========|| || |90 | || ||--+---+--|| || | |24|| ||--+---+--|| ||36|12 | || ||--+---+--|| ||12|26*|12|| ||--+---+--|| || | | || ||=========|| ||=========|| || |90 | || ||--+---+--|| || | |24|| ||--+---+--|| ||42|26*|6 || ||--+---+--|| ||12| |12|| ||--+---+--|| || | | || ||=========|| ||=========|| || |90 | || ||--+---+--|| ||6 |14*|30|| ||--+---+--|| ||42| |6 || ||--+---+--|| ||12| |12|| ||--+---+--|| || | | || ||=========|| ||=========|| ||3 |98*|3 || ||--+---+--|| ||6 | |30|| ||--+---+--|| ||42| |6 || ||--+---+--|| ||12| |12|| ||--+---+--|| || | | || ||=========|| ||=========|| ||3 | |3 || ||--+---+--|| ||6 | |30|| ||--+---+--|| ||42| |6 || ||--+---+--|| ||12| |12|| ||--+---+--|| || | | || ||=========|| ``` ## Task Given a 2D grid of non-negative integers which represents the current state of smoke in the chimney, and the initial position of the Vick spell, simulate the chimney as specified above and output the resulting state. You may assume that the chimney is at least 2 units wide and 2 units tall, and the Vick spell starts inside the chimney. The coordinates may be either 1- or 0-indexed. Standard [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") rules apply. The shortest code in bytes wins. ## Test cases ``` [[0, 90, 0], [0, 0, 24], [36, 12, 0], [0, 0, 0], [0, 50, 0]], (5, 2) -> [[3, 0, 3], [6, 0, 30], [42, 0, 6], [12, 0, 12], [0, 0, 0]] [[3, 0, 3], [6, 0, 30], [42, 0, 6], [12, 0, 12], [0, 0, 0]], (4, 1) -> [[0, 11, 3], [0, 12, 30], [0, 3, 6], [0, 0, 12], [0, 0, 0]] ``` [Answer] # Python3, 159 bytes: ``` def f(b,x,y): while x>=0: c=(C:=b[x][y])//4 b[x][y]=0;x-=1 if x>=0: for Y in[1,-1]: if 0<=y+Y<len(b[0]):b[x][y+Y]+=c;C-=c b[x][y]+=C return b ``` [Try it online!](https://tio.run/##VYzNboMwEITvPMUebbEoNqYoJdleeApk@QLFClLkIIuq8PTUNumftCt9Mzs787bcHk6dZ7/v76MFy3pcceNNBp@36T7C@kYiCBiItQ31ejV6M/x0qoL3VCQua0EyGJP9yYN9eOhgclpiIU2y4l1cacu76310rNfC8OYoyTuT03BpCxpi8tmcU5uBH5cP76DfZz@5hVmmtUB4DSsMQuQwZRVZ1Qiy/Hf4xpfEBiuUnGe/VSqlVEzVB6aPqkyijiwPluXfVoMKBef7Fw) [Answer] # [Charcoal](https://github.com/somebody1234/Charcoal), 67 bytes ``` ≔§θηεWη«≔§εζδ§≔εζ⁰≦⊖η≔§θηεUMε⁺κ⎇⁼λζ⁻δ×÷δ⁴№↔Eε⁻νζ¹∧⁼¹↔⁻λζ÷δ⁴»§≔εζ⁰Iθ ``` [Try it online!](https://tio.run/##dVDLasMwEDzXX6GjDCo4qVsoPhmnhxwCOeRmclCtpRaV5VqS0xf9dnXXcUqaUiGJWc3szKKmla7ppYmx9F4/WV6GtVXwxgfB2lQwSIvktdUGGG9T9plcXchAsA@UKZTN1DkjWEbERr7MbStoHHRgAyjyL/74ncVSW9V3nbSKzLZm9PxZsB04K907fxhGaTw3xwE22iKNpjvdgedrG1b6oBXQU4581Y828PLR92YMwNGaPI9dlixSFC2mu8S82XyB1U/LpDUn7UUCrSL5Sv77g63TmF9JH/iAyhjrus4Eu8eT7QUjjHuZE765w1GWv4gTvJ0wFjlK9vH6YL4B "Charcoal – Try It Online") Link is to verbose version of code. 0-indexed. Takes the initial row and column as separate inputs. Explanation: ``` ≔§θηε ``` Get the row of the chimney at the initial row of the spell. ``` Wη« ``` Repeat until the spell reaches the top of the chimney. ``` ≔§εζδ ``` Get the smoke at the current cell. ``` §≔εζ⁰ ``` Clear the smoke at the current cell. ``` ≦⊖η ``` Move the spell up one row. ``` ≔§θηε ``` Get the row of the chimney at the new row of the spell. ``` UMε⁺κ⎇⁼λζ⁻δ×÷δ⁴№↔Eε⁻νζ¹∧⁼¹↔⁻λζ÷δ⁴ ``` Update the row in-place, adjusting for the amount of smoke that gets blown diagonally. ``` »§≔εζ⁰ ``` Clear the remaining smoke from the chimney. ``` Iθ ``` Output the final state of the chimney. [Answer] # [JavaScript (Node.js)](https://nodejs.org), 104 bytes ``` m=>x=>p=g=y=>(P=p>>2,p&=3,r=m[y])&&g(y-1,p=[r[x]+P+P+p],r[x]=0,[x-1,x+1].map(i=>1/r[i]?r[i]+=P:p[0]+=P)) ``` [Try it online!](https://tio.run/##nY9Nb8MgDIbv@RWcIlCcho8s0jaZ3XrOHXGIujbKVBqUThP59RkkrdRpO02AeSy/vNgf3Vd3PUyD/ywv4/txOeHiUAfUHnucUdMWvdYSfI4KJnRmtizPezqXAjyayQRbtHF5C4mRgwmxFAphd67zdEAtqskM9i2FAtsXb3i6GVv2SB0EmFn85kQdo4HRmYFjr1l2GC/X8Xzcncee7qkxHMhzPNwCSRy3rBOrBoiQPwp3fFo5JgJIzVhWVaTUxBi1qlRSNRuuL2q5Jk1isbGQj672d1f/ttrED00libhZ8W0kdR9E3az4X07LNw "JavaScript (Node.js) – Try It Online") Currying input m, x, y (0-indexed). Output by modify m in-place. ``` m=> // the input matrix x=> // the input coordinate "x" p= // amount of smoke from row under it // p is an integer, and could be anything that may be convert to integer // for example, we initial p as a function so it converted into 0 g= // recursive function y=> // the input coordinate "y" (P=p>>2, // smoke propagate to left / right p&=3, // p+P+P is the smoke move to middle r=m[y])&& // whenever the smoke not get out of the chimney g(y-1, // it propagate to row y-1 p=[r[x]+P+P+p], // with amount p (assuming the smoke can propagate to left and right r[x]=0, // smoke go away (empty the cell) [x-1,x+1].map(i=> // for each left / right cell 1/r[i]?r[i]+=P: // if the cell exist, P amount smoke propagate into it p[0]+=P // otherwise, P amount smoke still leave in middle cell // which propagate to the next row as described )) ``` ]
[Question] [ # Background [BitCycle](https://github.com/dloscutoff/Esolangs/tree/master/BitCycle) is a two-dimensional Turing-complete programming language involves moving bits around a playfield. Because I am too lazy to write BitCycle programs myself, you will be writing a program which outputs BitCycle programs for me! Unfortunately, the storage space on my computer is only about a bit, so you will have to make the BitCycle programs as small as possible. # How does BitCycle Work? In BitCycle, a program is a 2D grid of characters (the playfield), implicitly right-padded with spaces to form a full rectangle. During execution, bits move around this playfield, encountering various devices that can trigger various effects. All bits move at the same time, which is once per tick. A `0` or `1` in the program places a single bit of the specified type on the playfield at the start of execution, moving east. The device `!` is a sink. Any bit that hits it is output and removed from the playfield. For simplicity, your outputted program can only contain **exactly one sink**. Also, programs will be ran with the `-u` (unsigned integers) flag, which basically indicates that the program will output a positive integer based on how many `1`'s it receives before the program terminates. Passing a `0` into a sink will have other effects on the output, but for simplicity, outputted BitCycle programs **should only pass `1`'s into the sink**, or else the submission is invalid. The devices `<`, `^`, `>`, and `v` change a bit's direction unconditionally. For example, if a bit hits a `<`, it will start travelling to the left. The device `+` is a conditional direction change. An incoming 0 bit turns left; an incoming 1 bit turns right. The devices `\` and `/` are splitters. When the first bit hits them, they reflect it 90 degrees, like the mirrors in ><>. After one reflection, though, they change to their inactive forms `-` and `|`, which pass bits straight through. The device `=` is a switch. The first bit that hits it passes straight through. If that bit is a `0`, the switch becomes `{`, which redirects all subsequent bits to the west (like `<`). If the bit is a `1`, the switch becomes `}`, which redirects all subsequent bits to the east (like `>`). The device `~`, dupneg, creates a negated copy of each incoming bit: if the bit is `0`, then the copy is `1`, and vice versa. The original bit turns right, and the copy turns left relative to its current direction of travel. All splitters and switches on the playfield reset to their original states whenever one or more collectors come open (see below). Any letter except `V`/`v` is a collector. A collector maintains a queue of bits. It has two states, closed (represented by an uppercase letter) and open (represented by the corresponding lowercase letter). In both states, bits that hit the collector are added to the end of its queue. When the collector is closed, bits stay in the queue. When it is open, bits are dequeued (one per tick) and sent out eastward from the collector. An open collector stays open until all its bits have been dequeued (including any that may have come in while it was open), at which point it switches back to closed. There may be multiple collectors with the same letter. Each collector has a separate queue. When there are no bits moving on the playfield (i.e. all the bits are in collectors), the program finds the earliest-lettered collector with a nonempty queue. All collectors with that letter will then open. Once a collector is open, it stays open until its queue is emptied; but a closed collector will only open when there are no bits active on the playfield. When any bit hits the device `@`, the program terminates. The program also terminates if there are no bits remaining, either on the playfield or in collectors. All unassigned characters are no-ops. Two or more bits can occupy the same space at the same time. The ordering between them if they hit a collector, splitter, switch, or sink simultaneously is undefined (**use at your own risk**). Because different implementations of BitCycle deal with undefined behavior in different ways, your outputted BitCycle programs all have to run correctly on [Try It Online!](https://tio.run/#bitcycle). (Reference: [GitHub Page for BitCycle](https://github.com/dloscutoff/Esolangs/tree/master/BitCycle)) # Challenge Given a positive integer as input, your program should output a valid BitCycle program (with the restriction of only having one sink) which outputs the input number and halts under the `-u` flag. Total score will be calculated by the sum of the lengths of the output BitCycle programs when your program is ran against the test cases shown below. **Please provide your submission's score when answering.** **If it is suspected that someone is hardcoding the output for this specific test suite, I can change existing test cases or even add new ones.** # Test Suite ``` 1 6 20 45 47 127 128 277 420 523 720 1000 2187 2763 4096 4555 7395 8718 9184 9997 ``` # Note The challenge can be trivially solved by printing out the appropriate amount of `1`'s followed by a `!`. For example, `5` can be outputted as follows: ``` 11111! ``` In order to be competitive, your program should aim to output BitCycle programs that are generally shorter than programs generated by this trivial method (especially for larger input numbers). In other words, **your score should be less than 51983** (the score obtained when using the trivial method). --- This is **not** [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so don't feel obliged to golf your code in any way! [Answer] # Python, scores 1186 Generates a binary to unary converter with a few tricks shortening specific bit patterns. ``` import re def f(n): if n < 40: return n*'1' + '!' d = [x.replace('0', '') for x in bin(n)[2:]] q = d[1] == '1' del d[1] return '\n'.join([ ' '*q + re.sub(r'(?<!^) >v ', ' >v', '>v'.join(d).replace(*'1 ').replace(*' 1', 1))+'~', '1'*q + re.sub(r'(?<!^)1~>1', '1~>', '~>'.join(d))+'+', ' '*q + re.sub(r'(?<!^) >\^ ', '1>^', '>^'.join(d).replace(*'1 ').replace(*' 1', 1))+'!' ]) ``` [Try it online and verify all cases!](https://tio.run/##lVLfb5swEH7nr7g@HSQuxQQCZCVTNW3SpEmblr2lZErAqEwZuMY0jab1X8/OsPyYtD3MEj7uzt99n88n9/qhqSeHQ/VdNkqDEpZViBJKu3ZmFtCqSqjhFgJvcM1SQneqhnqEHGEMeIV9qoAUls@uEnK7zoWNHjJAdKBsFDxDVcOmqqns0p9lWQ94JECx5BmkKVCpoYjY9jHrggjva3S/NYRenjQg4OiRyJVw225jK7Rf316tHJg/gaElawztA7BwTrpINeClC5yOcscZ4wuyMwH/KwF/mZvjSNYY2o8EhB9f4v8l8H7VK@TzVa9w9V8Kf7c6c44PRrWlanLRtpbV5o0S1FPPskzPtek5Z1PmeywIWRAx7psvZn4UsYCioT9hEVnueR7zeRxRZjphgZdMCRGGLJokIYsjHrOExwFLkiQyY5ATSWlr5xUMlOMUtqK2c4dyu0o/QCPJxbwphLvJzTV3NAfrFophiAp3pyotBkArqdr5Gq7q6J1RDoNpsDeN1DebSuf7fCtOP67cm@R1Z/YjU8YgX0saGvG16bTsdPpFdcKwKCKpam230m11QUkTlMqE8BpHocdK/KF/zpDhp7vFAs3cqzTVILatAHx39/4DniEk3PoDjIs3Hz@/JfTQEefwCw "Python 3 – Try It Online") Converts the number to binary and constructs the program from doublers: ``` >v ~> >^ ``` This doubles the number of bits moving east on the middle row. In the end all bits have to be converted to 1's, which can be done with ``` v~ >+ ! ``` ]
[Question] [ **Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers. --- **Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/230870/edit). Closed 2 years ago. [Improve this question](/posts/230870/edit) # Challenge Given two lists of strings where each string is of length 50 and each list is also of length 50 generate the shortest regex you can that fully matches all the strings in the first list and does not match any of the strings in the second list. # Scoring Your score will be the average length of the regexes your program outputs when applied to this file: <https://pastebin.com/MvwPbH1G> In this file the lists are separated by a single newline and the pairs of lists by two newlines. Apply your program to each pair twice with once with the first list as the strings to match and once with the second list as the strings to match. # Rules * We will use Javascript flavor regexes for simplicity. [Answer] # Score: 212.84 ``` import re def ngraphs(ss): n = [set() for _ in ss[0]] for s in ss: for i in range(1, len(s) + 1): for j in range(len(s) - i + 1): n[i - 1].add(s[j:j + i]) return n while True: y = [input() for _ in " " * 50] input() n = [input() for _ in " " * 50] input() input() yngraphs = sum([sorted(a - b) for a, b in zip(ngraphs(y), ngraphs(n))], []) regex = yngraphs.pop(0) while not all(re.search(regex, a) for a in y): regex += "|" + yngraphs.pop(0) print("^.*(" + regex + ").*$") print() ``` [Try it online!](https://tio.run/##jZjJru28gZ3H5lNcGBncv8oxbASZFFAD9X3fUoYTUBIlqqdEdRTy7g5v2eUgyCQ4wMHeYiO2a31rU36Sbf1vf/vbsNDtOH8cGIAWdz/W/kCUsJ@M/fZv4Hfrj3//8ReGz5@//ei248f//DGsPxj7y5/@@lfwu18P2N8fiJr/8XX49fVAa49//vkPP2a8/mS//fjXH3/@1dXfa4z/p8Y/iv@raPXPKr9b/zKIJ3/@6x9R2/5kfxn/bRSFw19/A7878Hkd648VgIcMM/6RHhcWbfivEQ4rvf6vMf5e/P3Lj//@JzHMf5T9Yy7/XzX/@YH/YzVES3YtP//CxErh9icSQ6z/3gf6w4/6VzffQH/@59Lx3/7wz2Vcf/vtr3/48Ze/T6DHr@jpPzv9I93ozz@Jgr/PZ93OH2iefx74jwyjoyE//6PBH36gf7zp12v4fyzT33v613//8fv/9XuxPP9Ph/QY1vPn7//HH//l56/yf1T/8fvf/vgv/@X3/yz/7W9/k7vyoCRVmy1M5WxaFW2Gn8bMao9Z16fTSBFs5tLoJd9KTH1rd8BnbL1DvoQjiozz3dVD8zis3BSlsYrTPJE8aNRpjqo71RM8yiVYksMZ2VpPqueuE9HKS7p7U3HXesuO6cUnlushec@vXRQjK10tBu1aDtuc3Tw1HAm1vgVdiPfdSKty6J/LXjydqGsQZl0Nz6VwBwKGN/TOSNVsvWKNAs3Z59WadTthC7Gn/cnzy4qNJHjMfN30trwToEx9787LFngl9@/aNdZ5LyrHOWC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3/XRsxje1Z@Aeh3xGRuKPoflxX3cqU7qMjmVVJkWeA6M0u@C5miWOggi5jWLBehc5WHM3/Ocq@bXDz6q/wmg@xX2lkQcj8TfZY8Zc/FpwnrDqf7AlkNxCPMPp3V@MPk8L4M9TazsU2ZXb@PHsdsXba75q4Jj4dteD6b1gVK75vkT@vKawyDth2ZIz@EkmJqpOQk5ya3LkpPWjfVZZF2gsZy8WSLN5bC2BZyWFsXeVZjfW1qa0HxYiqB7mGyxg8IJunFxQL1HxhE1tWl6RCV4ebxSCJaqCGvcLqJV@mI3nhklKDSmjZx8hoIUH3e0C923tDJJ9aDW7t6qoWALfvlwZOwuM3F@YV1tvQMzYZkgP3Vojm6qBIWuBDNPsalamctMdj2F6ZT6OUbsWVKnebdH@votBG3tT77Cyc5fI3wO5ZO/lsqGEx43@/zaOeIymILEXEN5WVxHV1eQsOzIbc13pnGTm0DcvfipVkskcaGrRtSLJC@f2FVa3Eq5cEMYA6vfbHqFiyJcZVPRzBA0HlqfPotost3dYRr@ie98pEH1KzlIDEzZLPjiuuvkGvq0rQOj2oXzhIolpYR1RjilyOWhxGzUdo/CNAY4C9U2Ope0qkWm3s6mCLQ29Y1prnCGLc2ry8GD8TAlhZoVWKIU9HbX89MpBErEj/IeSsb0dxgxSYPOCdVLr4RpWsIViHQsIR9eBCYnJW9yTbsf3@7bizztpo/p3QSeUxnYredqluIfVqfOENGhQhfQpt1dG3Zt8Us3q5kOn6K9k15SGr6fWYH/ne1VnFYxleUaOHWog9HA@zVHpOkeMTmpiNEb8bRlkWmfF/pQHoSbXQZwUxubrKXXIMCfqjrU6Wmi6/iOvXPz3kPKkHA9IHizt6u5jW68Dj/fwlg6wgmDV82pyCZX4SdWfgnB9oQ5ONiWbvxJUfKqTqjjq8kMN08WZ1hvD2RKY4rgP46TUbxGUvqj1CRu91J1ib2w1rTBk4JxM81j0lRDrpQIAPC/AQ "Python 3 – Try It Online") A pretty uninteresting brute-force solution. Only uses alphanumeric characters and `|`, so a) flavor doesn't really matter b) I expect this to be easily beaten by a smarter brute-force solution at least. [Answer] # [Python 3](https://docs.python.org/3/), score 122.39 ``` count = 0 total = 0 while True: y = [input() for _ in range(50)] input() n = [input() for _ in range(50)] input() input() s = set() for x in y: i = 1 while any(a[:i] == x[:i] for a in n): i += 1 s.add(x[:i]) regex = "^(" + "|".join(s) + ").*" count += 1 total += len(regex) print(regex) print(total / count) ``` [Try it online!](https://tio.run/##jZjHjjU5gp3Xzaf4UasqDdAaQdBmgF6E994yBiOBYcmwjGA4BubdW8wqQQuttMnkTZqkPec7l/ITb@t//@c/m@1az1//@PWv4NxONP9ZejCZu1/pcXX/Bv7GxZ/@naz0On//41e/Hb/@1y@y/jrQOnS//49//eM/wN/@TyX42/r/3/T/Fpjow7o/iz893p8eXPzbvxFR8d/E778mg1b@O/r3fyP/8esf//j1/ln4aY5@mq9//LQXHf7lrx7s76htf/@zkRj16IbuFWP99j9//@3Xv/z67T9/@/u4kfV39sfPpz/@/l9@A3/7axP@6v7XNojy3K2//9lZDEIPsp7/z6e/Gv7XX392/uOf/5T78qA4VZstTOVsWhVthp/GzGqPWT@k00gRbObSGCTfSkx9a3fA5856Sb6EI4qM893VQ/M4rNwUpbHapXkiedCo0xxVd6on3SiXYEkOZ2RrPameu05YKy/pHkzFXestO6a3Ozu5Jsl7fu2iGFnpajFo15Jsc3bz1HAk1PoWdGG370ZalWR4LnvxdKyuQZj1NTyXwiUYkDf0zkjVbL1ijQLN2efVmvU7Zgu2p/3J88uKjSR4zHzd9La8E6BMw@DOyxZ4Jffv2jXWeS8qxzlgkdlB7scrD7EWltaMZG/6UqqDbMl51u5qqg7J06ayem1mpbXK2o@GpqLEaz7iVMUobdVSJ3L2bWLH@Ly6n5RY07fzfsC287DRidtG19W9jxva7Wr87tujPXbb@@UE2uMKNM3ZKbX1djkgJFWA/doj4Xk1yanMc2qcaJwqde6/uZOyD@gjWpS5vNwseS72veHXWUqiH8/mfAMTq/JsaCuNvOOLKwTVWQEOR3ZdM2V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9q7C/N7S0oTmw1IE3cNkix0UTtCPiwPqPTKOqKlN08Mq7pbHK4VgqYqwxu3CWqUvduOZUYJCY9rwyWcoSPFxR7vQfUsrk1QPau0erBoKtuCXD0fG7jIT9xfW1TY4MBOWCfJTh@bopkpQ6Eow87QzVStzmcmupzCdUj/HiD1L6jTv9kjfsIWgrf3JVzje@WuEz6F88tdS2XDC42afXztHXAZTkJhrKC@L6@jqChKWHbmt@c40bnITiLcXP9VqiSQudNWIBpHk5bNzlbZrpVy4IYyBNWw2vcJFEa6yqWhmCBoPrU@fRTTZ7v4wDf/s7nykQfWTHCQGpmwWfHHddXKRIW3rwKh24TyhYkkpZr0RTilyeSgxG7X9ozCNAc5CtY3OJa1qkam3sykCrU19Y5qrLusszatL4sGYTEmhZkUnUQoGux/46RQCJeJHeQ8lY/pLxg6nQe@E6qVXwjQt4QpYOpaQkxeByUnxm1zT7se3@w4iT7vpY3o3hudUBnbruZql@IfVqzNElFToAtq0u2vDri1@6WY10@FTtPfSi0vD9zMr8L@zvYrTKqayXAOnDnUwGt1@zRFu@kcsTipi9EY8bVlk2ueFPpQH4WaXAdzUxsZr6TUI8KeqDnV6mug6vmPv3XzwkEISrge42@ztam6jH6/Dz7cwlo5w6sCr5lRkk6vwEyu/hGB7whyczpbu7pOi5FWdUO@uJjPcPFkcst4eyJTGFMF/HCejeI2k9EepSdz@peoSe2GtacSTgnEzzWPSVEOulAgA8L8B "Python 3 – Try It Online") Explanation: Simply takes the set of minimal prefixes of the strings in the first list that aren't prefixes of any strings of the second list and uses that to build a regex. ]
[Question] [ Remove every pair of newline characters, that means every two newline characters appearing together are elided, whereas unaccompanied newline characters remain present. Example: ``` echo -ne 'a\n\nb\nc\n\n\n\nd\n\n\n' | your-command ``` should output the same as ``` echo -ne 'ab\ncd\n' ``` Watch out, some POSIX tools have implementations that diverge from the standard. Please consult <https://pubs.opengroup.org/onlinepubs/9699919799/idx/utilities.html> before submitting your solution. [Answer] # [Sed](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html), 22 ``` sed ':l;s/\n\n//;N;bl' ``` [Try it online!](https://tio.run/##S0oszvifmpyRr6Cbl6qgnhiTF5OXFJOXDKJBMAVCqSvUKMT8L05NUVC3yrEu1geJ6etb@1kn5aj//w8A "Bash – Try It Online") Initially I had hoped to do `sed -z 's/\n\n//g'` for a score of 18, but I think `-z` is a GNU extension and not Posix. [Answer] ## AWK, ~~26~~ 22 bytes ``` awk -vRS=' ' -vORS= 1 ``` Tested with `gawk` and `mawk` on MacOS. Edit: saved 4 bytes thanks to @AndersKaseorg. [Answer] # [Bash](https://www.gnu.org/software/bash/), 32 bytes ``` awk 'BEGIN{RS="\n\n";ORS="";} 1' ``` [Try it online!](https://tio.run/##S0oszvifmpyRr6Cbl6qgnhiTF5OXFJOXDKJBMAVCqSvUKMT8TyzPVlB3cnX39KsOCrZVAkkoWfuDmErWtQqG6v//AwA "Bash – Try It Online") ]
[Question] [ **This question already has answers here**: [Return each number from a group of numbers](/questions/8588/return-each-number-from-a-group-of-numbers) (21 answers) Closed 4 years ago. At work I've been acting as quality control on our public documents, to make sure that they are [WCAG 2.0](https://www.w3.org/TR/WCAG20/) compliant. Given the length of some of these documents there tend to be issues, and so I record the issues and the pages they occur on. # The challenge: Given a string input, output a count of all distinct pages within the string. ## Rules: * Input will consist of of a non-empty string containing the pages, page ranges, and the issue. Multiple pages and page ranges are guaranteed to be separated by commas `,`. ``` pgs 810-812, 897, 1043, 1047, 1219, 1308, 1317, 1323 restructure reading boxes ``` ``` pgs 810-812,897,1043, 1047,1219, 1308, 1317, 1323 restructure reading boxes ``` Both of the above are possible valid inputs. * This input can be multiple lines, with each line representing a different issue. ``` pgs 810-812, 897, 1043, 1047, 1219, 1308, 1317, 1323 restructure reading boxes pgs 816, 819, 826, 827, 829, 853, 861, 866, 885, 1043, 1142, 1143, 1164 table needs to be read as table or figure ``` You can take a multiline input as a list of strings, with each item in the list being a line. The output is still based on the entirety of the list. * The input format is not necessarily `pgs <page numbers> <issue>`. Both `pg 1324 read all` and `Read all` are valid inputs. If the string consists of only `<Issue>`, this represents that the document is a single page, and thus the output would be `1` (no matter how many lines of input there are). If there is more than one page, you are guaranteed to not have this format as a line of the input. ## Test Cases: ``` Input: ------ pgs 810-812, 897, 1043, 1047, 1219, 1308, 1317, 1323 restructure reading boxes Output: ------- 10 Input: ------ pgs 587,897, 936, 939,946, 1308 single figure pgs 810-812, 897, 1043, 1047, 1219,1308,1317, 1323 restructure reading boxes Output: ------- 14 Input: ------ pgs 824, 873, 941-943, 1032, 1034, 1036-1040, 1055, 1071, 1153, 1154, 1228 figures as figures pgs 1036-1040 Color Contrast for negative balance numbers does not meet WGAC 2.0 guidelines pg 1324 read all Output: ------- 18 Input: ------ Incorrect Reading Order Output: ------- 1 Input: ------ Incorrect Reading Order Pg 1 Read Table as Table Pgs 1 Color Contrast for negative balance numbers does not meet WGAC 2.0 guidelines Output: ------- 1 ``` --- This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so shortest answer in bytes wins. [Answer] # [05AB1E](https://github.com/Adriandmen/05AB1E), ~~51~~ 38 bytes *-13 bytes thanks to Kevin Cruijssen!* ``` ',ð:#ʒ'-м€.ïß}D.ï≠ÅÏ'-¡¤LsнUʒX<›]˜Ùg1M ``` [Try it online!](https://tio.run/##yy9OTMpM/f9fXefwBivlU5PUdS/sedS0Ru/w@sPza12A1KPOBYdbD/er6x5aeGiJT/GFvaGnJkXYPGrYFXt6zuGZ6Ya@//8rKSkVpBcrWBiZ6ChYmBvrWJoY6lqaGOsYGhgb6SgASRMwaaZraGBiAGKamoJIc0MgaWhqDCZBSoyMLBTSMtNLi1KLFRKLYUwukNlw7QrO@Tn5RUAyr6QosbhEIQ3IyUtNTyzJLEtVSErMScxLTlXIK81NSi0qVkjJB5qUl1@ikJuaWqIQ7u7orGCkZ6CQXpqZkpqTmQc2W8HQ2MhEoSg1MUUhMScH6BUA "05AB1E – Try It Online") ### Explanation ``` // Implicitly Read in multiline string ',ð:# //Swap commas with spaces and split on spaces ʒ'-м€.ïß} //Filter list to only those with - removed are numbers D //Duplicate .ï≠ÅÏ //For all the ones that aren't numbers (so the ranges) '-¡ //Split on dashes ¤L //Generate list from 1 to the highest number sнU //Stick the lower number in the variable U ʒ®<›] //Filter out numbers less than the lower number ˜ //deep flatten Ùg //Uniquify and count 1M //Push 1 then output the largest number in the stack ``` [Answer] # Perl 5 (`-p`), 63 bytes ``` s/-/../g;s/^pgs?|[^., \d].*//g;map$h{$_}=1,eval}{$\=(keys%h)||1 ``` [TIO](https://tio.run/##PYzRSsMwFIbvfYpz0YFK2zRp6jpkiOzCR/DCOcnsWVeWJiFJB7Lu1Y1pYd58/Ofn/J9BK6sQHMlInpP22ZGdad3L@LHLU9g2n/kjiW0vTHK8JF/XNU3xLOT1kmzX9yf8cYvjwzjSEOIIasZTqJdlCitOsxWPgRYlm8lnPmW04MUUq2rikkbSqpw5vTBWw6FrB4sOhLvFu8n@P4eNltpGKm@F83CIh8JW@O6MsBdSqG8ENfR7tA4aHU1Ke@gRPby/vW6A5QW0Q9eg7NTsBloyDhZFA0LKX218p5ULmfkD) ]
[Question] [ I personally love quines, but they all seem to be so... static. So why not create a quine that can do *more*. **Challenge** The challenge here is to create a quine that without any sort of input is a normal quine. Then if it receives a different input, it outputs a *different* quine in a *different* language. (basically like a polyglot, but it doesn't have to return to the original source code) EX: Starting program: ``` James ``` Given no input or 0 as input, the code above outputs: ``` James ``` Given 1 as input, the code outputs: ``` Kendra ``` Given 2 as input, the code outputs: ``` Alexander ``` And so on... **Requirements** Like with any other quine challenge, no examining source code directly! Inputs are either nothing, or a positive integer. Each quine must not be less than \$\lceil(n/4)\rceil\$ [levenshtein](https://en.wikipedia.org/wiki/Levenshtein_distance) distance from all other quines, where \$n\$ is the length of the original quine. Look at this example program: ``` Bobb //original quine Bobby //output (when given an input), we'll name him bobby Bob //output (when given a different input), we'll name him bob ``` The above is not valid, because Bob is only one levenshtein distance from Bobb. However, this one is valid: ``` Bob //original quine Alice //bob's output when given 1 as input Geronimo //bob's output when given 2 as an input ``` Because \$ ceil(len(bob)/4)=1 \$, and Alice, Geronimo, and Bob are all at more than one levenshtein distance away from each other. There has to be a minimum of one *extra* quine to be outputted. The quine *must* output itself when given no input or 0, and output a different quine if given a different integer input! **Points** Points are based on this equation (courtesy of [Luis felipe De jesus Munoz](https://codegolf.stackexchange.com/users/78039/luis-felipe-de-jesus-muno)) $${\frac{100}{\text{bytes}} \cdot 2^{\text{extra quines} - 1}}$$ (100 divided by the number of bytes multiplied by 2 to the power of every *different* quine that your program can output, minus one to make sure the program at least outputs one *different* quine) [Answer] # [Befunge-98](https://github.com/catseye/FBBI), [><>](https://esolangs.org/wiki/Fish), [Fission](https://github.com/C0deH4cker/Fission), [Wumpus](https://github.com/m-ender/wumpus), [Cardinal](https://www.esolangs.org/wiki/Cardinal), [Gol><>](https://github.com/Sp3000/Golfish) and [Beeswax](https://github.com/m-lohmann/BeeswaxEsolang.jl), Score: \$(100/103)\*2^6 = 62.136\$ ``` "[0#34o+]l2:)&[[email protected]](/cdn-cgi/l/email-protection)*74#!,!?:o#_4F.~6.@1~0@D~FJR'!+!7,++tttt=++%88-$@,kJ'$.k+bf:k+bfj*a!:&,k-.#!0+df+c+f7 ``` [Try it online!](https://tio.run/##S0pNK81LT9W1tPj/XynaQNnYJF87NsfISlMt30HPQMvcRFlRR9HeKl853sRNr85Mz8GwzsDBpc7NK0hdUVvRXEdbuwQIbLW1VS0sdFUcdLK91FX0srWT0qxARJZWoqKVmk62rp6yooF2Spp2snaa@f//BgA "Befunge-98 (FBBI) – Try It Online") [Verification!](https://tio.run/##hVLLbtswEDybX0HRaWRFNO00Ru0KEGq0RQ5BT70GQUBJpM1YJgWSgiKk8a@71MuOe6kO5GA4O7va3aK2WyXvjkexL5S2UBnQI1MbAFKVMRg3mBibCUk0o9kkAKDQQtoJ@l5bZiKEcyYnjTZwTxnjUJfyudBqo@l@klO5KemGYdgoMBQyY6/OFKEgAqNK2C1UhYv3m2dihfIx9Cs/gNRAHkFOKi0s6@zBSDNbaunqJEUbxRFLtwr6b63tuw//wLch4zscLFFwrpxqJu2vXtLUUdS8lA5Op@4f468rBxLWUgiAwcs45aOTtu2CM1XYGRdm2x6kqBGGaCCNUHK4G16XSd1FVOW@KE1/EZ00rxeWKdWuyzQ/gd76QrRReZva6HTAHyt4KXNBZ4mQHepiEsZMRV9busfoCQBAjWFu2B/nddmgYWrzAMZxiwEQrhe3gCsNh@64oZ6wcVOVrPrRrc7/nYWbqirtP9rz1vReuFkYMBIcNmIvHniXbdRt4xASnJheciZcqFuB4xE9zsd3CxU@5Z@j4FqtyfxmuRh72PsWqfHz4p4cvpD17WG@/nm4f/jte6G3xGFo3ReH4afVanq1xrsH/4rsQsqj5ni5oV50jXdTMvbmYcbDNOTLvw) When given an input of 0, this program produces itself. When given a different number, it produces the quines in the format ``` "[0#34o+]l2:)&[[email protected]](/cdn-cgi/l/email-protection)*74#!,!?:o1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 #_4F.~6.@1~0@D~FJR'!+!7,++tttt=++%88-$@,kJ'$.k+bf:k+bfj*a!:&,k-.#!0+df+c+f7 ``` Where the `1`s are the input number. Since there are 26 copies of the `1`, this makes each quine distinct at least \$bytes/4\$ Levenshtein distance. The quines are entirely interchangeable as no program actually cares about the number part. I might see if I can add some more 2D languages to this ~~(I'm thinking [Cardinal](https://www.esolangs.org/wiki/Cardinal) [Gol><>](https://github.com/Sp3000/Golfish) next)~~ Don't have one in mind right now. [Answer] **JAVA -> ><>, (100/460 bytes)\*2^0 = a score of .217... yay** ``` import java.util.Scanner;public class M{public static void main(String args[]){Scanner i=new Scanner(System.in);String s="import java.util.Scanner;public class M{public static void main(String args[]){Scanner i=new Scanner(System.in);String s=%c%s%c;if(i.nextInt()==0){System.out.printf(s,34,s,34,34,34);return;}System.out.println(%c'r3d*d8*7+e0p>>|%c);}}";if(i.nextInt()==0){System.out.printf(s,34,s,34,34,34);return;}System.out.println("'r3d*d8*7+e0p>>|");}} ``` I'm not winning my own challenge, but this should serve as an example. If it gets and input of 0 then it outputs the java quine, if it receives a 1 then it outputs a ><> quine (courtesy of [mbomb007](https://codegolf.stackexchange.com/users/34718/mbomb007)). And that is it... ]
[Question] [ The premise of this is simple: [A 10% chance is pretty unlikely, but everyone knows that a one-in-a-million chance is a sure thing!](http://www.giantitp.com/comics/oots0584.html) So, write code that implements the following "dramatic" probability rules: * Take in a floating point *P* from 0 to 1 representing the unmodified chance of some plot-related event, and a boolean representing whether we're in the climax or not. * Determine *P'* on these conditions: + If 0 < *P* ≤ 10-3 then *P'* = 1. + If .999 ≤ *P* < 1 then *P'* = 0. + If *P* = 0 and we're in the climax, then the heroes will likely get a last-minute sudden advantage and *P'* = .9. + If *P* = 1 and we're in the climax, then the villain will unveil an as-yet-unseen superweapon and *P'* = .1. + Otherwise, *P'* = *P*. * Return truthy or falsey based on *P'* as the chance of truth. For example, if *P'* = .7, then you should return truthy 70% of the time and falsey 30% of the time. Shortest code in bytes wins! [Answer] # [R](https://www.r-project.org/), 86 bytes ``` function(a,b,d=a*(1-a))runif(1)<="if"(d,"if"(d>999e-6,a,1-round(a)),"if"(b,.9-.8*a,a)) ``` [Try it online!](https://tio.run/##hY/RCoMwDEXf9xXiUyJpacc2VtD9S9QWCluVYr@/6/R5NS8Xcm4OJGbX9KLJLoVp80sAppHmgTvQghFjCt6Bxn5ovWthpiNexhgrHsSkRVxSmKF0DzaSNEI@O6ayyh/LAaJd337izYJWZagISSPi5Q9VVSpvV1InvHpf4l437I2qo/x/4tgbP0f@Ag "R – Try It Online") `a` is P' and `b` is 1 or 0 for "in the climax" or not. If `a` is 0 or 1, then `d` will be 0, in which case if `b` is 0 just return `a`, otherwise `.9` minus `.8*a`. Otherwise if `a` is not near 0 or 1, d will be "far" from 0 so return `a`. Otherwise `1-round(a)` will take `a` to the "opposite" 0 or 1. Then see if a random selection from `[0,1]` is less than or equal to the resulting probability. The link does a little simulation for all the possible scenarios to demonstrate that it all seems to work. [Answer] # [C (gcc)](https://gcc.gnu.org/), 82 bytes Zero bytes of source code. Use the preprocessor directive: ``` -Df(p,c)=rand()<~(1<<31)*(c&p==0?.9:p==1&c?.1:(p<=1e-3|p>=.999)&p!=1&p!=0?p<.1:p) ``` [Try it online!](https://tio.run/##jZBdS8MwFIav119xNkmbU9qSUHbRmlgQb7zRMbwUpKTNCKwhdAMFP366MU4mut7s5hx43vd8qnyjlPf@ouu1sT2s1rd3D0@r9f01dSOCG43da7ogy4JrQmogCkj3aBcZcMYghW9XBmprhvYFGkjSBGpIIMlAB@moIEZDayzF12i2G1vb0b0ZesoQL6NZmHBsIIEF8GcHVpR4SviEMDZlVVVNfSeE/5Df4fzMgn/kLPDuP5Xetpudz599fhN@kymUh0@g@KBciJJjSlXspGRNUdUh81g1Ba@pE5L3efnmruThqtjNgxYCa5wIBodf "C (gcc) – Try It Online") Very little to explain about it; `p` is the probability, `c` the climax boolean. Main golfing trick is `~(1<<31)`, which seems to be the equivalent to `RAND_MAX` for gcc. The usual C golfing tricks go straight out the window with floating points. [Answer] # Java 8, 65 bytes ``` P->C->Math.random()<(P==0?C?.9:0:P>.001?P<.999?P:P==1?C?.1:1:0:1) ``` [Try it online.](https://tio.run/##fZPNasJAEMfveYpBaMlqXHcFkaiJ0JTeCgserYdVY42NiZiNIMVrH6CP2Bexkw814mpOm/n/ZmbnY1dyJ5ur@ddxFsokgXcZRN8GQKKkCmawQpWmKgjpIo1mKogj@lYeBq9xOg196yHzEsehLyMLyoPrwgKco2i6XtN9l2pJtzKax2uTDEzhOGzoDandYz3hUsb4UAyobdtD0UONZxrvcVQ5OfYNo1U3hMMs8JyFDBN/D9Xv7@cXOGNPUGgnUm1TtbwlbQQLqY9eFSeTWSy7ySRz9gO19LfX4QuvnMw4pPHCpEJnpCnqCJNLDhN/myfjOdk4d7Y4uZfsTPIHtfBKLfaN06NWlbXUWwYuwAaHiwtQ7sEuDuawxt0wR2obRJ/jCUiS7QmA8hOFbSrykP6VDSNem7BHrKNjS0HnwO/wXIe39dHb2th6Vot29WxXC2dT1NG5XYt37vGa@Lp@VHtxMC7vN59bTszz1wrCgmnxFMErBzjaJ8pf0zhVdIOzVWFkikYNnqHW8Bq1D1VrLKjcbMK9KUh58EiZ6XD8Bw) **Explanation:** We have the following scenario combinations to consider: ``` P=0, C=falsey → 100% falsey P=0, C=truthy → 90% truthy; 10% falsey P=(0,0.001], C=either → 100% truthy P=(0.001,0.999), C=either → (P*100)% truthy; (100-P*100)% falsey P=[0.999,1), C=either → 100% falsey P=1, C=truthy → 10% truthy; 90% falsey P=1, C=falsey → 100% truthy ``` Which gives us the following code: ``` P->C-> // Method with double and boolean parameters and boolean return-type Math.random() // Random value in the range [0, 1) <(P==0? // If P is 0: C? // And there is a climax: .9 // Check if the random value is smaller than 0.9 (90% true) : // Else: 0 // Check if the random value is smaller than 0 (0% true) :P>.001? // Else-if P is larger than 0.001: P<.999? // If P is smaller than 0.999, so in range (0.001,0.999): P // Check if the random value is smaller than P (P*100% true) :P==1? // Else-if P is 1: C? // And there is a climax: .1 // Check if the random value is smaller than 0.1 (10% true) : // Else: 1 // Check if the random value is smaller than 1 (100% true) : // Else, so P is in the range [0.999,1): 0 // Check if the random value is smaller than 0 (0% true) : // Else, so P is in the range (0,0.001]: 1) // Check if the random value is smaller than 1 (100% true) ``` [Answer] # [Perl 6](https://github.com/nxadm/rakudo-pkg), 54 bytes ``` {(($/=1-$^p min$p)??.001>=$/||$/!!$^c*.9)>rand^^$p>.5} ``` [Try it online!](https://tio.run/##LYzLCsIwFET3/YpbuEgiMQ8hYpAkf5JS1IBga4irYv32mLZu5gyHYdI9P09lmGAXwZYPISisOmBIMDxGTNR7LqVyFsU8o2hbDNc9N9TlfryFgMlx/S3vfgKCHQMfiWSAHV2rWiuF@MpN1bI@Sb1RbTiyRnK9hDHnRRlj/qhDdSk/ "Perl 6 – Try It Online") ### Explanation ``` { ( ($/=1-$^p min$p) # Compute min(p,1-p) and store in $/ ?? # if $/ > 0 .001>=$/|| # if $/ <= 0.001 then 1 $/ # else $/ !!$^c*.9 # else 0.9 * climax )>rand # Random Bool with given probability ^^$p>.5 # Flip if p > 0.5 } ``` [Answer] # [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~44~~ 42 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage) [Crossed out &nbsp;44&nbsp; is no longer 44 :)](https://codegolf.stackexchange.com/questions/170188/crossed-out-44-is-still-regular-44) ``` _i90*ë¹₄*©1›i1₄®-‹i¹т*ë¹iiTëтë0ëт]5°<Ý₄/Ω› ``` Port of [my Java 8 answer](https://codegolf.stackexchange.com/a/174717/52210). First input is `P`, second input is `0`/`1` for truthy/falsey whether there is a climax. [Try it online.](https://tio.run/##yy9OTMpM/f8/PtPSQOvw6kM7HzW1aB1aafioYVemIZB9aJ3uo4admYd2XmwCS2dmhhxefbHp8GoDEBVremiDzeG5QHX651YCtfz/b6BnymUAAA) **Explanation:** ``` _i # If the first (implicit) input is exactly 0: 90 # Push 90 * # Multiply it with the second (implicit) input (0 if 0, 90 if 1) ë # Else: ¹₄* # Push the first input, and multiply it by 1000 © # Save it in the register (without popping) 1›i # If it's larger than 1 (so input larger than 0.001): ₄®- # Push 1000, and subtract the value from the register 1 ‹i # If it's smaller than 1 (so input smaller than 0.999): ¹т* # Push the first input multiplied by 100 ë # Else: ¹i # If the first input is exactly 1: i # If the second (implicit) input is 1: T # Push 10 ë # Else: т # Push 100 ë # Else: 0 # Push 0 ë # Else: т # Push 100 ] # Close all if-else clauses 5° # Push 100000 (10**5) < # Decrease it by 1: 99999 Ý # Create a list in the range [0,99999] ₄/ # Divide it by 1000: [0,0.001,0.002,...,99.997,99.998,99.999] Ω # Take a random value from the list › # Check if the earlier value is larger than this random value # (and output implicitly) ``` 05AB1E has no builtin for a random decimal value in the range `[0, 1)`, so I use `5°<Ý₄/` to generate a list in the range `[0,99.999]` in steps of `0.001` and then `Ω` to take a random value from that list (and I use percentages `[0, 100]` instead of decimals `[0, 1]` in the rest of my code). [Answer] # [Perl 5](https://www.perl.org/) `-pl`, 61 bytes ``` $_=(!$_?<>?.9:0:$_==1?<>?.1:1:$_<=.001||($_<.999&&$_))>rand<> ``` [Try it online!](https://tio.run/##K0gtyjH9/18l3lZDUSXe3sbOXs/SysAKyLc1BPMMrQyBPBtbPQMDw5oaDSBTz9LSUk1NJV5T064oMS/Fxu7/f0Muw3/5BSWZ@XnF/3ULcgA "Perl 5 – Try It Online") Input is on two lines. First line is P; second line is 0 if not in climax, 1 if in climax. [Answer] # Python 3, 118 bytes ``` from random import * def f(p,c): if c: if p==1:p=.9 if p==0:p=.1 if p<1e-3:p=1 if p>.999:p=0 return random()<p ``` Inputs: p is initial probability, c is climax ]
[Question] [ So, I wrote a simple Javascript game (as yet unnamed) and naturally I wanted to write an API so I could write a bot to play it for me, and naturally I wanted to let the PPCG community have a go for themselves. It's a 'snake' game with the simple goal of collecting as many blue squares as possible while avoiding red squares or the edge of the board. It was initially [controlled with a mouse](https://ajfaraday.github.io/game_name_here/index.html). [![Example of gameplay](https://i.stack.imgur.com/9vOmE.png)](https://i.stack.imgur.com/9vOmE.png) Find the API edition of the game here: <https://ajfaraday.github.io/game_name_here/api.html> **Gameplay:** * Type the code for your bot in the field under 'Your function': This will repeat automatically when you tell it to run. + Only in Javascript, sorry. + See restrictions, below. * You can try it step-wise by clicking 'step'. * I suggest you 'Run (fast)' once you have a workable function. * Click 'Reset' to try a fresh game. * Every 10 points will increase the points per blue square by 1. * Every 10 points will increase the red squares spawned by 1. * You can lose lives by: + Gobbling up a red square (Be aware that, while you lose a life, it also breaks down the wall. Sacrificing lives to break through walls is a legitimate tactic). + Attempting to leave the game board. + Running down the 'Timeout' clock of 20 seconds between blue squares. * You will not lose a life by 'stepping on your tail' in this version. * Every 100 points will earn an additional life. * Be aware that all coordinates are x, y starting in the *top left* corner. 0 indexed. **Restrictions:** * There is no security in this code. Please do not hack the game! + Only use standard JS and the API methods described. + PLEASE! Don't change API.coord + You may not interact directly with Sketch, Cell or other entities defined within the game. **The competition** * Please give your entry title a short name for your snake. * Include your JS code and any explanation you'd like to include. * The OP will copy/paste the code into the game, and run it 5 times (using 'Run (fast)'). * The highest score achieved in those attempts is your score. * The OP will add your score to the answer, and to a leader board in the question. * You may submit more than one function. --- **Leader Board** ``` +--------------------------+---------------------------------+----------+ | Username | Snake Name | Score | +--------------------------+---------------------------------+----------+ | orlp | Simple A* | 595 | +--------------------------+---------------------------------+----------+ ``` **Rendering Issue** This rendering issue has now been fixed and deployed. ~~Please be aware that if you call more than one of the direction methods during your function, the snake will visit all of the squares and collect points or lose lives accordingly. However, due to a rendering issue, it will only display the ending position of your snake.~~ Be aware that the snake **can not** travel diagonally between walls without losing a life. --- **Responsible disclosure:** This is written in pure Javascript, it contains no logging, analytics or other data gathering processes. It's hosted on github pages, typically a trusted home of code. If you want to confirm this, or would prefer to develop your answer on a locally hosted instance, the code is available here: <https://github.com/ajfaraday/game_name_here> --- This is my first attempt at a competitive non-golf challenge, so I'm open to suggestions about how I could make it more suitable for this kind of situation. Happy snaking! [Answer] # Simple A\* - Official score: 595 This solution uses simple A\* pathfinding, with no long-term strategy - it always finds the optimal route towards just the next blue square. ``` var h = function(p, q) { // Manhattan distance. return Math.abs(p[0] - q[0]) + Math.abs(p[1] - q[1]); }; var s = JSON.stringify; var p = JSON.parse; var walls = API.walls.map(s); var start = API.coord; var goal = API.goal; var is_closed = {}; is_closed[s(start)] = 0; var open = [s(start)]; var came_from = {}; var gs = {}; gs[s(start)] = 0; var fs = {}; fs[s(start)] = h(start, goal); var cur; while (open.length) { var best; var bestf = Infinity; for (var i = 0; i < open.length; ++i) { if (fs[open[i]] < bestf) { bestf = fs[open[i]]; best = i; } } cur = p(open.splice(best, 1)[0]); is_closed[s(cur)] = 1; if (s(cur) == s(goal)) break; for (var d of [[0, 1], [0, -1], [1, 0], [-1, 0]]) { var next = [cur[0] + d[0], cur[1] + d[1]]; if (next[0] < 0 || next[0] >= API.width || next[1] < 0 || next[1] >= API.height) { continue; } if (is_closed[s(next)]) continue; if (open.indexOf(s(next)) == -1) open.push(s(next)); var is_wall = walls.indexOf(s(next)) > -1; var g = gs[s(cur)] + 1 + 10000 * is_wall; if (gs[s(next)] != undefined && g > gs[s(next)]) continue; came_from[s(next)] = cur; gs[s(next)] = g; fs[s(next)] = g + h(next, goal); } } var path = [cur]; while (came_from[s(cur)] != undefined) { cur = came_from[s(cur)]; path.push(cur); } var c = path[path.length - 1]; var n = path[path.length - 2]; if (n[0] < c[0]) { API.left(); } else if (n[0] > c[0]) { API.right(); } else if (n[1] < c[1]) { API.up(); } else { API.down(); } ``` ]
[Question] [ # Background I was working on a StackOverflow helper program (that sends me notifications) when I noticed something rather interesting in StackOverflow's Network tab: [![enter image description here](https://i.stack.imgur.com/cCfaH.png)](https://i.stack.imgur.com/cCfaH.png) StackOverflow uses WebSockets (not too surprising, but good to know)! For this challenge, we will be conquering StackOverflow's web socket server. This particular method could be transferred over to other domains related to StackExchange, but StackOverflow is very popular and a good example. Feel free to lookup tags for other domains on StackExchange (feel free to connect to those instead, although I doubt it would reduce byte count since StackOverflow has id 1). # StackOverflow's Unofficial WebSocket API There are two separate WebSocket servers you could use: * The secure, `wss://qa.sockets.stackexchange.com/` * Or the insecure, `ws://qa.sockets.stackexchange.com/` Since we are code golfing and we aren't going to be sending any not-already-public-information, I suspect people will lean more toward the insecure option. Next, in order to subscribe to our favorite tag, we need to send the following to the WebSocket to 'subscribe' to the tag's feed. ``` 1-questions-newest-tag-javascript ``` You can replace `javascript` with any tag we're interested in. The server will occasional send heartbeat requests. You must reply with `hb` (so you can keep the connection alive). A heartbeat requests looks as follows: ``` {"action":"hb","data":"hb"}` ``` Here's a basic JavaScript-based socket (it may take a several minutes for there to be a new post, depending on time of day). I used the most popular tag JavaScript to test with, but if you know of a more popular tag, go ahead and leave a comment. Example: ``` var exampleSocket = new WebSocket("wss://qa.sockets.stackexchange.com/"); exampleSocket.onopen = function (event) { exampleSocket.send("1-questions-newest-tag-javascript"); }; exampleSocket.onmessage = function (event) { if (JSON.parse(event.data).data === "hb") { exampleSocket.send("hb") } console.log(event.data) }; ``` # Specifications Input: Any tag the user wants to receive updates about. Output: Should be the first question (from when you connected to the WebSocket) and all consecutive available for said tag on StackOverflow. Rules: * You **must** use WebSockets. Or, at least connect to `sockets.stackexchange.com` (including, `ws://qa.sockets.stackexchange.com`) and use it to receive updates for the inputted tag. If you can find a better way of doing it (like not using the `1-questions-newest-tag-<tag>` but still receive updates fo the inputted tag) by all means. Or if you can write your own WebSocket equivalent in less bytes, even cooler. * Least number of bytes wins! # Language Compatibility External libraries are encouraged. Many programming languages have a compatible library. [Answer] # Clojure with [gniazdo](https://github.com/stylefruits/gniazdo), ~~126~~, ~~*204*~~, 203 bytes +78 bytes to handle reacting to heartbeat messages -1 byte by changing from indexing the string converted to a vector, to just using `nth`. I was expecting more of a gain from that **:/** ``` (use '[gniazdo.core])(fn[t](let[a(atom 0)s #(send-msg @a %)o(connect"ws://qa.sockets.stackexchange.com":on-receive #(if(=((vec %)11)\h)(s"hb")(println %)))](reset! a o)(s(str"1-questions-newest-tag-"t)))) ``` An anonymous function that takes a string tag, and prints the raw JSON results as they're received, while responding to heartbeats. To test if the received message is a heartbeat, I'm testing if the 12th character of the response is the character `h`. After looking over [this](https://meta.stackexchange.com/questions/218343/how-do-the-stack-exchange-websockets-work-what-are-all-the-options-you-can-sendp) page, it seems impossible for `h` to be the 12th character without the response being a heartbeat. If this isn't the case, I can try to figure out a workaround. ``` (ns bits.golf.web-sock (:require [gniazdo.core :as g])) (defn new-tag-posts [^String tag] (let [; A mutable state to hold the sock. ; Necessary since the sock's callback requires a reference to the ; sock itself sock-a (atom nil) ; Shortcut function to save bytes send #(g/send-msg @sock-a %) handler #(if (= (nth % 11) \h) ; If the 12th character (at index 11) is 'h' (send "hb") ; respond to the heartbeat (println %)) ; else print the JSON sock (g/connect "ws://qa.sockets.stackexchange.com" :on-receive handler)] ; Set the mutable state to the created socket (reset! sock-a sock) ; Subscribe to the given tag (send (str "1-questions-newest-tag-" tag)))) ``` [Answer] # Groovy, 388 without the @Grab ``` @Grab('org.java-websocket:Java-WebSocket:1.3.6') import org.java_websocket.client.*;import org.java_websocket.handshake.* new WebSocketClient(new URI("ws://qa.sockets.stackexchange.com/")){void onOpen(ServerHandshake h){send("1-questions-newest-tag-"+args[0]);} void onClose(int c,String r,boolean b){} void onMessage(String m){println(m);if(m.indexOf('"action":"hb"')>0){send('hb');}} void onError(Exception e){}}.connect(); while(1){} ``` With the @Grab directive, run with `groovy snippet.groovy javascript` Without the @grab directive, you have to download the library, and run `groovy -cp Java-WebSocket-1.3.6.jar snippet.groovy javascript` [Answer] # Bash, ~~353~~ ~~346~~ 333 + 11 = 344 bytes **Builtins only, no coreutils.** +11 bytes for `-O extglob` option. The script contains unprintable characters, which are represented by e.g. `<81>` (a hex pair) or `<CR>` below. Also note there is a trailing space on lines 2 and 5. A full xxd dump follows.. Invoke like this: ``` $ bash -O extglob script.sh javascript ``` Output is on STDERR. **Note:** This requires that your copy of bash was built with the `--enable-net-redirections` compile option. The default bash on OS X was not, but the version on Homebrew was (`brew install bash && $(brew --prefix)/bin/bash ...`). ``` exec</dev/tcp/qa.sockets.stackexchange.com/80>&0 p=printf\ $p"GET / HTTP/1.1 Host: x Upgrade: Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ== Sec-WebSocket-Version: 13 " r=read;$r;$r;$r;$r;$r $p"<81>\\`$p%o $((${#1}+151))`\0\0\0\0001-questions-newest-tag-$1" g()($p<81><82><01><01><01><01>ic sleep 5 g);g& h()($r -d} D $p"${D##?@(~?|<7F>???????|)?}}">&2 h);h ``` ## xxd dump ``` <!-- 00000000: 6578 6563 3c2f 6465 762f 7463 702f 7161 exec</dev/tcp/qa 00000010: 2e73 6f63 6b65 7473 2e73 7461 636b 6578 .sockets.stackex 00000020: 6368 616e 6765 2e63 6f6d 2f38 303e 2630 change.com/80>&0 00000030: 0a70 3d70 7269 6e74 665c 200a 2470 2247 .p=printf\ .$p"G 00000040: 4554 202f 2048 5454 502f 312e 310a 486f ET / HTTP/1.1.Ho 00000050: 7374 3a20 780a 5570 6772 6164 653a 200a st: x.Upgrade: . 00000060: 5365 632d 5765 6253 6f63 6b65 742d 4b65 Sec-WebSocket-Ke 00000070: 793a 2064 4768 6c49 484e 6862 5842 735a y: dGhlIHNhbXBsZ 00000080: 5342 7562 3235 6a5a 513d 3d0a 5365 632d SBub25jZQ==.Sec- 00000090: 5765 6253 6f63 6b65 742d 5665 7273 696f WebSocket-Versio 000000a0: 6e3a 2031 330a 0a22 0a72 3d72 6561 643b n: 13..".r=read; 000000b0: 2472 3b24 723b 2472 3b24 723b 2472 0a24 $r;$r;$r;$r;$r.$ 000000c0: 7022 815c 5c60 2470 256f 2024 2828 247b p".\\`$p%o $((${ 000000d0: 2331 7d2b 3135 3129 2960 5c30 5c30 5c30 #1}+151))`\0\0\0 000000e0: 5c30 3030 312d 7175 6573 7469 6f6e 732d \0001-questions- 000000f0: 6e65 7765 7374 2d74 6167 2d24 3122 0a67 newest-tag-$1".g 00000100: 2829 2824 7081 8201 0101 0169 630a 736c ()($p......ic.sl 00000110: 6565 7020 350a 6729 3b67 260a 6828 2928 eep 5.g);g&.h()( 00000120: 2472 202d 647d 2044 0a24 7022 247b 4423 $r -d} D.$p"${D# 00000130: 233f 4028 7e3f 7c7f 3f3f 3f3f 3f3f 3f7c #?@(~?|.???????| 00000140: 293f 7d7d 223e 2632 0a68 293b 68 )?}}">&2.h);h --> ``` ]
[Question] [ I'm new to this code-golfing thing and I'm very interested in CJam. Is there a way to get all the current stack as an array? I think I can do it with something like `[1$ 2$...n$]` but I would have to get the stack's length and use some kind of iterator (or use a fixed length stack... useless). But is there a way to achieve this with a single operator? The thing is I want to iterate over all the stack's elements. Sorry if the question is obvious or seems stupid, but I'm new to this and I couldn't find anything... [Answer] An unmatched `]` command will make the entire stack into an array. ``` 1 2 3 4 ] -> [1 2 3 4] ``` ]
[Question] [ **This question already has answers here**: [What will you bring for Thanksgiving?](/questions/100470/what-will-you-bring-for-thanksgiving) (15 answers) Closed 6 years ago. Everyone loves [The Big Bang Theory](https://en.m.wikipedia.org/wiki/The_Big_Bang_Theory), right? And everyone loves [polyglots](https://en.m.wikipedia.org/wiki/Polyglot_(computing)), right? So let's combine them! # Task Your task *in each language* is quite basic. You must output the name of the one of the 5 main characters of The Big Bang Theory: Sheldon Lee Cooper, Leonard Leakey Hofstadter, Howard Joel Wolowitz, Rajesh Ramayan Koothrapali and Penny Hofstadter. Your task overall is to write a polyglot that will work in at least *5* languages. Each language should output a different character on the show. I say "at least" because in order to win, you must output more characters (see Scoring below). But before that, let's go over the details of your program # Input You program should take no input when run in any of the languages. # Output Your program should output the **full name** of a different characters of TBBT for each language it is run in. If no middle name is known, no middle name is required. 5 of those characters must be the 5 main characters: * Leonard Leakey Hofstadter * Sheldon Lee Cooper * Howard Joel Wolowitz * Rajesh Ramayan Koothrapali * Penny Hofstadter The names outputted must be characters that have appeared in more than one episode and they must have both a first and a last name. If they have a middle name, it **must** be outputted as well. # Scoring The scoring system is quite basic: your score is the length of your code in bytes minus 20 times the extra number of characters you output. The extra characters are any that aren't in the list above. ``` length - 20 * (num_characters - 5) ``` You may also subtract 100 from your score if you don't use any comment characters. # Rules * No builtins allowed. (Why not?) * The lowest score wins. * Only characters with both first *and* surnames are valid * You must output to STDOUT or your languages equivalent. Nothing may be outputted to STDERR * Each submission must run in at least *5 different languages* * Different language versions *do not* count as different languages * Entries must be **full programs** * Case and whitespace matter so an output of `Pen nyHof STAdter` isn't valid. * The valid characters are listed [here](https://pastebin.com/1E5AJj7r) * Leading/trailing whitespace is allowed. * A comment character is a character that makes the program ignore the next line or command [Answer] # [Foo](https://esolangs.org/wiki/Foo), Python, JavaScript, [Retina](https://github.com/m-ender/retina), [><>](https://esolangs.org/wiki/Fish): ~~166~~ 148 bytes ``` 1//1;print('Sheldon Lee Cooper');""" alert`Howard Joel Wolowitz` // Rajesh Ramayan Koothrapali //!?? //\"Leonard Leakey">o<'Penny'" Hofstadter""" ``` The trailing newline is significant. [Foo outputs `Leonard Leakey Hofstadter`](https://tio.run/nexus/foo#FY2xDsIgFEX3fsWTBZ1I5xo7uDTKYHRwcehLeIZa5BFK0uDPY5nucE7OLa1SbRfi5NNePiw5wx40EZyZA0V56IQQDTqKaRx4xWjgwuTgyY7XKf3GplEK7vihxW7zxYwerszJRgzopo3u@r5KL6GJfQ1owpmyOPFR3sj7LAUM/F4SmkSx3pXyBw) [Python outputs `Sheldon Lee Cooper`](https://tio.run/nexus/python3#FY2xDsIgFEX3fsWTBZ1I5xo7uDTKYHRwcehLeIZa5BFK0uDPY5nucE7OLa1SbRfi5NNePiw5wx40EZyZA0V56IQQDTqKaRx4xWjgwuTgyY7XKf3GplEK7vihxW7zxYwerszJRgzopo3u@r5KL6GJfQ1owpmyOPFR3sj7LAUM/F4SmkSx3pXyBw) [JavaScript outputs `Howard Joel Wolowitz`](https://jsfiddle.net/96s9LttL/3/) [Retina outputs `Rajesh Ramayan Koothrapali`](https://tio.run/nexus/retina#FY2xDsIgFEX3fsWTBZ1I5xo7uDTKYHRwcehLeIZa5BFK0uDPY5nucE7OLa1SbRfi5NNePiw5wx40EZyZA0V56IQQDTqKaRx4xWjgwuTgyY7XKf3GplEK7vihxW7zxYwerszJRgzopo3u@r5KL6GJfQ1owpmyOPFR3sj7LAUM/F4SmkSx3pXyBw) [><> outputs `Penny Hofstadter`](https://tio.run/nexus/fish#FY2xDsIgFEX3fsWTBZ1I5xo7uDTKYHRwcehLeIZa5BFK0uDPY5nucE7OLa1SbRfi5NNePiw5wx40EZyZA0V56IQQDTqKaRx4xWjgwuTgyY7XKf3GplEK7vihxW7zxYwerszJRgzopo3u@r5KL6GJfQ1owpmyOPFR3sj7LAUM/F4SmkSx3pXyBw) ## Explanations ### Foo In Foo, any text written inside double quotes is sent to STDOUT. So it outputs `Leonard Leakey` and `Hofstadter`. It also prints it with a leading newline. Honestly I'm really not sure about how it parses strings, but it works as-is. It also tries to do some other operations (`/` is divide, parentheses form loops, etc.), but all of that just causes errors and prints to STDERR without affecting the main output in any way. ### Python `1//1` is 1 integer divided by 1. In a statement by itself, that does nothing relevant. Then it prints `Sheldon Lee Cooper`, and the rest is in a triple quoted string, which is basically a block comment. ### JavaScript JavaScript sees most lines as either empty or commented (`//`). The first statement is `1` by itself which, like in the Python part, does nothing. Then it `alert`s `Howard Joel Wolowitz`. ### Retina ``` 1//1;print('Sheldon Lee Cooper');""" alert`Howard Joel Wolowitz` ``` First all matches of `1//1;print('Sheldon Lee Cooper');"""` in the input are replaced with `alert`Howard Joel Wolowitz``. Seeing as the input is empty, nothing happens. ``` // Rajesh Ramayan Koothrapali ``` Then the empty input is replaced with `// Rajesh Ramayan Koothrapali`. ``` //!?? ``` Then all matches of `//` optionally followed by a `!` are replaced with nothing. This deletes the initial `//`, leaving one leading space (which is allowed). ``` //\"Leonard Leakey">o<'Penny'" Hofstadter""" ``` Then all matches of the regex above are replaced with nothing. This regex doesn't match anything in the working string, so nothing happens. The working string is then output implicitly. ### ><> The IP starts in the top-left, initially moving right. It first pushes 1, then bounces around on mirrors (`/` and `\`) for a while (looping around when it goes out of bounds). The `1` will be popped when it hits `?`. Eventually it will be on the right side of the second last line moving left. On this line, it sees an empty string `""`, pushing nothing. Then it encounters two strings, `" Hofstadter"` and `'Penny'`, pushing the characters from each as it sees them. When it hits `>o<`, it repeatedly pops and prints the top of the stack as a character, until there's nothing left to pop. It exits with an error. [Answer] # [Befunge-98](http://esolangs.org/wiki/Funge-98), [><>](http://esolangs.org/wiki/fish), [Haystack](https://github.com/kade-robertson/haystack), [Minkolang](https://github.com/elendiastarman/Minkolang), [Alice](https://github.com/m-ender/alice): 5 languages ## ~~151~~ ~~150~~ 146 bytes *4 bytes saved thanks to @MartinEnder* ``` #\"retdatsfoH ynneP">:#,_@>o<'Leonard Leakey Hofstadter' #>!v"Howard Joel Wolowitz"$O. | @>"Sheldon Lee Cooper"O d&O>/"ilaparhtooK nayamaR hsejaR" ``` All aboard the 2D-language train! I got the template for this answer from a previous [answer](https://codegolf.stackexchange.com/a/101196/41805) of mine from a similar challenge, but I wanted this submission to be composed of *only* 2D languages. I am planning to add more languages soon. ### Befunge-98 [Try it online!](https://tio.run/nexus/befunge-98#FcvBCoJAEAbgu08xjZGXqHvEEnSREgw7dAliYEe0tv1lXRKjd7c6f3xTeuWg0Ursa@Q0eq8nNpt0edsZbLNC4SVYKlQeOlKOuo9io4YsSc3sxTmGPx@gji5wGNr45nm5Sj60M3xu1Fn431baA50GLhO7KM2aWyedhCYCR/IyylMqanq9S8XT9AU "Befunge-98 – TIO Nexus") ``` # Jump over one command "retdatsfoH ynneP" Push the characters in this string >:#,_@ Print it (basically checks if the top value is not zero, then prints it, otherwise exits the program) ``` Outputs `Penny Hofstadter`. ### ><> [Try it online!](https://tio.run/nexus/fish#FcvBCoJAEAbgu08xjZGXqHvEEnSREgw7dAliYEe0tv1lXRKjd7c6f3xTeuWg0Ursa@Q0eq8nNpt0edsZbLNC4SVYKlQeOlKOuo9io4YsSc3sxTmGPx@gji5wGNr45nm5Sj60M3xu1Fn431baA50GLhO7KM2aWyedhCYCR/IyylMqanq9S8XT9AU "><> – TIO Nexus") ``` # Reflect; the IP moves to the left and wraps around to go to the right edge of the field 'retdatsfo ... ranoeL' Push the characters in this string >o< And output each character in the stack until there are no more, at which point the program exits with an error ``` Outputs `Leonard Leakey Hofstadter` and exits with an error. ### Haystack [Try it online!](https://tio.run/nexus/haystack#FcvBCoJAEAbgu08xjZGXqHvEEnSREgw7dAliYEe0tv1lXRKjd7c6f3xTeuWg0Ursa@Q0eq8nNpt0edsZbLNC4SVYKlQeOlKOuo9io4YsSc3sxTmGPx@gji5wGNr45nm5Sj60M3xu1Fn431baA50GLhO7KM2aWyedhCYCR/IyylMqanq9S8XT9AU "Haystack – TIO Nexus") ``` # Ignored \ Reflect; moves downward > Move right ! Ignored v Go down > Go right Sheldon Lee Cooper" Push this string O Output all characters in the stack; the program wraps around to the left edge | End program ``` Outputs `Sheldon Lee Cooper`. ### Minkolang [Try it online!](https://tio.run/nexus/minkolang#FcvBCoJAEAbgu08xjZGXqHvEEnSREgw7dAliYEe0tv1lXRKjd7c6f3xTeuWg0Ursa@Q0eq8nNpt0edsZbLNC4SVYKlQeOlKOuo9io4YsSc3sxTmGPx@gji5wGNr45nm5Sj60M3xu1Fn431baA50GLhO7KM2aWyedhCYCR/IyylMqanq9S8XT9AU "Minkolang – TIO Nexus") ``` # Doesn't do anything important \ Reflect; moves downward > Move right ! Ignore the next command "Howard Joel Wolowitz" Push this $O Output all characters in the stack . End program ``` I could have put the `.` and the beginning of the second line so that the IP would encounter that once it wraps around, but since the grid is padded with spaces and Minkolang travels through time when it sees a space (infinite loop in this case), I had to include the `.` right after the `$O`. Outputs `Howard Joel Wolowitz`. ### Alice [Try it online!](https://tio.run/nexus/alice#FcvBCoJAEAbgu08xjZGXqHvEEnSREgw7dAliYEe0tv1lXRKjd7c6f3xTeuWg0Ursa@Q0eq8nNpt0edsZbLNC4SVYKlQeOlKOuo9io4YsSc3sxTmGPx@gji5wGNr45nm5Sj60M3xu1Fn431baA50GLhO7KM2aWyedhCYCR/IyylMqanq9S8XT9AU "Alice – TIO Nexus") Alice was the most fun and the most confusing of these languages. ``` # Skip the next command \ Mirror; redirect IP north-east The IP gets reflected off the top and start moving south-east instead ! This command gets skipped over from the # > Set the horizontal component of the IP to East (changes nothing) / Set the IP's direction to East "ilaparht ... sejaR" Push this IP wraps around and comes in from the left edge d&O Output the string (duplicate the output command stack length times) ``` Now the program goes on a joyride (@MartinEnder showed how this bit works to me) to get to the `@` in Row 3, Column 3. ``` / Mirror; redirect IP south-east The IP hits the bottom and reflects north-east ``` Now the IP moves diagonally up and down as it gets reflected executing the commands along its way. ``` anJ Push 10; negate it into an empty string; and jump to origin (0, 0) After the jump, the IP still moves in a north-easterly (irk) direction # Skip the next command IP gets reflected and start moving south-east @ Terminate the program ``` Of course, the `@` could have been placed right after the `d&O` (replacing the useless `>`) but that wouldn't have been fun :) Outputs `Rajesh Ramayan Koothrapali`. [Answer] # Clojure, Java, Ruby, Groovy, Common Lisp - 297 bytes ``` ;/\u002A/ (if '()(print"Leonard Leakey Hofstadter")(eval(quote(princ"Sheldon Lee Cooper")))) ;'then print "Howard Joel Wolowitz" end) ;%(/a*/class I{public static void main(String[]a){System.out.print("${}".getClass().getName().contains("G")?"Rajesh Ramayan Koothrapali":"Penny Hofstadter");}}//%) ``` Ruby actually sees all the lines of the program. The first line is a `;` (no-op) followed by Ruby `Regexp`. The second line is an `if` expression which evaluates a string which is True and on the third line it prints the character. The last line is no-op again followed by multi-line string `%(` and `%)`. See it online : [Ruby](http://ideone.com/b1mh0N "Ruby") Java and Groovy see the same portion of the program, these langauges allow `;` as no-op (first line), then the comment is started as `/\u0002A` which evaluates to `/*` and then the comment ends right before class declaration. After that it's a plain Java/Groovy program. In order to distinguish between them I check the name of the String object class, in Java it will be the usual `java.lang.String` but in Groovy this string object will have class name `groovy.lang.GString` because it contains interpolated expression `${}`. See it online: [Java](http://ideone.com/S727cO "Java") , [Groovy](https://ideone.com/TSN41Q "Groovy") Clojure and Common Lisp see only the second line of the program (`;` denotes comment). In Clojure empty list `'()` (quote symbol luckily denotes string in ruby) evaluates to `true` and it evaluates to `nil` in Common Lisp, which is `false`. `eval` has to be used in an `else` part because `print` in Common Lisp outputs value with double-quotes so `princ` is used which is not a valid function in Clojure so it's eval`d. See it online: [Clojure](https://ideone.com/9SrCRl "Clojure") , [Common Lisp](https://ideone.com/QxPZR5 "Common%20Lisp") ]
[Question] [ A number square containing the values `1`, `2`, `3`, `4` looks like this: ``` 12 34 ``` To work out what a number square is, you first make four numbers by reading across the rows and across the columns; for the example above you would get `12`, `34`, `13` and `24`, then you add them all up (`12+34+13+24`), giving you the value of the square. However, there is a catch: the square your program outputs must output the lowest possible square. The way to calculate how 'low' the square is is like this: 1. Take the top-left number, and place it in the variable `a`. 2. Take the top-right number, double it and add the total to `a`. 3. Take the bottom-left number, triple it and add the total to `a`. 4. Take the bottom-right number, quadruple it and add the total to `a`. 5. The variable `a` now holds how 'low' you square is! ## Requirements * Your program must output the lowest possible number square, in the format that follows: ``` ab cd ``` (where `a`, `b`, `c` and `d` are integers in the range `0-9`). * The square will never contain a number multiple digits long (negative numbers as well). You don't have to handle that case. * You can take input, which will be the number the square should equal, as an argument, as function argument or from `STDIN`. Please specify how input should be given for your program. * If there is not a number square that equals what the input number, output nothing. * If two numbers squares are equally low and produce the same output, nothing should be output. ## Rules * [Standard loopholes](http://meta.codegolf.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default) are forbidden. * Your program must not write anything to `STDERR`. ## Test Cases ``` 44 ==> 04 00 ----- 2 ==> 00 01 ----- 100 ==> 50 00 ``` @MartinBüttner has also done a [Pastebin with all the possible solutions](http://pastebin.com/nxYDkAQK). ## Scoring Programs are scored according to bytes. The usual character set is UTF-8, if you are using another please specify. To win this [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") challenge, try to get the least bytes! ## Submissions To make sure that your answer can be parsed, please start your answer with a headline, using the following Markdown template: ``` # Language Name, N bytes ``` where `N` is the size of your submission. If you improve your score, you *can* keep old scores in the headline, by striking them through. For instance: ``` # Ruby, <s>104</s> <s>101</s> 96 bytes ``` If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the *last* number in the header: ``` # Perl, 43 + 2 (-p flag) = 45 bytes ``` You can also make the language name a link which will then show up in the leaderboard snippet: ``` # [><>](http://esolangs.org/wiki/Fish), 121 bytes ``` ## Leaderboard Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language. ``` /* Configuration */ var QUESTION_ID = 80765; // Obtain this from the url // It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe"; var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk"; var OVERRIDE_USER = 53406; // This should be the user ID of the challenge author. /* App */ var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page; function answersUrl(index) { return "https://api.stackexchange.com/2.2/questions/" + QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER; } function commentUrl(index, answers) { return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER; } function getAnswers() { jQuery.ajax({ url: answersUrl(answer_page++), method: "get", dataType: "jsonp", crossDomain: true, success: function (data) { answers.push.apply(answers, data.items); answers_hash = []; answer_ids = []; data.items.forEach(function(a) { a.comments = []; var id = +a.share_link.match(/\d+/); answer_ids.push(id); answers_hash[id] = a; }); if (!data.has_more) more_answers = false; comment_page = 1; getComments(); } }); } function getComments() { jQuery.ajax({ url: commentUrl(comment_page++, answer_ids), method: "get", dataType: "jsonp", crossDomain: true, success: function (data) { data.items.forEach(function(c) { if (c.owner.user_id === OVERRIDE_USER) answers_hash[c.post_id].comments.push(c); }); if (data.has_more) getComments(); else if (more_answers) getAnswers(); else process(); } }); } getAnswers(); var SCORE_REG = /<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/; var OVERRIDE_REG = /^Override\s*header:\s*/i; function getAuthorName(a) { return a.owner.display_name; } function process() { var valid = []; answers.forEach(function(a) { var body = a.body; a.comments.forEach(function(c) { if(OVERRIDE_REG.test(c.body)) body = '<h1>' + c.body.replace(OVERRIDE_REG, '') + '</h1>'; }); var match = body.match(SCORE_REG); if (match) valid.push({ user: getAuthorName(a), size: +match[2], language: match[1], link: a.share_link, }); }); valid.sort(function (a, b) { var aB = a.size, bB = b.size; return aB - bB }); var languages = {}; var place = 1; var lastSize = null; var lastPlace = 1; valid.forEach(function (a) { if (a.size != lastSize) lastPlace = place; lastSize = a.size; ++place; var answer = jQuery("#answer-template").html(); answer = answer.replace("{{PLACE}}", lastPlace + ".") .replace("{{NAME}}", a.user) .replace("{{LANGUAGE}}", a.language) .replace("{{SIZE}}", a.size) .replace("{{LINK}}", a.link); answer = jQuery(answer); jQuery("#answers").append(answer); var lang = a.language; if (/<a/.test(lang)) lang = jQuery(lang).text(); languages[lang] = languages[lang] || {lang: a.language, user: a.user, size: a.size, link: a.link}; }); var langs = []; for (var lang in languages) if (languages.hasOwnProperty(lang)) langs.push(languages[lang]); langs.sort(function (a, b) { if (a.lang > b.lang) return 1; if (a.lang < b.lang) return -1; return 0; }); for (var i = 0; i < langs.length; ++i) { var language = jQuery("#language-template").html(); var lang = langs[i]; language = language.replace("{{LANGUAGE}}", lang.lang) .replace("{{NAME}}", lang.user) .replace("{{SIZE}}", lang.size) .replace("{{LINK}}", lang.link); language = jQuery(language); jQuery("#languages").append(language); } } ``` ``` body { text-align: left !important} #answer-list { padding: 10px; width: 290px; float: left; } #language-list { padding: 10px; width: 290px; float: left; } table thead { font-weight: bold; } table td { padding: 5px; } ``` ``` <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b"> <div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr> </thead> <tbody id="answers"> </tbody> </table> </div> <div id="language-list"> <h2>Winners by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr> </thead> <tbody id="languages"> </tbody> </table> </div> <table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr> </tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr> </tbody> </table> ``` [Answer] # Pyth, ~~43~~ ~~41~~ 36 bytes ``` J.ms*VS4sbfqQsiR10sCBT^^UT2 2?tlJkhJ ``` [Test suite.](http://pyth.herokuapp.com/?code=J.ms*VS4sjRTbfqQ%2BsTisMjR10T%3B%5EU*TT2%3FtlJkhJ&test_suite=1&test_suite_input=44%0A244%0A2%0A100&debug=0) Output as 2D array. `ab/cd` is represented as `[[a, b], [c, d]]`. ## How it works ``` J.ms*VS4sbfqQsiR10sCBT^^UT2 2?tlJkhJ ^^UT2 2 Generate all number-squares with the above format. fqQsiR10sCBT f T Filter the squares as T: CB Yield [T, transpose(T)] s Yield T union transpose(T) We generated the rows and columns of the number square. iR10 Convert each from base10 array to int. s Sum. qQ Check if equal to the input. J.ms*VS4sb .m b Find the squares (as b) in the filtered-result, in which the following attains minimum: s Flatten. *VS4 Multiply the first number by 1, the second number by 2, the third number by 3, and the fourth number by 4. s Sum. J Assign to the variable J. ?tlJkhJ ? if tlJ length of J is not 1: k output empty string hJ else: output the first element of J ``` [Answer] # Pyth, 69 bytes ``` J.x.mebm,ds.e*hksbdfqQssM[<2T>2T+hTePT+htTeT)m.[\04`dU10000k?qlJ1hhJk ``` [Try it here!](http://pyth.herokuapp.com/?code=J.x.mebm%2Cds.e*hksbdfqQssM[%3C2T%3E2T%2BhTePT%2BhtTeT%29m.[%5C04%60dU10000k%3FqlJ1hhJk&input=44&debug=0) Outputs the square as a 4-digit number. Works by generating all possible squares, keeping the ones which have the given number and then getting the lowest one. Detailed Explanation later, gonna try to find a shorter way to calculate the number of a square first. [Answer] ## Matlab(284) Too much rules, too much bytes, i hate too much rules! ``` function h(n),f=mod(n,2);b=(n-11*f)/2;a=fix((n-2*b)/11);c=(mod(ceil(b/11),10)+1)*(b>99);b=b-c*11;a=a+2*c;u=min(fix(b/10),mod(b,10));r=min(u,fix((9-a)/2*(a<9)));a=a+2*r;b=b-11*r;if(a>18||b<0||a+2*(u-r)>9&a==8)return;end,u=(a>9);r=mod(a,10-u);[fix(b/10),max(u*9,r);min(u*9,r),mod(b,10)] ``` * this is a straight-forward method without even calculating the lowest weight of a square, i will add an explanation once i online-fork it. This is how it goes, as known that a square value `ab+cd+ac+bd` can be simplified algebrically as `11(b+c)+2*[ad]_dec` where [ad] is `a*10+d` , with weights assigned by ops respectively as `(W_a,W_d)=(1,4)` and `(W_b,W_c)=(2,3)` . Thus, assuming an initial value of [ad] set as maximal number written in two digits, any number subtracted from it must be a multiple of 11 to be added to (b+c), otherwise that would screw the general form that the square value must be written as. Since [ad] is two digits number, the multiple of 11 subtracted from [ad] must hold same amount from both a and d, which means weights are decreased equally but not added to `(b+c)` equally because it is required to attribute the maximal number to the lowest upweighting number which is `b`. so b will receive an even number. See the picture below it is definitely clearer than my awkward wording: [![enter image description here](https://i.stack.imgur.com/iyg9Y.gif)](https://i.stack.imgur.com/iyg9Y.gif) See that a (ported) value is not addded gradually, but there is a mathematical condition for it , it is `S=minimum_positive(9-(b+c),a,d)` For the rest of conditions, function doesnt output nothing when: * `b+c` exceeds 18 * the square value is below 11 and odd * after adding the farce to (b+c), min(a,d) remains bigger than 1, and b+c = 8, this means there is a potential square value of weight 3+2 , which equals the weight 1+4 , two equivalent values is an exclusive option, and disqualifies the outputs (tbh i dont see any point behind this rule) [Answer] # C (ANSI), 210 bytes ``` #define a (l/1000)+2*((l/100)%10)+3*((l%100)/10)+4*(l%10) main(g,o,l,f){g--;o=91;for(f=l=-1;l<10000;g==++l%100+l/100+(l%10)+((l/100)%10*10)+((l/1000)*10)+(l/ 10%10)?a==o?f=-1:a<o?f=l,o=a:1:1);printf("%04i",f);} ``` Pretty much makes all possible squares and finds the lowest. Input is read in as number of arguments. Output is the square as a 4 digit number. ### Ex: 8 ``` ./numberSquare 1 1 1 1 1 1 1 1 0004 ``` ### Expanded Version: ``` calcScore(l){ return (l/1000)+2*((l/100)%10)+3*((l%100)/10)+4*(l%10); } main(g,o,l,f){ g-=2; o=91; for(f=l=-1;l<10000;l++){ if(g==l%100+l/100+(l%10)+((l/100)%10*10)+((l/1000)*10)+(l/10%10)) if(calcScore(l)==o)f=-1; else if(calcScore(l)<o)f=l,o=calcScore(l); } printf("%04i",f); } ``` [Answer] ## Haskell, 133 bytes ``` a#b=10*a+b g n|l<-[(a+2*b+3*c+4*d,m)|m@[a,b,c,d]<-mapM id$[0..9]<$"aaaa",a#b+a#c+b#d+c#d==n]=[b|q@(a,b)<-l,all(\k@(j,_)->j>a||k==q)l] ``` Output is a four element list `[a,b,c,d]`. Usage example: `map g [129..139]` -> `[[[1,9,0,5]],[],[[6,1,0,0]],[],[[5,3,0,0]],[],[[4,5,0,0]],[],[[3,7,0,0]],[],[[2,9,0,0]]]`. How it works: ``` l<-[ ] -- let l be the list of all (a+2*b+3*c+4*d,m)| -- pairs (score, matrix), where m@[a,b,c,d]<- -- matrix m (= [a,b,c,d]) is drawn from mapM id$[0..9]<$"aaaa", -- all permutations of the digits of length 4 and a#b+a#c+b#d+c#d==n -- the matrix sum equals n =[b| ] -- return a list of all matrices b, where q@(a,b)<-l -- the pair q = (a,b) is drawn from l and all(\k@(j,_)->j>a||k==q)l] -- a is minimal and unique ``` ]
[Question] [ Quinary is like binary, except that 1 is represented by the text of the program, and 0 is represented as the backwards text of the program. The Fibonacci Sequence is the well known sequence F(0) = 0, F(1) = 1, F(n) = F(n - 1) + F(n - 2) Write a program that takes some input n and outputs the nth fibonacci number in quinary. Standard code golf rules apply. [Answer] # CJam, 30 bytes ``` {s"_~"+UXri{_@+}*;2bWfe|\f%}_~ ``` [Try it online!](http://cjam.tryitonline.net/#code=e3MiX34iK1VYcml7X0ArfSo7MmJXZmV8XGYlfV9-&input=Mw) ### How it works ``` { }_~ Define a code block, and push and execute a copy. s Convert the original code block to a string. "_~"+ Append "_~" to the string. UXri Push 0, 1 and an integer N from STDIN. { }* Do N times: _ Push a copy of the topmost integer. @ Rotate the bottom-most integer on top of it. + Push the sum of the copy and the rotated integer. ; Discard the topmost stack item, i.e., F(N+1). 2b Convert the remaining stack item to base 2. Wfe| Logical OR all binary digits with -1. This turns 0's into -1's. \f% For each binary digits A, take each Ath item of the generated string. This pushes the string itself for A = 1, and the reversed string for A = -1. ``` [Answer] # Python, 226 bytes ``` s='s=%r;a,b=0,1;exec"a,b=b,a+b;"*input();print"".join(map(lambda i:(s%%s)*int(i)+(s%%s)[::-1]*(1-int(i)),bin(a)[2:]))';a,b=0,1;exec"a,b=b,a+b;"*input();print"".join(map(lambda i:(s%s)*int(i)+(s%s)[::-1]*(1-int(i)),bin(a)[2:])) ``` It's quite a heavy modification to the standard Python Quine. It uses `a,b=0,1;exec"a,b=b,a+b;"` to generate Fibonacci numbers. [Answer] # 𝔼𝕊𝕄𝕚𝕟, 24 chars / 44 bytes ``` ⟮Мȫïⓑⓢⓜ+$?(a=ɕṡ+ᶈ0):aᴙ)⨝ ``` `[Try it here (Firefox only).](http://molarmanful.github.io/ESMin/interpreter2.html?eval=true&input=5&code=%E2%9F%AE%D0%9C%C8%AB%C3%AF%E2%93%91%E2%93%A2%E2%93%9C%2B%24%3F%28a%3D%C9%95%E1%B9%A1%2B%E1%B6%880%29%3Aa%E1%B4%99%29%E2%A8%9D)` # Explanation Standard quine framework: `⟮ɕṡ+ᶈ0` ``` ⟮Мȫïⓑⓢⓜ+$?(a=ɕṡ+ᶈ0):aᴙ)⨝ // implicit: ï=input ⟮ // copy block start Мȫï // get nth Fibonacci number ⓑⓢⓜ // convert to binary, split along chars, map +$? // is mapitem truthy? (a=ɕṡ+ᶈ0) // if so, replace w/ quine as is :aᴙ) // else replace w/ reverse quine ⨝ // join // implicit output ``` [Answer] # Javascript ES6, 121 bytes ``` $=_=>[...(a=`$=${$};$()`,f=x=>x>1?f(x-1)+f(x-2):x)(prompt()).toString(2)].map(x=>+x?a:[...a].reverse().join``).join``;$() ``` I'm looking for ways to shorten the Fibonacci function... [Answer] # [Python 3.8 (pre-release)](https://docs.python.org/3.8/), 113 bytes ``` exec(s:="f=lambda x:x<2or f(x-1)+f(x-2)\nfor i in f'{f(int(input())):b}':print(('exec(s:=%r)'%s)[::2*int(i)-1])") ``` [Try it online!](https://tio.run/##K6gsycjPM7YoKPr/P7UiNVmj2MpWKc02JzE3KSVRocKqwsYov0ghTaNC11BTG0QZacbkpQGFMhUy8xTS1KvTNDLzSoC4oLREQ1NT0yqpVt2qoAgkpqEOM1C1SFNdtVgz2srKSAusWlPXMFZTSfP/f1MA "Python 3.8 (pre-release) – Try It Online") ]
[Question] [ The goal of this challenge is to complete a list of consecutive nested header numbers when given a start and an end. When given `1.1.1` and `1.1.5` you should generate `1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5` **Specific Rules** 1. Your entry must take in a `start`, `end`, and multiple optional `range` parameters. Parameters can be taken form STDIN (or nearest equivalent) or a file. 2. Your entry may assume valid input 3. Input will be of the following format: 1. `start` and `end` will be strings of `.` delimited integers of the same length 2. `start` and `end` will have three segments; (1) set values, (2) iterator, (3) trailing values. * The iterator is the first value which differs between `start` and `end`. * The set values are the values before the iterator. These values never change * The trailing values are the values after the iterator. These values iterate up as determined by the `range` parameter(s). **All trailing values in `start` and `end` will be `1`**. 3. `range` will be a list of integers or strings (depending on which you prefer) with a length corresponding to the number of trailing values. When there are no trailing values, `range` is not specified. The value of `range` corresponding to each trailing value determines the *inclusive upper bound* which that entry iterates to. 4. Output will be to STDOUT (or closest alternative) and will show each value separated by at least one delimiter. Delimiter can by any character or string of characters, but it must be consistent. Output must be sorted correctly **Examples** ``` start = '1.1.5.1', end = '1.1.6.1', range = [5] Output: 1.1.5.1, 1.1.5.2, 1.1.5.3, 1.1.5.4, 1.1.5.5, 1.1.6.1 ^ previous value is iterated only when iterating value limit set by range start = '1.1.5.1', end = '1.1.7.1', range = [5] Output: 1.1.5.1, 1.1.5.2, 1.1.5.3, 1.1.5.4, 1.1.5.5, 1.1.6.1, 1.1.6.2, 1.1.6.3, 1.1.6.4, 1.1.6.5, 1.1.7.1 start = '1.5.1.1', end = '1.6.1.1', range = [5,2] Output: 1.5.1.1, 1.5.1.2, 1.5.2.1, 1.5.2.2, 1.5.3.1, 1.5.3.2, 1.5.4.1, 1.5.4.2, 1.5.5.1, 1.5.5.2, 1.6.1.1 ``` This is code golf so shortest code by bytes wins. Standard loopholes apply. **Bonuses** 1. Allow trailing values to be values other than `1` in `end` parameter - **12.5% off** 2. Handle incorrect number of values in `range` parameter - **12.5% off** 3. Handle `end` less than `start` by producing list in reverse - **50% off** Bonuses are calculated off of the original byte count; a 100 byte answer which receives all bonuses will have a final score of `100 bytes - 100*(0.125+0.125+0.5) = 25 bytes` [Answer] ## Haskell, ~~201~~ ~~194~~ 188\*0.25 = 47 bytes ``` import Data.Lists l=length p x=read<$>splitOn"."x (s#e)r=intercalate".".map show<$>(fst$span(<=e)$sequence$zipWith enumFromTo s$take(l e-l r)e++r) s!e|s<e=s#e|1<2=reverse.(e#s) (.p).(!).p ``` I'm going for all bonuses. "Normal" use: ``` *Main> ((.p).(!).p) "1.5.1.1" "1.6.1.1" [5,2] ["1.5.1.1","1.5.1.2","1.5.2.1","1.5.2.2","1.5.3.1","1.5.3.2","1.5.4.1", "1.5.4.2","1.5.5.1","1.5.5.2","1.6.1.1"] ``` Bonus 1: ``` *Main> ((.p).(!).p) "1.5.1.1" "1.6.4.1" [5,2] ["1.5.1.1","1.5.1.2","1.5.2.1","1.5.2.2","1.5.3.1","1.5.3.2","1.5.4.1", "1.5.4.2","1.5.5.1","1.5.5.2","1.6.1.1","1.6.1.2","1.6.2.1","1.6.2.2", "1.6.3.1","1.6.3.2","1.6.4.1"] ``` Bonus 2: ``` *Main> ((.p).(!).p) "1.5.1.1" "1.6.1.1" [3] ["1.5.1.1","1.5.1.2","1.5.1.3","1.6.1.1"] ``` Bonus 3: ``` *Main> ((.p).(!).p) "1.6.1.1" "1.5.1.1" [5,2] ["1.6.1.1","1.5.5.2","1.5.5.1","1.5.4.2","1.5.4.1","1.5.3.2","1.5.3.1", "1.5.2.2","1.5.2.1","1.5.1.2","1.5.1.1"] ``` How it works: Split `start` and `end` into lists of numbers, e.g. `"1.5.1.1"` -> `[1,5,1,1]`. Prepend elements from `end` to `range` so that the resulting list has the same length as `end`, e.g. `[5,2]` and `"1.6.1.1"` -> `[1,6,5,2]`. Zip this list and `start` with the list building function `enumFromTo`, e.g. `[1,5,1,1]` and `[1,6,5,2]`-> `[[1],[5,6],[1,2,3,4,5],[1,2]]`. `sequence` builds all combinations thereof, where numbers at position i are drawn from sublist i, -> `[[1,5,1,1],[1,5,1,2],[1,5,2,1],[1,5,2,2],...]`. Re-insert the dots and take elements as long as the they are less or equal than `end`. [Answer] # PowerShell, 214 bytes, no bonuses :( ``` param($s,$e,$r) $f={param($v,$w)if($w){$w[0]|%{&$f "$v.$_" $w[1..$w.Count]}}else{$v;if($v-eq$e){break}}} $x,$y=($s-split'\.'|diff $e.split('.')).inputobject $q=,($x..$y) $r|%{$q+=,(1..$_)} &$f ($s-split".$x")[0] $q ``` e.g. ``` PS C:\Scripts> .\nestedh.ps1 '1.5.1.1' '1.6.1.1' @(5,2) 1.5.1.1 1.5.1.2 1.5.2.1 1.5.2.2 1.5.3.1 1.5.3.2 1.5.4.1 1.5.4.2 1.5.5.1 1.5.5.2 1.6.1.1 ``` It: * Uses `-split '\.'` feeding to `diff/Compare-Object` to find the two differing numbers, (this approach blocks the bonus where the tail values can change, because it changes the diff output). * Builds an array of the ranges it will need for each header position, taking from the range parameters.This leaves something like `"$q=[[5,6], [1,2,3,4,5], [1,2]]"` * Those get fed into the recursive function `$f` which takes the set values prefix and a list of sublists, adds the prefix to each number, and calls itself with that as the new prefix, and the remaining sublists * quits when it hits the `$end` string ]
[Question] [ **Challenge** Write a program that toggles another. Your program should accept exactly two command arguments. Specifically, your two tasks are: 1. If the names of any running processes are identical to argument one, close them and exit 2. If the names of zero running processes are named identical to argument one, spawn one with that name, pass it the second command arg, and exit The life of the spawned process must be completely independent of your own (think Daemon threads in Java, or Background threads in C#). You are responsible for closing programs that you didn't necessarily start in a past life. **Example** Here are two separate examples of how your program might be called. ``` python YourToggler.py Notepad.exe C:\MyTextFile.txt java MyToggler.java cmd "echo hello world" ``` In the first example, if `Notepad.exe` is currently running, you should close all processes named `Notepad.exe`. Otherwise, you should start one with the argument `C:\MyTextFile.txt`. **Assumptions** You can sleep better knowing the following: * The name passed to you will be a valid program * You are not responsible for name discrepancies + If you are asked to find Notepad, you are not responsible for closing Notepad.exe * You will be run with the privileges you need to carry out your duty [Answer] # Bash+common Linux utilities, 12 or 16 bytes ``` pkill "$1"||"$@" ``` If we can assume no whitespace in the program name and arg, then we can drop the quotes for a score of 12: ``` pkill $1||$@ ``` [Answer] # Bash (+ pgrep & xargs) - 83 chars ``` p="$(pgrep -x "$1")";if [ $? = 0 ];then echo "$p"|xargs -n 1 kill;else "$1" "$2";fi ``` [Answer] ## AutoIt v3 - 102 chars (97 chars) ``` $a=$CmdLine If ProcessExists($a[1]) Then ProcessClose($a[1]) Else ShellExecute($a[1],$a[2]) EndIf ``` Tried my best to golf it down but there is no shorter function for `ProcessExists()`, `ProcessClose()` and `ShellExecute()`. Good thing is, that it is working on Windows unlike the Bash answers. FYI: Using `Run()` instead of `ShellExecute()` requires the full path because it does not take into account executables in your PATH. --- If we assume that the path is given absolutely like `toggle.exe C:\Windows\System32\Notepad.exe C:\MyTestFile.txt` Then that code can be golfed down to 97 chars: ``` $a=$CmdLine If ProcessExists($a[1]) Then ProcessClose($a[1]) Else Run($a[1]&" "&$a[2]) EndIf ``` Note: You have to pass a string to the `Run()`-function like you would type into your Command Prompt but it does not work like it. As written before it is like the Command Prompt without Environment variables. ]
[Question] [ Your job is to encrypt a string using a number key. Your program will receive 2 strings: one containing a sequence of characters to encrypt, and another one containing an even amount of digits (`1`-`9`, never `0`). The encrypting will work like this: 1. take the string to be encrypt and decode it to binary (ISO-8859-1) 2. for every pair of numbers `x` and `y` in the number string do: for every character in the string of zeroes and ones, starting from the first one, if the bit is `0` toggle the `x`th bit in front of the bit you are reading right now. If the bit is `1`, toggle the `y`th bit in front of the bit you are reading right now. If the bit to be toggled is out of bounds, do not toggle anything. Other than that: This is a code golf challenge, shortest code wins. Standard Loopholes apply. Here's a more graphic explanation of what happens: ``` inputs: "a", "23" "a" =BIN> "01100001" "01100001" //first bit is a 0, get the first number in the key, 2. - ^ //toggle the bit 2 steps in front "01000001" //next bit is 1, get second number in the key, 3. - ^ //toggle the bit 3 steps in front "01001001" //0 bit, toggle the bit that is 2 steps in front. - ^ "01000001" //etc - ^ "01000101" - ^ "01000111" - ^ //no change, out of bounds. "01000111" - ^ "01000111" - ^ "01000111" =ASCII> "G" ``` So: `a`, `23` = `G`. ~~Then, running `G`, `23` should be `a` because this process is perfectly reversible.~~ To decrypt a string encrypted using key `12438135`, reverse the ordering of the pairs, `35814312` and run the encrypted string through a similar program that performs the operations in reverse order (starting at the end, approaching the beginning) using that key. (thanks to Martin Büttner for pointing that out) Good luck and have fun! (My first challenge, tell me if i missed anything :)) [Answer] ## Ruby, ~~230~~ ~~191~~ ~~181~~ ~~178~~ ~~175~~ ~~173~~ ~~171~~ 159 bytes ``` i,n=$* s=i.gsub(/./){|c|"%08b"%c.ord} n.scan(/(.)(.)/){s.size.times{|i|s[j=i+(s[i]==?0?$1:$2).to_i]&&s[j]=s[j]==?0??1:?0}} $><<s.gsub(/.{8}/){|c|c.to_i(2).chr} ``` It's just a very naive implementation of the spec. Input via command-line arguments, output to STDOUT. ``` # Read ARGV into i and n i,n = $* # Turn each character into a string of eight 0s and 1s using a format string. s = i.gsub(/./){|c|"%08b"%c.ord} # For each pair of characters in n n.scan(/(.)(.)/){ # For each index into s s.size.times{|i| # Determine the index that is to be toggled. $1 and $2 refer to the captures # of /(.)(.)/. j=i+(s[i]==?0?$1:$2).to_i # Using short-circuiting, toggle s[j] if it isn't nil. s[j]&&s[j]=s[j]==?0??1:?0 } } # Convert each group of 8 characters back to a single character and print $><<s.gsub(/.{8}/){|c|c.to_i(2).chr} ``` [Answer] # CJam, 53 bytes ``` SSl++256b2bl2/{Em<_,E-{_0=P=~_2$=!t1m<}*}fPE>2b256b:c ``` Reads two lines of input: the string, followed by the key. [Try it online.](http://cjam.aditsu.net/ "CJam interpreter") For decryption, this code can be used: ``` SSl++256b2bl2/W%{1m>_,E-{_0=P=~_2$=!t1m>}*Dm>}fPE>2b256b:c ``` ### Example run ``` $ LANG=en_US cjam enc.cjam # First two lines are input. codegolf 345678 q¼M³)6¯J ``` ### How it works CJam's built-in base conversion discards leading zeros, so we start by prepending two spaces to the input string. Since a space character is `[0 0 1 0 0 0 0 0]`, this prepends 14 zeros to the bit encoding for the input string. After each transformation, we rotate the array to the left to avoid adding indexes, skipping the extra 14 bytes from the spaces. This way, toggling bits "out of bounds" affects only those 14 bits, which are discarded after the last toggle. ``` SSl++ " Read one line of input (plaintext) and prepend two spaces. "; 256b2b " String ↦ byte array ↦ bit array. "; l2/ " Read one line of input (key) and split it in chunks of length 2. "; { " For each digit pair P: "; Em< " Rotate the array 14 places to the left. "; _,E- " Push the arrays length minus 14. "; { " Do the following that many times: "; _0=P=~ " Push the digit of P that corresponds to the first bit of the array. "; _2$= " Retrieve the corresponding bit from the array. "; !t " Compute its logical NOT and modify the array at the given position. "; 1m< " Rotate the array one place to the left. "; }* " "; }fP " "; E> " Discard the first 14 bits of the array. "; 2b256b:c " Bit array ↦ byte array ↦ string. "; ``` [Answer] # GolfScript, 45 ``` ~2/{\{8{(..2\?3$&!!4$=48-- 2\?@\^\.}do;}%\;}/ ``` This takes arguments from stdin in the form of two strings (e.g. "a""23") and outputs to stdout. [Test it online here](http://golfscript.apphb.com/?c=OyciYSIiMjMiJ34yL3tcezh7KC4uMlw%2FMyQmISE0JD00OC0tIDJcP0BcXlwufWRvO30lXDt9Lw%3D%3D) [Answer] # JavaScript 243 ``` function E(s,k,d){for (var o="",a=0,b=0;a<s.length;a++,b%=k.length){ var j,i=8,z,n=s.charCodeAt(a),x=parseInt(k.charAt(b++)),y=parseInt(k.charAt(b++)) for (;i--;)j=d?7-i:i,z=j-(n&(1<<j)?y:x),n=z>0?n^=1<<z:n o+=String.fromCharCode(n) }return o} ``` Example: ``` var s0 = "codegolf"; var k = "5556"; var s1 = E(s0,k); var s2 = E(s1,k,true); console.log(s0+"\n"+s1+"\n"+s2) ``` Output: ``` codegolf ekbaakjb codegolf ``` ]
[Question] [ **This question already has answers here**: [Fibonacci distribution validator](/questions/18887/fibonacci-distribution-validator) (13 answers) Closed 10 years ago. * There's a [question](https://codegolf.stackexchange.com/questions/18812/hello-world-fibonacci-distribution) with a comment with some code thats far too long. * For a site that has counting fetish, this code just seems so wrong. * Solve this meta-riddle, and explain it with a rhyme. * Winner is the shortest code in a fortnights time. The challenge: 1. Open a file as input. 2. Count and output the number of digits `(0,1,...9)` and non-digits (everything else). 3. If the number of digits and non-digits are consecutive fibonnacci numbers, with the number of digits is fibonnacci number `f(n)` and the number of non-digits is `f(n-1)` the file is "valid", otherwise it is "Invalid" 4. Output this information as exactly as shown below. Example 1: ``` Digits: 34 Nondigits: 21 Valid program ``` Example 2: ``` Digits: 33 Nondigits: 21 Invalid program ``` [Answer] ## Ruby, 151 ``` d=[0,0];$<.read.chars{|c|d[c>?/&&c<?:?0:1]+=1};puts"Digits: %d Nondigits: %d"%d a=b=1;while b<d[0];b=a+a=b end;print ([b,a]==d)??V:"Inv","alid program" ``` [Answer] # Java - 334 ``` import java.nio.*;public class a{public static void main(String[]i)throws Exception{String s=new String(Files.readAllBytes(Paths.get(i[0])));int l=s.replaceAll("\\d","").length(),L=s.length()-l,a=1,b=2,c,d=0;while(a<L){if(a==l&&b==L)d=1;c=b;b+=a;a=c;}System.out.printf("Digits: %s Nondigits: %s\n%salid Program",L,l,d==0?"Inv":"V");}} ``` Ungolfed: ``` import java.nio.file.*; public class Testing { public static void main(String[] i) throws Exception { String s = new String(Files.readAllBytes(Paths.get(i[0]))); int l = s.replaceAll("\\d", "").length(), L = s.length() - l, a = 1, b = 2, c, d = 0; while (a < L) { if (a == l && b == L) { d = 1; } c = b; b += a; a = c; } System.out.printf("Digits: %s Nondigits: %s\n%salid Program", L, l, d == 0 ? "Inv" : "V"); } } ``` Explanation: > > Reads the input from the file > > > supplied by command line > > > Puts the contents in a String > > > oh no! I'm thinking of quines. > > > Regex swaps digits of that thing > > > for the one and only empty String. > > > Then by `String#length()` I find > > > the charcount nondigit, yes that kind. > > > From the length of the first String > > > I subtract the charcount nondigit thing > > > to find the char digits count. > > > Next I sweep it all under the rug > > > so I can say "Help I'm a bug!". > > > Then I retrieve it - please have patience. > > > Now the first terms of the Fibonacci sequence > > > used to find the rest of the numbers. > > > What to rhyme with? I'll just use "others". > > > And when small num is greater than non-digits > > > I know if it's true, so wait a minute. > > > Uses `printf` to format output. > > > `"alid Program"` at the start puts > > > `"Inv"` or `"V"` according to the answer > > > Before is the counts, not one thing fancier > > > Thank you for lis'ning to this tale > > > Of the program that validates according to your rules > > > --- Whew, it was hard to write that. I decided to assume the input is from the command line, in the form of a String. Please correct me, because if I can simply take a `File` as input, I can shorten this by a few chars. Also, I'd like to know if a method is okay. [Answer] ## Bash, 244 ``` f=`cat $1`&&d=`sed 's/[0-9]*//g' $1`&&echo Digits: ${#d} Nondigits: $[${#f}-${#d}]] a=1&&b=1&&while [ $b -lt ${#d} ];do z=$b&&b=$[a+b]&&a=$z;done&&if [ $b -eq ${#d} -a $a -eq $[${#f}-${#d}] ];then echo Valid program;else echo Invalid program;fi ``` call using `./script filename`. I'm not particularly good with bash and I'm sure there are a few ways to get this smaller. ]
[Question] [ The challenge is to write code in any open source, available on linux, language of your choice to perform modular exponentiation. The input will be two randomly chosen 2048 bit positive integers numbers x and y and a 2048 bit prime z. Here is a sample snippet of python to compare to. ``` def pow_mod(x, y, z): n = 1 while y: if y & 1: n = n * x % z y >>= 1 x = x * x % z return n ``` The code should accept a file with each of the three numbers on separate lines and output the result to standard out. You may not use any libraries for modular exponentiation of course. The code that runs the fastest on average over 100 runs on my computer wins. For those who want really accurate timing, the best way may be for the timing code to actually be in the code you provide and for your code to simply repeat 100 times (without cheating :) ). This avoids any problems with start up overheads. [Answer] ## Haskell Though it's simple, it should be pretty fast if built with [GHC](http://www.haskell.org/ghc/distribution_packages): ``` {-# OPTIONS_GHC -O2 #-} {-# LANGUAGE BangPatterns #-} module Main where import Data.Bits seqI :: Integer -> Integer seqI x = seq x x seqB :: Bool -> Bool seqB x = seq x x getInteger :: IO Integer getInteger = fmap (seqI . read) getLine modExp' :: Integer -> Integer -> Integer -> Integer -> Integer modExp' r b p m = let nextR = seqI $ mod (seqI $ r*b) m nextB = seqI $ mod (seqI $ b*b) m nextP = seqI $ shiftR p 1 incl = seqB $ testBit p 0 cont = seqB $ nextP /= 0 in if incl then if cont then modExp' nextR nextB nextP m else nextR else if cont then modExp' r nextB nextP m else r modExp :: Integer -> Integer -> Integer -> Integer {-# INLINE modExp #-} modExp !b !p !m = modExp' 1 b p m main = do b <- getInteger p <- getInteger m <- getInteger print $ modExp b p m ``` ### Prime modulus optimization If the modulus is guaranteed to be a prime, but the exponent might be greater than or equal to the modulus, the last line should be changed to: ``` print $ modExp b (mod p (m - 1)) m ``` ### Handling multiple inputs If you'd like it to handle multiple inputs per run, add `import System.IO` under the other `import` and the following two lines just under the `print` line: ``` isDone <- isEOF if isDone then return () else main ``` ### Running Once it's compiled, it can be run as `modexp < file`. [Answer] ## C++/asm Runs in about 7ms on my laptop. Less than a factor of 2 away from [GMP](http://gmplib.org/), which is heavily optimized for this task. Uses [Montgomery reduction](http://en.wikipedia.org/wiki/Montgomery_reduction) to compute the modular reductions quickly. Uses a python script to generate x86 assembly to do the 2048 bit ops (multiply, add, etc.) in great swathes of straightline code. The code is about 270 lines, a bit big to paste in an answer box. Download it [here](http://keithandkatie.com/modexp.zip). ]
[Question] [ Warning: this is a complex challenge. ## Overview A lightbox, in the context of computing, is a visual effect used in image sites. A list of thumbnail images is displayed; each image can be selected and will be displayed on top of the contents of the page either at full size or to fill the screen. The task is to generate a (fairly) self-contained web page which will display specified images in a lightbox. ## Input The input will be from stdin and will specify (one item per line): * The number of images (`n`) * A pattern for transforming an image name into its thumbnail (substitution described in detail further down) * A list of `n` images, each consisting of a URL for the full-sized image and a one-line description. You may assume that each URL ends with an extension (e.g. `.jpg`), although you cannot assume any extension in particular. Sample input: ``` 4 *_thumb.jpg DSCF0001.jpg My family DSCF0002.jpg Other animals crop/DSCF0017.jpg Aren't they cute? http://www.example.com/fx.jpg The bestest picture on the whole Internet!!! ``` Note: when the URLs are relative (the first three in this example), you may assume that they are relative to the current working directory. This is probably only relevant if you want to load them in your program to find their sizes. Substitution into the thumbnail pattern works by removing the file extension from the base URL and replacing the `*` in the pattern. So for the four images in the example above, you would get ``` DSCF0001_thumb.jpg DSCF0002_thumb.jpg crop/DSCF0017_thumb.jpg http://www.example.com/fx_thumb.jpg ``` If the pattern were `thumbs/*.jpg` you would get ``` thumbs/DSCF0001.jpg thumbs/DSCF0002.jpg thumbs/crop/DSCF0017.jpg thumbs/http://www.example.com/fx.jpg ``` The fact that the last one there is clearly nonsense would be a bug in the input rather than in your program. ## Output The output must include some HTML, and may additionally include some other files (e.g. separate JavaScript, CSS, or images). You may emit the main HTML to stdout or to a file named `index.html`. Please state which you choose to do. The HTML must include a doctype and be valid for that doctype (I suggest using HTML5!). When it loads, it must display the thumbnails, which must have some separation (margin or padding) between them, and should not be one per line. Each thumbnail must either have a `title` attribute or be in an element with a `title` attribute which displays the corresponding image description. It must also have an `alt` attribute which is the same description. Clicking on a thumbnail must open the lightbox. This consists of a translucent black overlay covering the entire screen, on top of which the following are displayed in a white rectangle with a padding of at least `8px`: * The full image (scaled as required - see below) * The image description * Buttons or links to go forward and back, and to close the lightbox It is up to you whether you overlay the description and buttons over the image or put them in the margin around it. If everything fits within the browser's viewport with the image at full size, it should be displayed at full size. Otherwise it should be scaled down, preserving aspect ratio, so that everything fits. The forward and back (or next and previous - your choice) buttons must load the corresponding images. It is your choice as to whether they loop or stop at the ends. There should be a simple but smooth transition between the images - if the (scaled) images are different sizes, then it shouldn't jump, and you should use some kind of fade or sweep. The following features of many lightboxes are not required: * Closing if the user clicks on the translucent black overlay * Resizing everything correctly if the browser window is resized ## Permitted external resources Use of external resources is restricted to using at most one of the following JavaScript libraries: * jQuery * Prototype * mootools You may assume that it is in the same directory as the output html, but if you do so you should document the name which you expect it to have and the version which you require. ## Compatibility Compatibility with IE is nice, but this is a code golf, and apart from that it's not something which is easily tested without a Windows machine, so it is not a requirement. Please state which browser(s) you have tested with in your answer. I will test with Chromium, and I also have Firefox 3.6 and Konqueror available at home (plus various versions of IE, Win Safari and Opera in my lunchtimes at work, so if you want me to test on one of those, say so). --- Note: this question has been sitting in the [Sandbox](http://meta.codegolf.stackexchange.com/questions/530/proposed-questions-sandbox-mk-iv/540#540) for two weeks, so if you think there's a problem with the specification, please make it a habit to comment on questions over there. [Answer] ## PHP, HTML, CSS and jQuery, 1551 1482 1511 characters ``` <?while($x=fgets(STDIN))$i[]=chop($x)?><!doctype html><title></title><style>.t{float:left;margin:10px;height:50px}#o,#p,p,b,i,q{position:fixed;top:0}#o{background:rgba(0,0,0,0.8);width:100%;height:100%;display:none;left:0}#p{display:none;z-index:1;border:10px solid #fff;top:50%;left:50%}p{padding:5px;background:rgba(50,50,50,0.7);color:#ccc;z-index:2;top:50%;left:50%}b,i,q{padding:10px;color:#f00;background:#ccc;z-index:2}b{right:0;font-weight:900}i{top:50%;left:0}q{top:50%;right:0}</style><script src=a></script><script>$(function(){$('img').click(function(){a=$(this);$('body').append('<b>X</b><i>&lt;</i><q>&gt;</q><div id=o>');z($(this).attr('data-l'),$(this).attr('alt'))});$('body').on('click','b',function(){$('b,i,q,p,#o,#p').fadeOut(function(){$(this).remove();})}).on('click','q,i',function(){f=$(this).is('q')?a.next('img'):a.prev();$('#p,p').fadeOut(function(){$(this).remove();a=f.size()==0?a:f;z(a.attr('data-l'),a.attr('alt'))})})});function z(l,m){if($('#p').size()<1){$('body').append('<img id=p src='+l+'><p>'+m);i=new Image();i.onload=function(){w=i.width;h=i.height;$('#p').css({maxWidth:$('body').innerWidth()-20,maxHeight:$('body').innerHeight()-20,marginLeft:0-w/2,marginTop:0-h/2});$('p').css({marginLeft:0-$('p').width()/2,marginTop:w/2-30});$('#o,#p').fadeIn()};i.src=l}}</script><?for(;$l<$i[0]*2;$l+=2){$a=str_replace('"','&quot;',$i[2+$l]);$b=$i[3+$l];echo'<img class=t src='.str_replace("*",substr($a,0,strrpos($a,".")),$i[1]).' title="'.$b.'" alt="'.$b.'" data-l='.$a.'>';}?> ``` I've assumed that the jQuery library is available in the same directory as this file, and that it is named `a`. The HTML takes advantage of the fact that a lot of the tags are optional but at it's base it is only: ``` <!doctype html> <title></title> <img alt=title src=http://placehold.it/60 data-l=http://placehold.it/180> ...more images here... ``` which is considered valid by the w3c validator. The CSS still contains some repeated styles which probably offers some room for further compression. I've created a [jsFiddle](http://jsfiddle.net/gw77G/4/) which demonstrates the lightbox functionality for those who wish to try it. One time when I ran it there was a glitch with the images when they were first loaded - please let me know if it's a regular thing so I can have a look into it. I've only tested it in Chrome on Mac OSX (using the above jsFiddle), and on Chrome on Windows XP using the php to generate the page (`php -q lb.php > lb.html`) with the following input: ``` 4 http://lorempixel.com/60/60 http://lorempixel.com/250/250 My family http://lorempixel.com/300/300 Other animals http://lorempixel.com/350/350 Aren't they cute? http://lorempixel.com/400/400 The bestest picture on the whole internet!!! ``` which generates the following page source: ``` <!doctype html><title></title><style>.t{float:left;margin:10px;height:50px}#o,#p,p,b,i,q{position:fixed;top:0}#o{background:rgba(0,0,0,0.8);width:100%;height:100%;display:none;left:0}#p{display:none;z-index:1;border:10px solid #fff;top:50%;left:50%}p{padding:5px;background:rgba(50,50,50,0.7);color:#ccc;z-index:2;top:50%;left:50%}b,i,q{padding:10px;color:#f00;background:#ccc;z-index:2}b{right:0;font-weight:900}i{top:50%;left:0}q{top:50%;right:0}</style><script src=http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js></script><script>$(function(){$('img').click(function(){a=$(this);$('body').append('<b>X</b><i>&lt;</i><q>&gt;</q><div id=o>');z($(this).attr('data-l'),$(this).attr('alt'))});$('body').on('click','b',function(){$('b,i,q,p,#o,#p').fadeOut(function(){$(this).remove();})}).on('click','q,i',function(){f=$(this).is('q')?a.next('img'):a.prev();$('#p,p').fadeOut(function(){$(this).remove();a=f.size()==0?a:f;z(a.attr('data-l'),a.attr('alt'))})})});function z(l,m){if($('#p').size()<1){$('body').append('<img id=p src='+l+'><p>'+m);i=new Image();i.onload=function(){w=i.width;h=i.height;$('#p').css({maxWidth:$('body').innerWidth()-20,maxHeight:$('body').innerHeight()-20,marginLeft:0-w/2,marginTop:0-h/2});$('p').css({marginLeft:0-$('p').width()/2,marginTop:w/2-30});$('#o,#p').fadeIn()};i.src=l}}</script><img class=t src=http://lorempixel.com/60/60 title="My family" alt="My family" data-l=http://lorempixel.com/250/250><img class=t src=http://lorempixel.com/60/60 title="Other animals" alt="Other animals" data-l=http://lorempixel.com/300/300><img class=t src=http://lorempixel.com/60/60 title="Aren't they cute?" alt="Aren't they cute?" data-l=http://lorempixel.com/350/350><img class=t src=http://lorempixel.com/60/60 title="The bestest picture on the whole internet!!!" alt="The bestest picture on the whole internet!!!" data-l=http://lorempixel.com/400/400> ``` I've fixed a few issues that weren't apparent in the jsFiddle testing - the only real issue I'm aware of now is that in Chrome the `>` button gets quotes put around it because I'm using the `q` tag. Not sure if the default styles in Firefox, Opera and IE do the same. I think I've met all the requirements - again let me know if I've missed anything. **Edit:** I've removed all the `ul` and `li` stuff because it wasn't necessary, saving about 70 characters. Here's the code (of the previous version with `ul` and `li`s) with some line-breaks and indentation to aid readability, and a Google CDN jQuery link: ``` <?while($x=fgets(STDIN))$i[]=chop($x)?> <!doctype html> <title></title> <style> ul{list-style-type:none} li{float:left;margin:10px;padding:0} li img{height:50px} #o,#p,p,b,i,q{position:fixed;top:0} #o{background:rgba(0,0,0,0.8);width:100%;height:100%;display:none;left:0} #p{display:none;z-index:1;border:10px solid #fff;top:50%;left:50%} p{padding:5px;background:rgba(50,50,50,0.7);color:#ccc;z-index:2;top:50%;left:50%} b,i,q{padding:10px;color:#f00;background:#ccc;z-index:2} b{right:0;font-weight:900} i{top:50%;left:0} q{top:50%;right:0} </style> <script src=http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js></script> <script> $(function() { $('img').click(function() { a=$(this).parent(); $('body').append('<b>X</b><i>&lt;</i><q>&gt;</q><div id=o>'); z($(this).attr('data-l'),$(this).attr('alt')) }); $('body').on('click','b',function() { $('b,i,q,p,#o,#p').fadeOut(function(){$(this).remove();}) }).on('click','q,i',function() { f=$(this).is('q')?a.next():a.prev(); $('#p,p').fadeOut(function() { $(this).remove(); a=f.size()==0?a:f; b=a.find('img'); z(b.attr('data-l'),b.attr('alt')) }) }) }) function z(l,m) { if($('#p').size()<1) { $('body').append('<img id=p src='+l+'><p>'+m); i=new Image(); i.onload=function() { w=i.width; h=i.height; $('#p').css({maxWidth:$('body').innerWidth()-20,maxHeight:$('body').innerHeight()-20,marginLeft:0-w/2,marginTop:0-h/2}); $('p').css({marginLeft:0-$('p').width()/2,marginTop:w/2-30}); $('#o,#p').fadeIn(); } i.src=l; } } </script> <ul> <?for(;$l<$i[0]*2;$l+=2) { $a=$i[2+$l]; $b=$i[3+$l]; echo"<li><img src=".str_replace("*",substr($a,0,strrpos($a,".")),$i[1])." title='".$b."' alt='".$b."' data-l=".$a.">"; }?> </ul> ``` ]
[Question] [ Your mission is to create a function for transposing music chords. Copied from SO with permission of the original asker, I just really wanted to see what you guys could do with this one: Since I don't expect everyone to be a musician here, I'll try to explain how it works in music theory. I hope I don't forget something. If yes, musicians, please, correct me. 1) The simple chords The simple chords are almost as simple as an alphabet and it goes like this: > > C, C#, D, D#, E, F, F#, G, G#, A, A# B > > > From B it loops all over again to C. Therefore, If the original chord is `E` and we want to transpose +1, the resulting chord is `F`. If we transpose +4, the resulting chord is `G#`. 2) Expanded chords They work almost like the simple chords, but contain a few more characters, which can safely be ignored when transposing. For example: > > Cmi, C#7, Dsus7, Emi, Fsus4, F#mi, G ... > > > So again, as with the simple chords, if we transpose `Dsus7` + 3 = `Fsus7` 3) Non-root bass tone A problem arises when the bass plays a different tone than the chord root tone. This is marked by a slash after the chord and also needs to be transposed. Examples: > > C/G, Dmi/A, F#sus7/A# > > > As with examples 1 and 2, everything is the same, but the part after the slash needs transpose too, therefore: `C/G` + 5 = `F/C` `F#sus7/A#` + 1 = `Gsus7/B` I think this should be all, unless I forgot something. So basically, imagine you have a javascript variable called `chord` and the transpose value `transpose`. What code would transpose the chord? Example: ``` var chord = 'F#sus7/C#'; var transpose = 3; // remember this value also may be negative, like "-4" ... code here ... var result; // expected result = 'Asus7/E'; ``` original question here: <https://stackoverflow.com/questions/7936843/how-do-i-transpose-music-chords-using-javascript> (note that he's asking for JS, for this challenge I don't care what language its in) [Answer] # Haskell, 146 ``` c=zip(words"C C# D D# E F F# G G# A A# B")[0..] x#n=maybe x(\i->fst$c!!mod(i+n)12)$lookup x c (x:'#':y)%n=(x:"#")#n++y%n (x:y)%n=[x]#n++y%n x%_=x ``` This defines an operator `%` that transposes a chord by a given amount, so you'd use it like this: ``` *Main> "E"%1 "F" *Main> "E"%4 "G#" *Main> "Dsus7"%3 "Fsus7" *Main> "C/G"%5 "F/C" *Main> "F#sus7/A#"%1 "Gsus7/B" ``` [Answer] OK, within the limitations of the question as asked and not catering for a lot of things you'd need to allow for if using with real music (flats being the most obvious): ``` function t(c,a) { var s=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],i; return c.replace(/[A-G]#?/g,function(m){return s[(i=(s.indexOf(m)+a)%s.length)<0?i+s.length:i];}); } ``` This is my first attempt at code-golf, so I hope I've taken the right approach. Following is the readable version that I originally posted at stackoverflow.com: ``` function transposeChord(chord, amount) { var scale = ["C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"]; return chord.replace(/[CDEFGAB]#?/g, function(match) { var i = (scale.indexOf(match) + amount) % scale.length; return scale[ i < 0 ? i + scale.length : i ]; }); } ``` [Answer] As a preliminary effort, I'd like to flesh-out some of what "the full solution" should take into account. **Sharps and Flats** When transposing a musical *key*, one adds sharps or flats to the key signature according to the distance traversed in the "circle of fourths" (or fifths, depending on the direction you're going). ``` fifths from C up to the enharmonic key: C G D A E B F# C# G# D# A# E# B# add: F# C# G# D# A# E# B# F## C## G## D## A## fourths from C down to the enharmonic key: C F Bb Eb Ab Db Gb Cb Fb Bbb Ebb Abb Dbb add: Bb Eb Ab Db Gb Cb Fb Bbb Ebb Abb Dbb Gbb ``` So the key of C can be written with zero sharps or flats, or with twelve sharps, or with twelve flats. The first options is clearly superior. But we only really need the middle of the table above because all those double-sharps and double-flats mean that some note is being given an overly-complicated name. So extracting the middle and arranging in sequence gives us this list of keys. ``` C Db(5 'b's) D(2#) Eb(3b) E(4#) F(1b) F#(6#)[or Gb(6b)] G(1#) Ab(4b) A(3#) Bb(2b) B(5#) C ``` And, dropping the counts and picking between F# and Gb (all flats looks prettier than one lonely sharp) gives: ``` C Db D Eb F Gb G Ab A Bb B C ``` But for named chords, the situation is less clear because the names carry accidentals with them. [Answer] # Javascript, 249 This code **handles bemol input**: ``` let N=["A","A#","B","C","C#","D","D#","E","F","F#","G","G#"] let t=(r,n)=>r.split("/").map((i)=>{ let a=i[1] let m=a=="#"||a=="b"?2:1 let c=i.slice(0,m) c=a=="b"?t(c[0],-1):c let x=(N.indexOf(c)+n)%12 x=x<0?12+x:x return N[x]+i.slice(m) }).join("/") ``` Limitations: 1. No double flat or double sharp support. 2. No validation of the chord's bass note or modifiers. 3. Output always uses sharps for accidents. i.e: `G#/C` instead of `Ab/C`. To solve the 'full' problem, you need the program to understand the chord modifiers and calculate each note that the chord uses, then match that with the transposed chord to get the right answer. While possible I see it unpractical to code that in a code golf setting. ### 'Readable' version: ``` let Notes=["A","A#","B","C","C#","D","D#","E","F","F#","G","G#"] let transpose=(input,n)=>input.split("/").map((splittedInput)=>{ let accident=splittedInput[1] let modifierIndex=accident=="#"||accident=="b"?2:1 let note=splittedInput.slice(0,modifierIndex) note=accident=="b"?transpose(note[0],-1):note let transposedIndex=(Notes.indexOf(note)+n)%12 transposedIndex=transposedIndex<0?12+transposedIndex:transposedIndex return Notes[transposedIndex]+splittedInput.slice(modifierIndex) }).join("/") ``` ]
[Question] [ Write a program (in a first language A) that interprets a "99 Bottles of Beer" program and a FizzBuzz program (both in a second language B) on its standard input. The output should go to standard output; you may implement the interpreter as a function in languages lacking standardized I/O interfaces. ## Constraints The 99-Bottles program must come from either [this site's problem](https://codegolf.stackexchange.com/questions/2/99-bottles-of-beer) or from <http://99-bottles-of-beer.net/>. Link to (do not copy and paste) the 99-Bottles program in your answer. The specific output is not important; what matters is whether the interpreter produces exactly the same output as a more complete one does. You may write the FizzBuzz program yourself, or you may obtain it from the Internet or another source. Do not copy and paste the program into your answer in the latter case. Both languages (and the 99-Bottles program) must have existed prior to September 22, 2011 (when this challenge was first posted). Specifically, you may not invent your own language for the specific purpose. Any interpreter that hardcodes a non-whitespace character or string to be sent to the output (or that accesses the Internet) is cheating and not permissible. For example, an interpreter that contains "beer", "Buzz", or even "b" as a string or character literal is not acceptable, but looping from 1 to 99 is acceptable if a corresponding print statement is not hardcoded. Both languages' names must not begin with the same letter and must not have any three character substring in common. For example: * APL and AWK begin with the same letter, and so do C, C++, and C#. * JavaScript and VBScript have SCR in common. Additionally, the 99-Bottles and FizzBuzz programs must not be valid in language A or any other language that the interpreter depends on – the *direct* use of eval, exec, or similar language features or methods to compile and execute them is expressly forbidden. ## Scoring The score is the sum of: * **Ten** times the interpreter's character count * **Ten** times the FizzBuzz program's character count. * The 99-Bottles program's **actual** character count (because it should not be a golfed program). This excludes any leading and trailing whitespace but includes whitespace used for indentation. Each newline counts as one character. For verification, include the code of everything you have written yourself, and link to any published sources you have used. [Answer] ## JavaScript interpreter for C (3834) ### Interpreter (180 \* 10 = 1800) f() is the function to be called. ``` function prvarf(x){a=arguments;i=0;s+=(t=x.replace(/%./g,function(){return a[++i]}));return t}function f(x){Function(x.replace(/int/g,'var').replace(/#|ma/g,'f//'))(s='');return s} ``` ### 99-Bottles (1074) <http://99-bottles-of-beer.net/language-c-844.html> ### FizzBuzz (96 \* 10 = 960) Adapted from one of the programs at <http://perl.guru.org/scott/misc/golf.html>: ``` main() {int b=0;for(;++b<101;)printf(printf("%s%s",b%3?"":"Fizz",b%5?"":"Buzz")?"\n":"%d\n",b);} ``` [Answer] A fun one. I don't think it broke any of the rules you laid out, but it might be considered cheating. VB.NET (2010, needs inline `Action(Of t1, t2)`), running on Windows, 362: ``` Imports System.Windows.Forms Module A Sub Main() Dim b As New WebBrowser IO.File.WriteAllText("C:\t.htm","<body></body><script>"&Console.In.ReadToEnd&"</script>") b.Navigate("file:///C:/t.htm") AddHandler b.DocumentCompleted,Sub(sender,e) Console.Write(b.Document.GetElementsByTagName("body")(0).InnerHtml) End Sub Do Application.DoEvents Loop End Sub End Module ``` It interprets JavaScript. If you run this, you'll need to go into the Task Manager and stop the process because I just looped infinitely to save characters. You'll also need to make sure there's a reference to System.Windows.Forms in the project. I haven't tested it yet, but I will as soon as I can. 99 Bottles of Beer, *2134 characters*: <http://99-bottles-of-beer.net/language-javascript-1079.html> FizzBuzz, ~~117~~ 113: ``` for(b=document.body,i=0;++i<=100;)b.appendChild(document.createTextNode(i%3?i%5?i:'Buzz':i%5?'Fizz':'FizzBuzz')); ``` For a total score of 3620 + 1130 + 2134 = # ~~6,924~~ 6,884 Oh well... ]
[Question] [ Given is a grid polygon by the list of its integer vertex coordinates arranged along the perimeter, in the form \$(x\_1,y\_1), (x\_2,y\_2), \cdots , (x\_n,y\_n)\$ with \$n \ge 3\$. The polygon is completed by connecting point \$n\$ to point \$1\$. For simplicity, it may be assumed that the polygon is simple and does not have interior angles \$\gt \pi\$. The **diameter D** is defined here as the largest Euclidean distance between any two points on the circumference of the polygon. A polygon can be deformed by **applying shear** while the area remains the same. The area \$A\$ of a polygon can be calculated in a known way, but it is not needed for the task at hand, because the area will not be changed by any shear. See Wikipedia [Shear Mapping](https://en.wikipedia.org/wiki/Shear_mapping). ## Challenge **Your task is to create a function that, given a polygon, finds an arbitrary sequence of such shears so that the diameter d of the transformed polygon becomes as small as possible.** This is related to a [question in mathoverflow](https://mathoverflow.net/questions/433773/upper-bound-on-the-diameter-of-a-convex-lattice-n-gon-with-a-given-area) and [this challenge](https://codegolf.stackexchange.com/questions/253633/the-smallest-area-of-a-convex-grid-polygon). Only those shears should be considered that are parallel to the coordinate axes and that result in a polygon with integer coordinates, i.e., with integer, but potentially negative, \$m\$ in the transformation matrices \$ \\ \begin{pmatrix} x' \\ y' \end{pmatrix} = \begin{pmatrix} 1 & m \\ 0 & 1 \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} \hspace {3mm}or \hspace {3mm} \begin{pmatrix} x' \\ y' \end{pmatrix} = \begin{pmatrix} 1 & 0 \\ m & 1 \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} \$ The program shall return the value of the minimum possible squared diameter \$d^2\$ and the transformed vertex coordinates, such that \$min(x'\_i) = min(y'\_i) = 0\$. The coordinates can be passed to the function in whatever form seems most appropriate, e.g., as a matrix or as vectors or as a reference to a data structure. It is permissible to overwrite the input coordinates in the result. If it is possible in the selected language with little effort, then a framework program should be made available that reads and outputs the results in the following format: \$(x\_1,y\_1),(x\_2,y\_2),\cdots,(x\_n,y\_n)\$ The commas between \$x\$ and \$y\$ and between \$),(\$ are mandatory. The calculated squared diameter shall also be output. A framework program must not perform any pre- or post-processing other than reading and displaying the data and conversion to/from the required form for the transformation function. The program should be able to handle polygons with at least 40 vertices. This is Code Golf, i.e., the shortest code (in bytes) able to solve the problem wins. **However, only the length of the transformation function is used for the Code Golf score.** The described form of output is chosen in order to be able to be used as input for a visualization program, e.g., Markus Sigg's [PolygonalAreasViewer](http://antiton.de/PolygonalAreas/index.html?(1,4),(2,2),(3,1),(4,1),(6,2),(7,3),(9,6),(10,8),(10,9),(9,10),(8,10),(5,9),(3,8),(2,7),(1,5)) ## Example ``` Input, a polygon with n=15 and D^2=2810: (1,1),(3,2),(6,4),(16,11),(23,16),(34,24),(38,27),(43,31),(44,32),(42,31),(39,29),(32,24),(21,16),(6,5),(2,2) First shear x' = x - y d^2=1105: (0,1),(1,2),(2,4),( 5,11),( 7,16),(10,24),(11,27),(12,31),(12,32),(11,31),(10,29),( 8,24),( 5,16),(1,5),(0,2) Second shear y' = y - 2*x' d^2=193: (0,1),(1,0),(2,0),( 5, 1),( 7, 2),(10, 4),(11, 5),(12, 7),(12, 8),(11, 9),(10, 9),( 8, 8),( 5, 6),(1,3),(0,2) Third shear: x'' = x' - y' d^2=82: (-1,1),(1,0),(2,0),( 4, 1),( 5, 2),( 6, 4),( 6, 5),( 5, 7),( 4, 8),( 2, 9),( 1, 9),( 0, 8),(-1, 6),(-2,3),(-2,2) No further reduction of diameter possible; normalize position x''' = x'' + 2, y''' = y' Expected return value: 82 (=d^2) and coordinates printed: (1,1),(3,0),(4,0),(6,1),(7,2),(8,4),(8,5),(7,7),(6,8),(4,9),(3,9),(2,8),(1,6),(0,3),(0,2) ``` [![Applied shears](https://i.stack.imgur.com/OVcqY.png)](https://i.stack.imgur.com/OVcqY.png) ## Test Cases ``` n = 3 A=1/2, D^2=26: (0,0),(1,0),(5,1) -> d^2= 2: (0,0),(1,0),(1,1) A=1/2, D^2=74: (0,0),(3,2),(7,5) -> d^2= 2: (0,0),(1,0),(1,1) A=50, D^2=233: (-3,2),( 3,-2),(10,10) -> d^2=169: ( 0,4),(10, 0),( 5,12) n = 7 A=6.5, D^2=13: (1,0),(2,0),(3,1),(3,2),(1,3),(0,3),(0,2) -> d^2=13: (1,0),(2,0),(3,1),(3,2),(1,3),(0,3),(0,2) (input unchanged) n = 8 A=7, D^2=149: (0,0),(1,1),(-1,0),(-4,-2),(-8,-5),(-9,-6),(-7,-5),(-4,-3) -> d^2= 10: (3,1),(3,2),( 2,3),( 1, 3),( 0, 2),( 0, 1),( 1, 0),( 2, 0) n = 15 A=51.5, D^2=18853: (0,0),(13,9),(36,25),(46,32),(43,30),(21,15),(2,2),(-14,-9),(-27,-18),(-50,-34),(-60,-41),(-67,-46),(-64,-44),(-45,-31),(-29,-20) -> d^2= 82: (9,4),( 9,5),( 8, 7),( 7, 8),( 6, 8),( 3, 7),(1,6),( 0, 5),( 0, 4),( 1, 2),( 2, 1),( 4, 0),( 5, 0),( 7, 1),( 8, 2) n = 17 A=75.5, D^2=1361: (1,-13),(1,-14),(2,-14),(3,-13),(6,-9),(8,-6),(13,2),(16,7),(20,14),(21,16),(21,17),(20,16),(17,12),(12, 5),(10, 2),(5,-6),(2,-11) -> d^2= 137: (0, 7),(1, 5),(3, 2),(4, 1),(6, 0),(7, 0),( 9,1),(10,2),(11, 4),(11, 5),(10, 7),( 9, 8),( 7, 9),( 4,10),( 3,10),(1, 9),(0, 8) n = 19 A=106.5, D^2=11240: (1,1),(2,2),(7,6),(11,9),(26,20),(37,28),(44,33),(61,45),(71,52),(84,61),(87,63),(86,62),(82,59),(67,48),(56,40),(38,27),(31,22),(14,10),(4,3) -> d^2= 202: (2,3),(1,5),(0,8),( 0,9),( 1,11),( 2,12),( 3,12),( 6,11),( 8,10),(11, 8),(12, 7),(13, 5),(13, 4),(12, 2),(11, 1),( 9, 0),( 8, 0),( 5, 1),(3,2) n = 20: A=121: D^2=394: ( 0,0),( 1,0),( 2,1),( 2,2),( 1, 5),( 0, 7),(-2,10),(-3,11),(-6,13),(-8,14),(-11,15),(-12,15),(-13,14),(-13,13),(-12,10),(-11,8),(-9,5),(-8,4),(-5,2),(-3,1) -> d^2=241: (13,4),(14,5),(15,7),(15,8),(14,10),(13,11),(11,12),(10,12),( 7,11),( 5,10),( 2, 8),( 1, 7),( 0, 5),( 0, 4),( 1, 2),( 2,1),( 4,0),( 5,0),( 8,1),(10,2) n = 24: A=260, D^2=937: ( 0, 0),( 2, 3),( 2, 4),(1, 5),(-1, 6),(-2, 6),(-5, 5),(-7, 4),(-10, 2),(-14,-1),(-15,-2),(-18,-6),(-20,-9),(-21,-11),(-22,-14),(-22,-15),(-21,-16),(-19,-17),(-18,-17),(-15,-16),(-13,-15),(-9,-12),(-8,-11),(-5,-7) -> d^2=578: (13,17),(12,20),(11,21),(9,22),( 6,23),( 5,23),( 3,22),( 2,21),( 1,19),( 0,16),( 0,15),( 1,11),( 2, 8),( 3, 6),( 5, 3),( 6, 2),( 8, 1),( 11, 0),( 12, 0),( 14, 1),( 15, 2),(16, 5),(16, 6),(15,10) A=238.5, D^2=657: (6,1),(5,1),(3,2),(2,3),(1, 5),(1, 6),(2,10),(3,13),(4,15),(6,18),(9,22),(10,23),(13,25),(14,25),(15,24),(16,22),(17,19),(17,17),(16,13),(15,10),(14,8),(12,5),(11,4),(8,2) -> d^2=409: (5,2),(4,3),(2,6),(1,8),(0,11),(0,12),(1,15),(2,17),(3,18),(5,19),(8,20),( 9,20),(12,19),(13,18),(14,16),(15,13),(16, 9),(16, 7),(15, 4),(14, 2),(13,1),(11,0),(10,0),(7,1) n = 27: A=343.5, D^2=1233: ( 0,0),( 1,0),( 4,1),( 5,2),( 5,3),( 4,5),( 2,8),( 1,9),(-2,11),(-4,12),(-9,14),(-12,15),(-16,16),(-21,17),(-22,17),(-25,16),(-27,15),(-28,14),(-28,13),(-27,10),(-26,8),(-25,7),(-23,6),(-18,4),(-15,3),(-11,2),(-6,1) -> d^2= 788: (18,0),(19,0),(23,1),(25,2),(26,3),(27,5),(28,8),(28,9),(27,11),(26,12),(23,14),( 21,15),( 18,16),( 14,17),( 13,17),( 9,16),( 6,15),( 4,14),( 3,13),( 1,10),( 0,8),( 0,7),( 1,6),( 4,4), (6,3), (9,2),(13,1) n = 38: A=360, D^2=71444: (1,1),(11,9),(21,19),(31,29),(41,39),(51,49),(61,59),(71,69),(81,79),(91,89),(101,99),(111,109),(121,119),(131,129),(141,139),(151,149),(161,159),(171,169),(181,179),(191,189),(181,181),(171,171),(161,161),(151,151),(141,141),(131,131),(121,121),(111,111),(101,101),(91,91),(81,81),(71,71),(61,61),(51,51),(41,41),(31,31),(21,21),(11,11) -> d^2=32404: (0,0),( 2,0),( 2,10),( 2,20),( 2,30),( 2,40),( 2,50),( 2,60),( 2,70),( 2,80),( 2, 90),( 2,100),( 2,110),( 2,120),( 2,130),( 2,140),( 2,150),( 2,160),( 2,170),( 2,180),( 0,180),( 0,170),( 0,160),( 0,150),( 0,140),( 0,130),( 0,120),( 0,110),( 0,100),( 0,90),( 0,80),( 0,70),( 0,60),( 0,50),( 0,40),( 0,30),( 0,20),( 0,10) ``` [Answer] # PARI/GP 290 bytes ``` d(x,y)=C=0;for(i=1,#x,for(j=1,i,C=max(C,(x[i]-x[j])^2+(y[i]-y[j])^2)));C shear(x,y)=T=D=d(x,y);until(T==D,T=D;if((t=d(x,z=y-x))<D,,if((t=d(x,z=y+x))<D));if(t<T,D=t;y=z);if((t=d(z=x-y,y))<D,,if((t=d(z=x+y,y))<D));if(t<D,D=t;x=z));for(k=1,#x,print1("("x[k]-vecmin(x)","y[k]-vecmin(y)"),"));D ``` The function \$shear(x,y)\$ has the coordinates, stored in 2 separate vectors, as arguments. Its return value is the squared diameter \$d^2\$. The transformed coordinates are written to output in the suggested format. The function \$d(x,y)\$ calculates the squared diameter. Without any significant efforts regarding "golfing"; only to demonstrate the feasibility. ## Auxiliary functions to read input ``` readc()={my(s=""); s=strjoin(strsplit(input(),"),("),";"); s=strjoin(strsplit(s,"("),"v=["); s=strjoin(strsplit(s,")"),"]"); eval(s)}; inpgon()={my(mxy=readc());x=mxy[,1];y=mxy[,2];d(x,y)}; ``` ## Example ``` inpgon() \\ expects coordinate input from terminal delimited by "..." "(1,1),(3,2),(6,4),(16,11),(23,16),(34,24),(38,27),(43,31),(44,32),(42,31),(39,29),(32,24),(21,16),(6,5),(2,2)" 2810 \\ returns D^2 of input shear(x,y) \\ call of function, prints result and returns d^2 (1,1),(3,0),(4,0),(6,1),(7,2),(8,4),(8,5),(7,7),(6,8),(4,9),(3,9),(2,8),(1,6),(0,3),(0,2), 82 ``` [Answer] # [R](https://www.r-project.org), 143 bytes ``` f=\(x,`+`=\(y)max(dist(y)^2)){d=+x;for(i in 2:3)for(j in -1:1){h=0 while(+x>+{h=h-1;m=diag(2);m[i]=j*h;y=x%*%m})x=y} `if`(d>+x,f(x),list(d,x))} ``` [Attempt This Online!](https://ato.pxeger.com/run?1=ZVZdbhs5DH5d-GHPMAhQRGqoYqifmXHT6UViLzKN7caFnRgeF52gyBn2APvSfdhDdU-z_JGcLIokI0okP1LkRyF__X388eOfr6eN637-uekXZoLbq1tan-x-mMxqO55I_MNb-33VX03Xm8ej2Vbbh8q_D5Y3X3jj8D3a7_d9Pft2v92tzdX08Yq29w6v9_1qO3w23l7vb7bL_svb--unfnrz9s3-2U790_Psdru5NauPVxNszGRhxxFXMFn7rGn9-9vvh-P6g1uY0Q7ju_1wOm4nc1wPq3en4RMFO62nU_95_PrJXNwYWy0v4OICdG9hsTC0XxwXDxcwWgvj-tDTgbWzw-N4YtQJVv2d2W8fzHQDuLSQRb-01h6G8bSuzXA47J7MiX4m61YWEBbmWJSX5hKyeIS7x91uOIzr_hIuLf1eUsz_nc24aLvtw5rrNt4ND4bTlbQoR2uru-Fk1ju64PjBbQxdXawpF6jYAipOnNU3N365zKd2ZhDQggng6dtApC82gHzmA2DDugiez0MHvqU1BgisjxECe0Wv-zAHP-fVq71H9W8g8Y4izEwNNUeQb6LI5UTjt2Q5M043VQDHK9aAtSRaC4yavySNEOhb5-_rIGzj1M1FBXMdOM7GzcFxbq7Ne9KHF9cAcpEGPCtjky9KF6_zxcqVOAL5srnzBIYdS6kmOK6Ba0iKkkhD2igxG3KIoo2J7ETrKSGv13QYJH0CliC6hnzeaLBO88dcgwa4M55K9bryvJZzsW4BxdxDlbS0lZdOCBiHwjMlfG6JOKIUxFNBpPwt-C4zQHJCiIzXIiR26iI0DNGRN-u7Bho595AYh0oR2T8R4epXzAoIXvKL3HLCB-5JpU2ptJOVl-wqTY8O5SZkU7VSR_UkDqFWHaRq1HepDF1Qe-eoBlkIRRWyLRYQMu6ULEkxxC5p24PQlwPntKqQVxkizYvoVzWal64pn7dq5koLhEVK2JSpirnHxItCMJQOsVRooVI6a8UBiUzSeMHIUjprQ_FgszIViktGLd2qkRqnV1PmIbzcKl8qlymXLWo9yZVrNs-dpIkMmadJO6tr0jeCiKt2xMx5Xls91ylIGoP8OiVuUjpGmQH_Kz2i0kObREvQw6S96dRynqmCOvpahHnhwZkZjY6NK3PExc5CKqo2G_vCMBZCUQmNaGy67KTOAZrcnJhbEzLdfObseQrL5KHWhyeE10ivHq-JKjHXCZTJogls5HlAaHmdE4OlrjXhiMADUIvEmFp0QkWBRcJFAUZCRoHGhkdGm8PvikgdV0QkioDd-azDYtdi8ZWnQPASlhjyJEpcef4kF48lP-kLp0x_eok56qUEn-AFncAFm6AFmYAFl2AFlUAzJnda_y0o_7X8Bw) Recursively searches for the next best shear until further reduction in diameter cannot be found. Diameter calculation function is overloaded as `+` operator. Input and output of coordinates is by `n x 2` matrix, transformation to required format is done in the footer. Note that output coordinates do not exactly match the provided test cases, but the diameters match and the shapes look the same. ]
[Question] [ **This question already has answers here**: [Fold a List in Half](/questions/136887/fold-a-list-in-half) (58 answers) Closed 2 years ago. An example will easily explain this to you. Suppose an array `[1,2,3,4,5]` **Step 1** ``` 1 2 3 4 5 ----+---- ``` **Step 2** ``` 5/ 4/ 1 2 3 / ----+/ ``` **Step 3** ``` 5| 4| 1 2 3| ----+| ``` **Step 4** ``` 5\ 4\ 1 2 3\ ----+-\ ``` **Step 5** Take the sum of face-to-face elements ``` 6 6 3 ``` You just successfully folded an array 1 time. 2 times folding means to fold `6 6 3` again. **Challenge** Given an array of positive integers, return it folded like above. Traling whitespace accepted in output. **Test cases** (Randomly generated 100): ``` [98, 82, 25, 51, 20] -> [118, 133, 25] [52, 75, 89, 96, 82] -> [134, 171, 89] [53, 12, 70, 10, 19, 36] -> [89, 31, 80] [63, 43, 89, 74, 31] -> [94, 117, 89] [98, 52, 67, 66, 78, 92, 51, 87, 1, 7] -> [105, 53, 154, 117, 170] [55, 7, 30, 80] -> [135, 37] [77, 69, 57, 29, 76, 65, 62, 71, 58] -> [135, 140, 119, 94, 76] [79, 84, 57, 47, 99] -> [178, 131, 57] [81, 95, 54, 52, 6, 33, 85, 36, 93] -> [174, 131, 139, 85, 6] [2, 41, 33, 90] -> [92, 74] [84, 84, 20, 39] -> [123, 104] [78, 34, 40, 19, 86, 92, 4, 11, 12, 86] -> [164, 46, 51, 23, 178] [20, 19, 82, 75, 1] -> [21, 94, 82] [18, 82, 22, 19, 61, 57, 66, 32, 1] -> [19, 114, 88, 76, 61] [11, 95, 12, 48, 75, 47, 73] -> [84, 142, 87, 48] [41, 11, 69, 9, 44, 10, 98, 13] -> [54, 109, 79, 53] [4, 17, 38, 51] -> [55, 55] [61, 27, 46, 81, 32, 41, 78, 45, 21, 13] -> [74, 48, 91, 159, 73] [26, 28, 36, 95, 37, 65, 48, 14, 42] -> [68, 42, 84, 160, 37] [73, 47, 38, 57, 78, 97, 38, 43, 4, 37] -> [110, 51, 81, 95, 175] [91, 33, 72, 45, 45] -> [136, 78, 72] [83, 72, 15, 74, 4] -> [87, 146, 15] [25, 72, 35, 26] -> [51, 107] [4, 38, 56, 35, 86, 69, 8, 97, 26] -> [30, 135, 64, 104, 86] [13, 19, 80, 90] -> [103, 99] [90, 38, 32, 14] -> [104, 70] [47, 70, 5, 69, 72, 90, 22, 51] -> [98, 92, 95, 141] [98, 68, 6, 49, 94, 95, 50, 57, 3, 46] -> [144, 71, 63, 99, 189] [15, 56, 5, 71, 1, 57] -> [72, 57, 76] [51, 27, 18, 29, 13, 22, 77, 45] -> [96, 104, 40, 42] [1, 92, 25, 34] -> [35, 117] [90, 72, 17, 62, 44, 15, 80, 61] -> [151, 152, 32, 106] [73, 95, 46, 50, 9, 27, 31, 84, 37] -> [110, 179, 77, 77, 9] [38, 31, 78, 37, 49, 56, 27] -> [65, 87, 127, 37] [27, 6, 92, 39, 89, 81, 27] -> [54, 87, 181, 39] [77, 10, 81, 53] -> [130, 91] [77, 6, 38, 42, 3, 5, 42, 29, 55, 22] -> [99, 61, 67, 84, 8] [18, 42, 93, 81, 31, 31, 50, 21] -> [39, 92, 124, 112] [89, 100, 91, 80, 24, 90, 48, 73, 44] -> [133, 173, 139, 170, 24] [14, 14, 73, 86, 18, 57, 53, 63, 27] -> [41, 77, 126, 143, 18] [61, 21, 21, 72] -> [133, 42] [91, 94, 57, 7, 54, 45, 6, 20, 44, 82] -> [173, 138, 77, 13, 99] [50, 91, 21, 22, 82, 15] -> [65, 173, 43] [26, 64, 72, 82, 16, 21, 99, 99, 64, 39] -> [65, 128, 171, 181, 37] [84, 47, 17, 68, 22, 97, 43, 46, 96] -> [180, 93, 60, 165, 22] [60, 46, 97, 50, 7] -> [67, 96, 97] [77, 52, 56, 11, 73, 76] -> [153, 125, 67] [71, 31, 73, 90, 93, 8, 21, 63, 73, 29] -> [100, 104, 136, 111, 101] [81, 67, 39, 39, 72, 56, 14] -> [95, 123, 111, 39] [93, 44, 86, 26, 96, 49, 3, 88, 96, 100] -> [193, 140, 174, 29, 145] [85, 93, 55, 65, 17, 97, 56, 3] -> [88, 149, 152, 82] [99, 4, 91, 80, 27, 60, 77, 100, 56, 31] -> [130, 60, 191, 157, 87] [41, 64, 91, 55, 15, 43] -> [84, 79, 146] [11, 56, 68, 85, 29, 74, 5, 85, 99, 4] -> [15, 155, 153, 90, 103] [86, 10, 17, 43] -> [129, 27] [45, 75, 55, 74, 1, 84, 54, 37, 54, 88] -> [133, 129, 92, 128, 85] [65, 96, 78, 94] -> [159, 174] [36, 36, 47, 78] -> [114, 83] [44, 32, 88, 58, 51] -> [95, 90, 88] [77, 60, 44, 17, 60] -> [137, 77, 44] [6, 76, 2, 32] -> [38, 78] [58, 48, 19, 69, 57, 46, 74, 97] -> [155, 122, 65, 126] [77, 100, 2, 12, 16, 57] -> [134, 116, 14] [71, 9, 98, 50, 86, 98, 36, 21, 76, 33] -> [104, 85, 119, 86, 184] [53, 11, 66, 36, 53, 21, 15, 8, 14, 54] -> [107, 25, 74, 51, 74] [58, 44, 52, 68, 24] -> [82, 112, 52] [80, 78, 57, 28, 78] -> [158, 106, 57] [89, 72, 26, 57] -> [146, 98] [1, 71, 68, 96] -> [97, 139] [67, 70, 24, 65, 4, 82] -> [149, 74, 89] [39, 62, 77, 35, 7, 14] -> [53, 69, 112] [77, 90, 89, 41, 28, 23, 14, 18, 84] -> [161, 108, 103, 64, 28] [11, 13, 92, 97] -> [108, 105] [60, 82, 63, 76] -> [136, 145] [3, 17, 46, 33, 91, 54, 88] -> [91, 71, 137, 33] [11, 9, 51, 69] -> [80, 60] [33, 85, 28, 6] -> [39, 113] [23, 89, 21, 13, 98, 21, 66, 37] -> [60, 155, 42, 111] [10, 38, 53, 35, 26, 11, 2, 47] -> [57, 40, 64, 61] [66, 77, 5, 84] -> [150, 82] [74, 43, 49, 65, 6] -> [80, 108, 49] [86, 29, 60, 100, 3, 66, 86, 96] -> [182, 115, 126, 103] [65, 4, 74, 67, 9, 35, 14, 70, 2, 91] -> [156, 6, 144, 81, 44] [52, 2, 99, 49] -> [101, 101] [18, 54, 59, 84, 9, 8, 14, 49, 22, 90] -> [108, 76, 108, 98, 17] [94, 64, 52, 56, 73] -> [167, 120, 52] [6, 59, 56, 47, 9, 88, 86] -> [92, 147, 65, 47] [11, 26, 26, 44, 29, 38, 92, 74, 83, 1] -> [12, 109, 100, 136, 67] [42, 70, 26, 11, 57] -> [99, 81, 26] [38, 12, 26, 91, 79, 42] -> [80, 91, 117] [22, 58, 21, 1, 49, 10, 60, 60, 90] -> [112, 118, 81, 11, 49] [72, 92, 97, 57, 4, 86, 35, 20] -> [92, 127, 183, 61] [79, 59, 67, 86] -> [165, 126] [66, 82, 61, 42, 1, 25, 37, 91] -> [157, 119, 86, 43] [14, 23, 34, 69, 22, 41, 81, 43, 28] -> [42, 66, 115, 110, 22] [59, 54, 63, 43, 55, 46] -> [105, 109, 106] [42, 12, 90, 18, 72, 73, 6] -> [48, 85, 162, 18] [94, 1, 38, 20, 66, 25] -> [119, 67, 58] [41, 20, 67, 63, 16, 41, 17, 86] -> [127, 37, 108, 79] [91, 22, 48, 11] -> [102, 70] ``` [Answer] # [05AB1E (legacy)](https://github.com/Adriandmen/05AB1E/tree/fb4a2ce2bce6660e1a680a74dd61b72c945e6c3b), 5 bytes (Pointed by Kevin Cruijsen) ``` 2ä`R+ ``` [Try it online!](https://tio.run/##MzBNTDJM/f/f6PCShCDt//@jDXWMdIx1THRMYwE "05AB1E (legacy) – Try It Online") # [05AB1E](https://github.com/Adriandmen/05AB1E), 7 bytes ``` 2ä`R0ª+ ``` [Try it online!](https://tio.run/##yy9OTMpM/f/f6PCShCCDQ6u0//@PNtQx0jHWMdExjQUA "05AB1E – Try It Online") Trivial solution ``` 2ä # Halve [[1,2,3],[4,5]] ` # Unpack [1,2,3],[4,5] R # Reverse [1,2,3],[5,4] 0ª # Fill [1,2,3],[5,4,0] + # Add [6,6,3] ``` [Answer] # [Java (JDK)](http://jdk.java.net/), ~~104~~ 102 bytes ``` i->{int l=i.length,o=l/2+l%2,j=0,r[]=new int[o];for(;j<o;j++)r[j]=i[j]+(j<l-j-1?i[l-j-1]:0);return r;} ``` [Try it online!](https://tio.run/##bZLJbsIwEEDvfMVcKiXChH0NaVX1xKEnjlEOJphg19jIdqgQyrfTCRCWwkjJRJM3@wi6ow2x/DmmkloL35QrONRqgNJsQrqmKmN0IRlw5ZhZ0ZSd/m0N31F3Z4UZusFF0Bon4Jh14J2/udrmzg9PRHEOv80XkqdgHXWodpovYVNm9@bOcJWhEzWZ9atqLhVZ5vLt1TADq2XuuFYQXY03OtNyxZaQ6iU78sb7AWsBGfFAMpW5NdGRbHbq8q1DRNQiJk4ixX5PxeskXGnjhWKqQ1Gv@yYWScTxVffEVDZEo/3B45NOJi0/NFiUUWDC4hjWHqdwmcMXtcxCdDejSg7jEYFRh0CnT6DfRt0qyDPVR2KIxGhMYDwoPV5SXQLtkmyhLh@ku4NX5ADJXvccb9hDql1coeKuCRxDtcOqj8mtI/9fQ/O9dWwT6NwFeCHKSeU9pS5F4NUFuDcZfBpD9zZw@rx1r9pnUObwqkS@/xDmckh3x1TUiuMf "Java (JDK) – Try It Online") [Answer] # JavaScript (ES6), 39 bytes ``` f=([n,...a])=>n?[n+~~a.pop(),...f(a)]:a ``` [Try it online!](https://tio.run/##fdBRD4IgEAfw9z4Fj7AIQRSkzfogjgdm2moNXLUe/ep2l@slKzd3E28//nfn8Ai39noa7puYDt009TVtIhdCBM/qXdw3cT2OQQxpoAyPexqY34apTfGWLp24pCPtaeMqTqqck7zkpFRQpWeMLJ8sI41S0Ky0xm6/@oBKQCwglePEGUT/QLoAyCrsXkLgK8QkVHwB1GaJIYSXaWTkgjHAFHrOYwts@53HYRxlv8bBBeFsBn4bmMvCt8vnZVVwBsWi/JpL4hYxf/kWlZV@egI "JavaScript (Node.js) – Try It Online") ### Commented ``` f = ([ // f is a recursive function taking: n, // n = next integer ...a // a[] = array of remaining integers ]) => // n ? // if n is defined: [ n + // append the sum of n ~~a.pop(), // and the last element extracted from a[], // coerced to 0 if it doesn't exist ...f(a) // append the result of a recursive call ] // : // else: a // return a[], which is now guaranteed to be // an empty array ``` [Answer] # [Python 3](https://docs.python.org/3/), 46 bytes ``` f=lambda a:a[1:]and[a[0]+a[-1]]+f(a[1:-1])or a ``` [Try it online!](https://tio.run/##XVjLbhw3ELzrK@ZmCZYDNt80oPzIYg8b2IIFyLLgyAny9Qqrujg7CZCNdmeaZD@qqpt@/eft24@X9P7@@PB8@f7Hl8t2@Xw52efz5eXL6XIK54@X0yc7nz8@3uLx/Hr34@d2ef/729Pz180@32zb08vr/fbj19v2sH2/vN5@/evyfI@Hv95u73778/X56e32w/bp9@3D3d20fv359PJ2@3g7De62hwcsvHs/jX6/9Xi/xXK/FZt/wxlLTmbzhaWEN@ebU5kmbZr0cb@NiiUyS3maNcMbmE17g2mYf/GZ5qm6KZYmGIZpWKdhTr5fy3jhRgPbWdN2cA4n1/mgzlPb/D2iO9rns/mnyY8A/3F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JUb/xzvg3gulvIAhkm72lyEVYDNGofIBzM1T7LwLWm0H4rEA3s5ApqYOW7UJTofw5EM/bvSxqntjR5Qa/kaNc8V/0plVGezD/6kYU/oRZdWk2K5nWKRswZPiE0FRy5KMlewCRX3pR3rGneD0CJAqnnB21d0ZEhjkRbHxYYNZW3FK4diQXVyR6HKYHVBzxND7Ui2Rkbjf50xpa8ZB1YceqrXEqPPISdGuUWFcx1GwABGPpdjMHejk1Ku7mAZuaiLsalA@mJvj1JkwfEgCrzgIamCh7nAkPTTdXjTruqDlNdubxrrq8sbRqJBUxrqsLZo3NmLBNKwyzDUCd4qnQypSi/ECgAheK87k/VAULJ9Nbs3UYmI8xkzp6N5b2c37VXEGRRHsrJolIPSc0g4amgVgtn@wvaqPJ79HLNJT28fqIWygwfsfyAO/qQjZu0FfealUFQaSnGOxi0YU7HgouJsVqSKSVI9KR5WiUCSxR9cKsvZAjKFkEI4prZnbC1Mlf5wrMGitiwlCqNemacYOoRtbXP4uMa3X0YJ6UtS3pyTiPI12SJrPlY4kzDVrUmg@GSElvBfwutdcSXbWBokcp9fkmsr72jUIpi0PKQvkgA6BJckd7f9pQ3SyrKZMSRImcAgbjzvNDu9cG/sAVtmJOT2iTZDogHeU9u3NZe8mHA5AAl0dx04eBMN2GQ4AaFUh8XrDyTB7llYLXBclqxwtgmhU/YgiaRuuYeu2R4nM65bShImodpXVh5ImahIiXS9yUbcr75kAIrtt1sV/lXfRcqypsGrGNPGWyBzX61HXqOIjMGd7Acw8PaZ@VY83CLpDluliyOrzhqDhg@DywhN@h1u0@dyehDreF4fmyv1mvAsu4RN99CS8Nb63IybaQTk5V6G4YA4UuarIWXc4oDiKqNix1oVHC5qJWMbs7M@aB/Z7C/7ZQ7WoKoHpbmTdFRJTjsyz2rRB1Th8Dm@qqAqgg@PjujyaElHWrZsWzT1BZ@FN/JgpvxcIsW1ofI262ttKUSBQzv8C "Python 3 – Try It Online") [Answer] # [Jelly](https://github.com/DennisMitchell/jelly), 6 bytes ``` ŒHUÐeS ``` [Try it online!](https://tio.run/##y0rNyan8///oJI/QwxNSg////x9taaGjYGGko2BkqqNgagikDWIB "Jelly – Try It Online") ``` # implicit input [98, 82, 25, 51, 20] ŒH # split input list into two halves [[98, 82, 25], [51, 20]] Ðe # apply at even indices (the second half): ^^^^^^^^ U # reverse the list [[98, 82, 25], [20, 51]] S # take the sum of the lists [98+20, 82+51, 25+0] # implicit output [118, 133, 25] ``` [Answer] # [JavaScript (V8)](https://v8.dev/), 53 bytes ``` a=>a.splice(0,a.length/2).map(j=>j+a.pop()).concat(a) ``` [Try it online!](https://tio.run/##DcaxDgIhDADQ32ljrXpq4sJ9gIMOjsahIYAQhOYgl/j16JteklWaXaL27XoZ3gwxs3DTHK2DPQlnV0J/7ybkjygkM6eNsFYFRLa1WOkgOP5rNTvONcD1cb9x60ssIfoveHgeaKIjnej8QsTxAw "JavaScript (V8) – Try It Online") ``` a.splice(0,a.length/2) // Slice first half .map(j=>j+a.pop()) // Add from tails .concat(a) // For the pop and splice only middle remains ``` ]
[Question] [ Your task is to create either a console "app" or a function which allows the user to bet on certain numbers or retire / claim rounds. --- ## Bets Your program or function will prompt for a command after an action, and the bet is the most important, crucial to the operation of the app. A bet looks something like this: ``` bet 5 bet 4 9 ``` Each time the user bets, your application should choose a 1-digit number (1-9, not including zeroes) at random. It is reasonable to assume that your pseudo-random number generator is uniformly random. When your application receives a `bet` command, there may be 1 or 2 numbers after `bet`. They will be 1-digit numbers from 1-9. If there is 1 number, that means that the user is willing to bet on a single number in the range `1-9` coming out. If there are 2 numbers, things get slightly more complicated. This means the user is instead betting on a *range*: with bounds included. So `bet 4 9` means the user is betting on a number in the range `4-9` being selected. The first time you bet in a "round" (explained later), you win 1$ if your number is selected, but lose 2$ if your number is not selected. However, if the user bets on a range (which has a higher chance of winning), the money won is less: the first bet in a round wins `1 - (rangeEnd - rangeBegin + 1) / 10` while losing that bet will deduct double that amount from the player's balance. Each subsequent bet doubles the "stake". The second bet in a round wins 2$ for one number and `2 - 2 (rangeEnd - rangeBegin + 1) / 10` for a range, and losses are worth double each. Then the third bet wins 4$ for one number, `4 - 4 (rangeEnd - rangeBegin + 1) / 10` for a range, etc. After a bet, some output should occur: an indication of the result as well as the chosen number (`chosen <number>`) If the bet is won, something like ``` won 1 chosen 5 ``` should be output. If the bet is lost, then something like ``` lost 2 chosen 7 ``` ## Retirement At any point, the user is also allowed to "retire" the current round if he or she is too afraid to lose money. This adds the player's current money to the main balance, which is initially set to zero. This also triggers a new round in which the first bet wins 1$, second 2$, etc with the above rules for ranges also applying. The command is simply ``` retire ``` This produces no output. ## Claims When the player decides to leave the "casino", he or she must "claim" the money, which in the context of your app must output the player's balance and **halt**. No commands should be accepted after `claim`. Command: ``` claim ``` ## Example This is a console app. Rules for functions and other general info are provided below. Note that `>` before commands are not necessary. They are just shown here for clarity. Also note that the numbers here were chosen by me and not an RNG, but that your code is expected to produce the numbers non-deterministically. ``` > bet 6 lost 2 chosen 3 > bet 3 7 won 1 chosen 6 > bet 9 won 4 chosen 9 > retire > bet 1 lost 2 chosen 6 > claim 1 ``` In the second bet of round 1, the range was 3-7, so the player won `2 - 2 (7 - 3 + 1) / 10 = 2 - 2 (5/10) = 2 - 1 = 1` dollars. ## Rules for functions Functions are allowed, but they have a different I/O format. Input can be taken as a newline-separated string of commands, an array/list of commands, etc. Nothing new there. The commands can be taken as sub-lists too, so `bet 4 9` can become `['bet', 4, 9]` in JavaScript, for instance, and `retire` could be `['retire']`. Return value can be any of: newline-separated string of outputs, array/list of outputs, etc. Post-bet output can be a list of numbers (`-2 4` for `lost 2 chosen 4` and `64 9` for `won 64 chosen 9`), and you will have to output floating point numbers from time to time. As @Arnauld pointed out in the comments, your function might not necessarily be **reusable** (see [here](https://codegolf.meta.stackexchange.com/questions/4939/do-function-submissions-have-to-be-reusable/4940#4940)). ## Other rules Invalid input will never be given. So no ranges where the end is less than or equal to the range beginning, no numbers outside the range 1-9, no commands other than `bet`, `retire`, `claim`, and correct number of arguments: `bet` taking 1 or 2 args, and the latter two commands taking no arguments. Floating point errors are acceptable. This is code-golf with the shortest answerer in bytes winning. No standard loopholes, please. [Answer] # JavaScript (ES6), 110 bytes A function taking either `(command, value)` or `(command, min_value, max_value)`. Returns `[chosen_number, profit]` for *bet*, `0` for *retire*, or the final balance for *claim*. ``` (c,x,y)=>c[3]?c[5]?b=0:t:[k=-~(Math.random(b=b*2||1)*9),-t+(t+=(k<x|k>(y||x)?-2:1)*(y?b+(~y+x)*b/10:b))] b=t=0 ``` [Try it online!](https://tio.run/##dctLDoIwFADAPadgx3vQImjUSCycwBMQFm2tinxqoDGQNFwd2SPrybz5l/eyKz@Gtvqu5gebQZKBjMhSmR@KTObHIhMsSkySV4xOcOPmFXa8vesGBBP@3toY/QsSagIwAYPqOtgqhdHaATO6TxaFMRMBTGMwoC92cZQIxMIRzLBolrrtda3CWj/hAZ5QxiPuCdH5CwfinrfssoZOmbJT3taI1yBrXjZLmH8 "JavaScript (Node.js) – Try It Online") [Answer] # [Python 3](https://docs.python.org/3/), 279 bytes ``` import random as o d=m=0;t=1 s=eval(input()) for x in s:c,r=x[0],x[1:];exec({'bet':'if len(r)>1:r=range(r[0],r[1]+1);d=1\nh=o.randint(1,9);k=[t,t-t*(r[-1]-r[0]+1)/10][d];k=[-k,k][h in r]\nif not(d or(h in r)):k+=k\nprint(h,k);m+=k;t*=2','retire':'t=1','claim':'print(m);1/0'}[c]) ``` [Try it online!](https://tio.run/##LY/RTsQgEEXf9yt4K@xSt7iJxhL8EToPtWUtoUAzRVNj/PYK1re5M2fu3Fm@0hTDbd@tXyImgn0Yoyf9SuJpVF41MilxWpX57Gdqw/KRKGOne0SyERvI2g4c1aYb4JsWLUizmYF@V28mVW1l72Q2gSJ7FS2qbP1uKBYWtYCLYHJUoguTig/lrA2JCv7CpFM68VSnc4ZrAXVZyfRVNKBHKOPacQd6KgkQupDvhJjoSCLSo8lY6y7KdWHBYjtxx6TPDZnO6rHiFZpk0eSI@bssh7m3PquD9kyKa1P96AHYvmv99w1/Av5f3fhzqY8lgP0X "Python 3 – Try It Online") Takes a 2D list as input, this is a full program which will prompt for input. Exits on zero division error on claim. ]
[Question] [ You are piloting a spaceship, outfitted with an engine that can accelerate you at 1km/s^2 in the direction the ship is facing (you have very good inertial dampers). You also have thrusters which can rotate you 180 degrees in 1s (rotating 45 degrees takes 0.25s, etc.). You see on your scanner another ship, and decide to rendezvous with it. You'll need to plot a course which brings you within 1km of it while your speed is within 1km/s of its speed. ## Specifications Write a function which takes the following pieces of data as inputs: `other_location` - The location of the other ship in kms. You may assume that this is no more than 100 units away from the origin for optimization, but your entry should be able to handle larger distances (even if it takes a long time). `other_acceleration` - The other ship is accelerating at a constant rate no more than 0.5km/s^2 (their inertial dampers aren't quite as good). You may take this in whatever form you wish - facing + acceleration, or separated into x and y components). The other ship starts at a speed of 0. You always start at `[0,0]`, facing the positive direction on the x axis. Your function's output is significantly more constrained. You must return a list of actions your ship will take. There are three possible actions. 1. Acceleration. You accelerate in the direction your ship is facing for an amount of time you specify. 2. Rotation. You rotate to face a direction you specify. 3. Drift. You do nothing for the amount of time you specify. Your output must have the listed data, but it can be in any format you wish. Please make it human-readable; this isn't code golf. At the end of the final action in your list, your ship must be within 1km of the other ship and its speed must be within 1km/s of the other ship's speed. Note that if you accelerate from a stop for 1s, you will have moved 0.5kms. ## Scoring Criteria I will run each entry on my machine, a i7-9750H 2.6 GHz Windows 10 laptop. Ideally, there will be straightforward installation instructions for your language; please specify whatever build command I need to run it. The score of an entry on a particular input will be the product of the time it takes to run and the time that it takes for your ship to intercept the other ship squared. Entries may be non-deterministic, but I will run any non-deterministic entry 10 times on each input and take the worst score. The winner will be the entry that has the lowest total score across the inputs. ## Example inputs Here are a bunch of sample inputs (that I'll use as the test set, though I might add some more if some programs are very quick). Feel free to post preliminary outputs/scores for each of these (run on your machine), but note that it's a standard loophole to tailor your program to these inputs. ``` other_location (x, y), other_acceleration (x, y) [10,0], [0,0] [6,-3], [0,0.5] [-2,8], [0.1,-0.2] [5,5], [0.3,0.3] [15,18], [0.1, 0.3] [20,5], [0.2,-0.2] ``` ## Example output For the first example input (`[10,0], [0,0]`), these are all valid outputs: ``` [Accelerate, 1], [Drift, 8.5] [Accelerate, 2.7], [Rotate, 180], [Accelerate, 2.7] [Accelerate, 2], [Rotate, [-1,0]], [Drift, 2], [Accelerate, 2] ``` For the second example input (`[6,-3], [0,0.5]`), this is a valid output: ``` [Accelerate, 2.23], [Rotate, 180], [Accelerate, 2.23], [Rotate, -90], [Accelerate, 11.5], [Drift, 5.5] // The first 3 actions put me directly behind the moving ship (actually // at [5.9729, 0]) in 5.96s (the other ship is now at [6,5.8804] and // moving [0, 2.98]), the remainder catch up to it. // Total time for this route: 22.96s ``` [Answer] # MATLAB [Try it online](https://tio.run/##lU/baoQwEH33K@Yx6eri5KKrIV9StrDY2AbcWKztQ3/eziTPCy1yJnPmXMB12m/f4TjmrzTtcU2Q/CTuskp@28JMm1v8Z/wJItUo3bxuED2OSxU8nu3pbJ9Eg/IljmpcXBKhHqUvz2kLH/fbLpKIxOolpLf9XQTJNSG9ZhyTeFZgoIOLgxYUwThAWiyYq6xIZqIdeSxYR8YHAkcbLMpfGvnAdX1BsWQUkwba6QBIBTSpTRnQCL3i2bWAA@fhwiIMNC30jqnJR0UODbr7T12bw9jRn5ACjRoeFiKZ@WsUx7DA5RMTdZXHLw) ``` function tf=Intercept(p,a) X=@(t,a,v,x).5*a*t.^2+v.*t+x; t=0; while 1 a1=(0:0.01:1)'; a2=1-a1; theta2=-360:360; x1=X(t,a(1),0,p(1)); y1=X(t,a(2),0,p(2)); theta1=atan(y1/x1)*180/pi; T=(t-abs(theta1)/180-abs(theta2-theta1)./180); T(T<0)=0; x2=0.5*a1.^2*cosd(theta1).*T.^2+0.5*a2.^2*cosd(theta2).*T.^2+a1.*a2*cosd(theta1).*T.^2+a1.*cosd(theta1)*T.*abs(theta2-theta1)/180; y2=0.5*a1.^2*sind(theta1).*T.^2+0.5*a2.^2*sind(theta2).*T.^2+a1.*a2*sind(theta1).*T.^2+a1.*sind(theta1)*T.*abs(theta2-theta1)/180; x=x1-x2; y=y1-y2; vx=a(1)*t-(a1*cosd(theta1)*T+a2*cosd(theta2).*T); vy=a(2)*t-(a1*sind(theta1)*T+a2*sind(theta2).*T); V=sqrt(vx.^2+vy.^2); D=sqrt(x.^2+y.^2); [ida1,idtheta2]=find(D<1&V<1,1); if ~isempty(idtheta2) a1=a1(ida1); theta2=theta2(idtheta2); break end t=t+0.01; end if length(theta2) > 1 return end tf=t; t1=abs(theta1/180); t3=abs(theta2-theta1)/180; t3=t3-0*(t3>1); t2=a1.*(tf-t1-t3); t4=tf-t3-t2-t1; x1=a(1)/2*tf^2+p(1); y1=a(2)/2*tf^2+p(2); v1=a*tf; x2=cosd(theta1)/2.*t2.^2+cosd(theta1).*t2.*(t3+t4)+cosd(theta2)./2.*t4.^2; y2=sind(theta1)/2.*t2.^2+sind(theta1).*t2.*(t3+t4)+sind(theta2)./2.*t4.^2; v2=[cosd(theta1)*t2+cosd(theta2)*t4;sind(theta1)*t2+sind(theta2)*t4]; V=vecnorm(v1'-v2); P=vecnorm([x1;y1]-[x2;y2]); cmds=[theta1,t1,t2,theta2-theta1,t3,t4,tf]; fprintf('Turn %.2f degrees in %.2f seconds\nAccelerate for %.2f seconds\nTurn %.2f degrees in %.2f seconds\nAccelerate for %.2f seconds\nMission Time: %.2f seconds\n\n',cmds); fprintf('x1=%.2f, x2=%.2f\ny1=%.2f, y2=%.2f\nv1=[%.2f %.2f], v2=[%.2f %.2f]\nV=%.2f\nD=%.2f\n',x1,x2,y1,y2,v1,v2,V,P); ``` Explanation: My methodology is to start by assuming the total mission length \$t\$ starting from 0 (in the case where we already fit the parameters at \$t\$=0) and apply a standard mission profile. The mission has 4 stages: 1. turn towards where the target will be at time \$t\$ 2. accelerate towards the target 3. turn to an angle that will cancel velocities so that we are within parameters by time \$t\$ 4. accelerate for the remaining time Using this profile, there are 4 time values to be concerned about. \$t\_1\$ is the first turn, \$t\_2\$ is the first burn, \$t\_3\$ is the second turn, and \$t\_4\$ is the last burn. \$t\_1\$ is known since the initial angle can be easily calculated. \$t\_2\$ and \$t\_4\$ are calculated as percentages \$a\_1\$ and \$a\_2\$ of \$(t\_2+t\_4)\$, in order to reduce them to \$a\_1(t\_2+t\_4)\$ and \$(1-a\_1)(t\_2+t\_4)\$, thus making both values a function of \$a\_1\$. \$t\_3\$ is a function of the second turn angle \$\theta\_2\$. The next thing is to calculate the x and y positions and velocities at time \$t\$ as a function of \$a\_1\$ and the second angle \$\theta\_2\$, the only other unknown. I know that these are limited to a specific range of 0:1 and -360:360 respectively, so I calculate all possible positions as a function of \$a\_1\$ and \$\theta\_2\$ and find the first one that fits the criteria. If none fit, then \$t\$ is increased by 0.01 and the process is repeated. This method takes advantage of the vectorized computing capabilities of MATLAB. And honestly, it's probably the first code golf challenge where MATLAB is more ideal. I also have some test code that has all of the test cases already, and times it as well according to your scoring criteria. Since the output of the program is the total mission time, and tic/toc calculates time since tic was called at time toc, this calculates the score as well. % % Test Intercept\* \*edited so that toc comes after the function call, so that time is calculated after the function finishes and not before. Oversight on my part. ``` tic (Intercept([10,0], [0,0])*toc)^2; tic (Intercept([6,-3], [0,0.5])*toc)^2 tic (Intercept([-2,8], [0.1,-0.2])*toc)^2 tic (Intercept([5,5], [0.3,0.3])*toc)^2 tic (Intercept([15,18], [0.1, 0.3])*toc)^2 tic (Intercept([20,5], [0.2,-0.2])*toc)^2 ``` ]
[Question] [ Consider an array `A` of length `n`. The array contains only integers in the range `1` to `s`. For example take `s = 6`, `n = 5` and `A = (2, 5, 6, 3, 1)`. Let us define `g(A)` as the collection of sums of all the non-empty contiguous subarrays of A. In this case `g(A) = [2,5,6,3,1,7,11,9,4,13,14,10,16,15,17]`. The steps to produce `g(A)` are as follows: The subarrays of A are (2), (5), (6), (3), (1), (2,5), (5,6), (6,3), (3,1), (2,5,6), (5,6,3), (6,3,1),(2,5,6,3), (5,6,3,1), (2,5,6,3,1). Their respective sums are 2,5,6,3,1,7,11,9,4,13,14,10,16,15,17. In this case all the sums are distinct. However, if we looked at `g((1,2,3,4))` then the value 3 occurs twice as a sum and so the sums are not all distinct. **Task** For each `s` from 1 upwards, your code should output the largest `n` so that there exists an array A of length n with distinct subarray sums. Your code should iterate up from `s = 1` giving the answer for each `s` in turn. I will time the entire run, killing it after one minute. Your score is the highest `s` you get to in that time. In the case of a tie, the first answer wins. **Examples** The answers for `s = 1..12` are `n=1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 8, 9`. **Testing** I will need to run your code on my ubuntu machine so please include as detailed instructions as possible for how to compile and run your code. **Leaderboard** * **s = 19** by Arnauld in **C** [Answer] # [C (gcc)](https://gcc.gnu.org/), s = 19 This is basically a port of my Node.js answer. It goes one step further with the default compiler options and two steps further with `-O2` or `-O3`. ``` #include <stdio.h> #include <string.h> #include <stdint.h> void search(uint8_t * arr, int n, uint8_t * sum, int * max, char * str, int depth) { int i, j, k, s; char tmp[16]; // do we have a better array? if(depth > *max) { for(str[0] = '\0', i = 0; i < depth; i++) { sprintf(tmp, "%d ", arr[i]); strcat(str, tmp); } *max = depth; } // try to append i = 1 to n to the current array for(i = 1; i <= n; i++) { // provided that doing so does not produce a sum that was already encountered if(!sum[i]) { for(sum[s = i] = 1, j = depth; j && !sum[s += arr[j - 1]]; j--) { sum[s] = 1; } if(!j) { // this is valid: set the value in arr[] and do a recursive call arr[depth] = i; search(arr, n, sum, max, str, depth + 1); } // whether the recursive call was processed or not, we have to clear the flags // that have been set above for(sum[s = i] = 0, k = depth - 1; k >= j; k--) { sum[s += arr[k]] = 0; } } } } int solve(int n, char * str) { int max = 0; // best length so far int hi = n * (n + 1) / 2; // highest possible sum for n uint8_t sum[hi + 1]; // encountered sums uint8_t arr[n]; // array memset(sum, 0, (hi + 1) * sizeof(uint8_t)); search(arr, n, sum, &max, str, 0); return max; } ///////////////////////////////////////////////////////////////////////////////////// void main() { char str[128]; int n, res; for(n = 1; n <= 19; n++) { res = solve(n, str); printf("N = %d --> %d with [ %s]\n", n, res, str); } } ``` [Try it online!](https://tio.run/##dVRtbhoxEP3PKSZUSZawNJBKVdoN9AbtAciqMruGNVm8yDbQtOLqpW/GfEbpCmF7PJ9v3rjozYpit/tgbFGvSk1PPpSm@ViNWuciZ@zsraw0NrCstW5MSV4rV1TJCsLHn4HuSDmXEk5kUzpJ/WoRpXe0UL9SKirlWBz2yqVehqpDf1okR5PSPKWXlHwGiSiHxXI8@JxnLQju76lsaKOpUmtNiiY6BO04tHr9xi6miTikEd0hXPRLNG1cgojjfk5Dun3u3yI2dv0My1NMAdtu96BP5JdAIEwTBE@pfV1SO@UoY5N3soNKcIUKiVQCtb18K/8cHAGi5xZLY/LBvVJoSC2X2paSw4DPlv9CpalYOacBgxTUiomLlmQ6JHuRJhwuXbM2pS5hrQBmg7aRb7DRnmwT@L5cFQwVGhGVNsqTqp1W5StpWzQrCwh1KR6B3xUUucwjFAIeZB55GAZwgB4di8P25oauokJ3KCDNqUeDPMddr3fyQyRK4uGA4Xa/ctz5uSpjVRlP@K1Vbcqv4FsQiHBcaXBFIuWkgCMoochpgOcNaFGouj46Yi3JlOOa7JRLpK@QFoQVmgpBpZ@RRF0adN5misQ2lUYiTrK5jCrYAvJCe4@eNI57kB75iiYXtVbRclqrmW@dVYvWiNZEayvVqkmz1v9rQh9TcmgCw53hOBrSHOs7oB8685KL7WVRWyEoKMoD6Jt6rZP9GJ@G9TSh/EV2Y3wuPlQx0T5Qre0MSYGGU@XOrCpmsoW/xAq0dE8PGVtVZlax4bLx3kxqLVydMnqwPjwlXAc8wDDPLmKecZiV/JkNl2zzN2myTZwvaC70AlAn0n5AmsQIHS7a/NbN9PC@dYQI75Hm5sSafkceKafDylkGKWttd/JYLpSxScRQMOXHaPDwmGcHeODNaS/m3GobZ97yzA@@YHMaeqjhMrbJSuA9R/cvVvs7rvFg9XojXjYGrRjTtc@fbTvdxzmZoe@7v4Vwcdf78ekf "C (gcc) – Try It Online") [Answer] # [Node.js](https://nodejs.org), s = 17 Just a simple recursive search to get the ball rolling. Returns both the length and a valid array. ``` solve = n => { var max = 0, // best length so far best, // best array so far sum = {}; // encountered sums (search = a => { var i, j, k, s; // do we have a better array? if(a.length > max) { max = a.length; best = [...a]; } // try to prepend i = 1 to n to the current array for(i = 1; i <= n; i++) { // provided that doing so does not produce a sum that was already encountered if((sum[j = 0, s = i] ^= 1) && a.every(n => sum[j++, s += n] ^= 1)) { search([i, ...a]); } // reset the flags that have been toggled above for(sum[s = i] ^= 1, k = 0; k < j; k++) { sum[s += a[k]] ^= 1; } } })([]); return [ max, best ]; } ``` [Try it online!](https://tio.run/##VVPNcqJAEL77FH1KsEATT3sgMW@wL0C5VS20gCEz1syIa6V4dvfrAVbjgRm6v5n@fvDIPfvStaewMraS283brhd6J0PvW/peEPXs6Iv/ovSaEb280F58oE5MHRrylg7sgNKfNrK4m1HsHF9/gvz5C1d9D7mCxJT2bII4qbThFwAlXtiVDUA8UxhJtBkdM/rMyOeLxTSlsnQRahiUGSMDrhqHfkREe0h4PVHdqorldB9NkuZu/iAB5WK9XvNuLA7/hwV3pWDp5OQkpqIWwI0WjD5CI1SenRMzyY6nDtYlEZcD/gZXsabpnQVuPTnbtxUMCA0HCGpNrY5VVjwZG7RfnUvVp9ZF0IU9ceeEq@ujhdOdEJ0AWhzHyDyWdkd/QGJJT0@QLL24axIDjrg0VVQKdhPszg95xTSSAu5HU5azVcNdghMvITpw6Lj2I8kYyl5E3anrDgJ5b3uZTqkxOvyBHbJVxjmWNzpieTQqfjhFZMnF52488ZOKPodlUihFbJ2EszNUaNLZGCwSHW76KZlMOQOmNMyYj9F8Nr@wmecCglb8QyQm6i6twausO1snz7/RfKYUB1Osq9U2vuFQ8bqLpUuLz26ubZTWcPsH "JavaScript (Node.js) – Try It Online") ]
[Question] [ Recursively define a "valid arithmetic expression": 1. Any natural number is a valid arithmetic expression. 2. If `s` is a valid arithmetic expression, then so is `(-s)`. 3. If `p` and `q` are valid arithmetic expressions, then so is `(p+q)`. In the above, a "natural number" is recursively defined as follows: 1. `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` are natural numbers. 2. If a natural number `n` is not `0`, then `n0` `n1` `n2` `n3` `n4` `n5` `n6` `n7` `n8` `n9` are natural numbers. Alternatively, via the regex `/^(0|[1-9][0-9]*)$/` Examples of valid arithmetic expressions: ``` 0 314 (-7) (0+0) (314+(-314)) ``` Examples of invalid arithmetic expressions: ``` 01 -5 5+10 ``` --- The challenge is to **print every valid arithmetic expression line by line**, i.e. create a program that will output strings line by line with the constraint that every valid arithmetic expression is eventually printed, and that no invalid arithmetic expression is ever printed. The valid arithmetic expressions can be printed more than once. The challenge is to do so in as few bytes as possible, since this is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"). [Standard loopholes](https://codegolf.meta.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default) apply. [Answer] # [Jelly](https://github.com/DennisMitchell/jelly), ~~...~~ 33 bytes ``` ⁾()j p`j”+Ç$€;;”-;ÇƊ€;®‘©¤Ṅ€ WÇ1¿ ``` [Try it online!](https://tio.run/##y0rNyan8//9R4z4NzSyugoSsRw1ztQ@3qzxqWmNtDWTrWh9uP9YF4h1a96hhxqGVh5Y83NkC5HOFH243PLT//38A "Jelly – Try It Online") Wow, writing a correct submission is **hard**. --- Python pseudocode equivalent: ``` import itertools # Jelly: ⁾()j def wrap_in_parentheses(x): return str(x).join(['(',')']) # or equivalently, `return '('+str(x)+')' # Jelly: p`j”+Ç$€;;”-;ÇƊ€;®‘©¤Ṅ€ register = 0 def expand_and_print(expressions): # Jelly: p` result = list(itertools.product(expressions, repeat=2)) # Jelly: j”+Ç$€ result = [wrap_in_parentheses('+'.join(expr)) for expr in result] # Jelly: ; result.extend(expressions) # Jelly: ;”-;ÇƊ€ result.extend([wrap_in_parentheses('-'+expr) for expr in expression]) # Jelly: ;®‘©¤ global register register += 1 result.append(register) # Jelly: Ṅ€ for expr in result: print(expr) return result # Jelly: WÇ1¿ expressions = ['0'] while 1: expressions = expand_and_print(expressions) ``` [Answer] # JavaScript ES6, 79 bytes ``` for(x=[n=0];;++n)x.map(i=>x.map(j=>x.push(n,`(-${i})`,`(${i}+${j})`))+alert(i)) ``` [Answer] # Python, 241 bytes ``` g=lambda n,s=0:s<6 and(l+r for x in(["\x13 8"]+list("I-x</"))[s]for a in range(n)for l in g(a,ord(x)%12)for r in g(n-a,ord(x)//12))or[]if n^1else s>7and["(-)+"[s-8]]or list("0123456789"[s==7:])*(s%6<2) i=1 while i:print("\n".join(g(i)));i+=1 ``` This isn't too short, but it's a table-driven approach that's semi-automatically generated from a CFG I wrote for this language. It's unreasonably fast (speed sacrificed for bytes) :) ]
[Question] [ **This question already has answers here**: [List all multiplicative partitions of n](/questions/104707/list-all-multiplicative-partitions-of-n) (15 answers) Closed 6 years ago. # The challenge Given positive integer input `n` (`n>1`), calculate the array of unique factorizations of `n`, not including `1`. Order does not matter. ## Test cases ``` 2 => [[2]] 3 => [[3]] 4 => [[4],[2,2]] 5 => [[5]] 6 => [[6],[2,3]] 7 => [[7]] 8 => [[8],[2,2,2],[2,4]] 9 => [[9],[3,3]] 10 => [[10],[2,5]] 11 => [[11]] 12 => [[12],[3,4],[3,2,2],[2,6]] ``` ## Scoring This is code-golf, so lowest byte count wins! [Answer] # Pyth, 9 14 bytes ``` {mS*Mds./M.pP ``` [Try it online!](http://pyth.herokuapp.com/?code=%7BmS%2aMd.%2FP&test_suite=1&test_suite_input=2%0A3%0A4%0A5%0A6%0A7%0A8%0A9%0A10%0A11%0A12&debug=0) ### How it works ``` {mS*Mds./M.pP P Prime factorization of [the input] .p All permutations of the prime factorization ./M All partitions of each permutation s Flattened by one level m For each partition: *Md Take the product of each piece S Sort the products { De-duplicate. ``` [Answer] # [Jelly](https://github.com/DennisMitchell/jelly), 10 bytes ``` ÆfŒṖP€€Ṣ€Q ``` [Try it online!](https://tio.run/##y0rNyan8//9wW9rRSQ93Tgt41LQGiB7uXAQkA////28BAA "Jelly – Try It Online") ``` ÆfŒṖP€€Ṣ€Q Æf - prime factorization ŒṖ - all partitions P€€ - Product of each sub-partition Ṣ€ - Sort each Q - Remove duplicates ``` ]
[Question] [ I have an expression that could be expressed as either of : ``` a += (A ? B ? x : C ? y : D : D); a += (A && B ? x : A && C ? y : D); ``` where A,B,C are expressions of 5-10 bytes each, and x and y are single character literals (3-4 bytes). D is another chain of ternaries (without the branching problem). I'm getting stuck trying to eliminate the duplication of D or A. If I was using `if`, it would be something like this: ``` if (A) if (B) x else if (C) y else D ``` Obviously I could do `((z=A) && B ? x : z && C ? y : D)`...but any other more creative suggestions? The actual code looks something like: ``` if (r%4<2&&r>3&&c<22&&c>1) if ((i-r)%8==6) '\\' else if ((i+r)%8==1) '/' else ``` D is something like: ``` (i+r) % 8 == 3 ? '/' : (c-r+16) % 8 == 4 ? '\\' : ``` [Answer] If you know that `x` and `y` cannot contain [falsy values](https://developer.mozilla.org/en-US/docs/Glossary/Falsy), as your code examples suggest, you can do the following to eliminate duplicate evaluation of `A` or `D`: ``` a += A && (B && x || C && y) || D; ``` Demo code and test cases in the following snippet: ``` // return x test(1,1,0); // A and B test(1,1,1); // A and B (and C) // return y test(1,0,1); // A and C // return D test(0,0,0); // test(0,0,1); // C test(0,1,0); // B test(0,1,1); // B and C test(1,0,0); // A function test(A, B, C) { var x = 'x', y = 'y', D = 'D'; a = A && (B && x || C && y) || D; expected = (A && B ? x : A && C ? y : D); var ws = ' '; console.log( [ A && 'A' || ws, B && 'B' || ws, C && 'C' || ws ].join(ws), ' ==> a = ' + a, a === expected ? 'Passed' : 'Failed, expected ' + expected ); } ``` Otherwise, if falsy values are possible, you could do this: ``` a += [D, x, y][A && (B && 1 || C && 2) || 0]; ``` Demo code and test cases in the following snippet: ``` // return x test(1,1,0); // A and B test(1,1,1); // A and B (and C) // return y test(1,0,1); // A and C // return D test(0,0,0); // test(0,0,1); // C test(0,1,0); // B test(0,1,1); // B and C test(1,0,0); // A function test(A, B, C) { var x = false, y = 0, D = ''; A = !!A; B = !!B; C = !!C; a = [D, x, y][A && (B && 1 || C && 2) || 0]; expected = (A && B ? x : A && C ? y : D); var ws = ' '; console.log( [ A && 'A' || ws, B && 'B' || ws, C && 'C' || ws ].join(ws), ' ==> a = ' + xyD(a, x, y, D), a === expected ? 'Passed' : 'Failed, expected ' + xyD(expected, x, y, D) ); } function xyD(result, x, y, D) { return result === x ? 'x' : result === y ? 'y' : result === D ? 'D' : '<error>' ; } ``` [Answer] Since short-circuiting is not required here, you can also do: ``` d=D;a+=A?B?x:C?y:d:d; ``` If short-circuiting were required, since your `B` and `C` are truthy values, you can do: ``` a+=(A?B?x:C?y:0:0)||D; ``` If short-circuiting were required and your `B` and `C` are not truthy values: ``` d=_=>D;a+=A?B?x:C?y:d():d(); ``` ]
[Question] [ # Introduction You have to simulate playing golf over an input string that represents the green. The 2-character substring `()` represents the hole, and is guaranteed to appear only once in the string. This is a sample green: ``` ABCDEFGHIJKLM()NOPQRSTUVWXYZ ``` The simulation consists of outputting the characters that the ball falls on after a series of hits that are also passed to your function. Each hit is represented by a positive integer indicating how many characters the ball will travel, relative to previous position. # Example The following input results in the output `G(o)`. ``` 7,7,ABCDEFGHIJKLM()NOPQRSTUVWXYZ ``` ### Explanation The input represents two hits of length 7. The output is a string of characters, showing the intermediate positions of the ball. The ball starts to the left of the string, and travels 7 characters to the right, landing on the `G`. As such, that character is the first part of the output. Then the ball is hit for the second time, and it lands in the hole. In this case, the hole is output with the ball inside, like this: `(o)`. ``` 9,7,1,ABCDEFGHIJKLM()NOPQRSTUVWXYZ I(o)N ``` The output represents the characters the ball has landed on in the same order as in the string. # Notes 1. The width of the hole is 2. If the ball lands on either parenthesis, the hole is hit. 2. The direction of the hit is always towards the hole, so when the ball ends up to the right of the hole, the next hit will cause the ball to move to the left (and vice versa). 3. The ball might not reach the hole, in which case the position of the ball after the last hit must be output next to the character (in the direction of the hole) the ball is on at the end of the hits. The hole is still included in the output. > > example: > > > > ``` > 28,26,ABCDEFGHIJKLM()NOPQRSTUVWXYZ > B12()Z > > ``` > > First 28 hit lands on Z at the right of the hole , next 26 hit is as > always thowards the hole (left) and lands on B. No more hits left so > the distance to the hole (12 characters) is shown next to B > > > 4. If the hits cause the ball to leave the green at some point, discard all remaining hits, and prepend `^` if the ball exits the green to the left, and append `$` if the ball leaves the green via the right side. 5. There might be hits after the putt, in which case those should be discarded, and the hole in the output should not contain an `o`, but an `X`. # Test cases ``` 15,10,3,TOURING()MACHINE I(o)N 7,HOLEIN()NE (o) 9,7,1,ABCDEFGHIJKLM()NOPQRSTUVWXYZ I(o)N 7,7,ABCDEFGHIJKLM()NOPQRSTUVWXYZ G(o) 28,26,ABCDEFGHIJKLM()NOPQRSTUVWXYZ B12()Z 2,25,26,27,ABCDEFGHIJKLM()NOPQRSTUVWXYZ AB()Y13Z 1,1,6,SH()RT SH()$ 2,4,6,TOO()HARD ^O()H 4,8,1,3,3,3,3,3,TAKEIT()ASITCOMES E(X)IT ``` You have to write a program or function wich accepts a series of positive numbres representing the hits and a [A..Z] string with one hole "()" representig the green. Make clear if your input format is different form `7,7,ABCDEFGHIJKLM()NOPQRSTUVWXYZ` This is code golf, so the submission with the smallest amount of bytes per language wins! [Answer] ## Python 2 - 380 bytes [Try it online](https://tio.run/nexus/python2#TVDLboMwELz7Kyyrke0YIsihqiAbqc@Ylr5pmxa5UspDoU0AGbj211NDFKk3e2dndmZ2ARRl3bWMowRsFy0giBOFAtiualaUrRXEXqI46kADISiEuFPjTVayBUcShsekqTdFyyijPHbMahhLTwpXAWWcohRc1ICDckOffFdFifJK4zUuShx4CDcCXD8RsB6nfgrMtWyXx9JOZo7yI8hZyBEucixnkMykmHod0IqaQQPD8YBnmyajS@p/6Wz1M@warmfMfhIR/Z/O964NFAlyRA5QaOLCos/cKxlHWzDnDeM3xf0EJ7Y0vfQS6dzxjFXzCSHsaxFx02q25UoYFU/5em@41qY4rHGlGRk1nIw6PiRnPXpoi1POd7t4emJNjy1yenZ@cXm1kMH1TXjL@N39w@PTc/Ty@rZ8/yDqDw) Shorter answer, thanks to @ovs. This one requires list of integers and string as input. Example: 28,26,"ABCDEFGHIJKLM()NOPQRSTUVWXYZ". Check edits for older version, that accepts plain string like "28,26,ABCDEFGHIJKLM()NOPQRSTUVWXYZ" ``` I=input() c=-1 G=I[c] I=map(int,I[:c]) u=r="" L=[u]*len(G) H=len(G.split('(')[0]) L[H:H+1]='()' d=1 s=0 f="".join for h in I: s+=1;c+=h*d;d=(1,-1)[H-c<0];T=f(L) if H<=c<H+2:u='o'if s==len(I)else'X';break if c<0:r="^"+T;break if c>len(G):r=T+"$";break L[c]=G[c] else: m=H-c if~d else c-H-1 if d>0:c+=1 L=L[:c]+[str(m)]+L[c:];r=f(L) print r or("%s)"%u).join(f(L).split(')')) ``` Explanation (for older version, but approach is same): ``` I=input().split(',') # split input G=I[-1] # last element - Green I=map(int,I[:-1]) # convert all other (hits) to int L=[""]*len(G) # empty list of same length as Green, used to ouput H=len(G.split('(')[0]) # index of hole L[H]='(' # hole is always printed L[H+1]=')' c=-1 # current index on Green d=1 # direction of hit u=r="" # strings for output and in-hole marker (X)/(o) s=0 # number of current hit for h in I: s+=1 c+=h*d # move current by hit * direction d=(1,-1)[H-c<0] # calculate new direction T="".join(L) # used to remove code duplication if H<=c<H+2: # if in hole u='o'if s==len(I)else'X' # check whether it is last hit or not break if c<0: # if out of Green on the left r="^"+T # add '^' and join all visited indices break if c>len(G): # if out of Green on the right r=T+"$" # add '&' after join all visited indices break L[c]=G[c] # mark visited index else: # rare occasion of for-else construction - executes if never break out of loop # which means, that we are out of hits and not in hole m=H-c if~d else c-H-1 # calculate distance to hole if d>0: c+=1 L=L[:c]+[str(m)]+L[c:] # expand L list with distance r="".join(L) # join list t="".join(L).split(')') if r: print r # ouput r in all cases exept in-hole else: print t[0]+"%s)"%u+t[1] # output for in-hole cases ``` [Answer] # [Röda](https://github.com/fergusq/roda), ~~308~~ 299 bytes ``` f g{a=indexOf("()",g)g=g[:a].."oo"..g[a+2:]o=[""]*#g s=""e=""i=-1{|j|o[i]="X"if[i>=a,i<=a+1]else{i+=j if[i<a]else i-=j if[i>a+1] {s="^";[]_}if[i<0]else{e="$";[]_}if[i>=#g]else o[i]=g[i:i+1]}}_ o[i].=s..a-i if[i<a,i>=0] o[i]=i-a-1..o[i]if[i>a+1,i<#g] [s..o[:a]&""..`(${o[a:a+2]&""})`..o[a+2:]&""..e]} ``` [Try it online!](https://tio.run/nexus/roda#hY9db5swGIWvw6@w3GrCi/EC/UjH6kgsZYW2CVtCt26Wl1qNQa42qAIXlQi/PXuh3Xq3yrJkP@ec92OXobxR3BRr/ZhkNrYJpjnJeS58JRnDZYkZy4Uaer4sucBYvt3LrYpjrOEa7rjN9n5bCiM5vsEmE2bCFTWnXA1dqX9VujFDfo864VT1ABnnGUw6j9VAsZ/4g5CrtneNnmJQfv@FTvhe/pTuW@XC@AbCbbuyOsB4xZhyzHMfCv6R7BVuHOW4jHXvvz1hPKhmiarDsOYbDDve2vtNKZQPm3agJbed2u/d61q2u9/KFKixBlm5QbWu6tWdgonWpTUY1HeIv7B3mOIeCt9xJdqiB7WpdFzUOtcbtAKQ2SCCRsD2sDFFjTAk1mWhrXbnHlF3RA9omlwv4vm5TWbBNIrnoTWmUXIVxnObwOc9HVOXBh@nZ@Gn8yi@uLyaAU8@f1ks0@uv326@/wD/@P8G74R6x69YqHfUmbxXSrkwzDFdRjZZpBA6hM8YNkhsEgWLM@uQnoDh4N9Jg8swTm0SLON0mszC5R8 "Röda – TIO Nexus") *Saved 8 bytes thanks to Kritixi Lithos!* Ungolfed: ``` function f(green) { /* find the hole */ hole := indexOf("()", green) /* replace () with oo in the green string */ green := green[:hole].."oo"..green[hole+2:] /* initializes the output array: contains an empty string for each yet unvisited place on the green */ out := [""]*#green start := "" end := "" i := -1 /* for each number in the stream */ for j do /* if the ball is in the hole, change the output to X */ if [ i=hole or i=hole+1 ] do out[i]="X" else /* add or subtract the number */ i+=j if [ i < hole ] else i-=j if [ i > hole+1 ] /* if the ball has left the green, stop looping */ if [ i < 0 ] do start = "^" break done if [ i >= #green ] do end = "$" break done /* add the visited character to the output array */ out[i] = green[i:i+1] done done /* add a number next to the last character visited */ out[i] .= ""..hole-i if [ i < hole and i >= 0 ] out[i] = i-hole-1..o[i] if [ i > hole+1 and i < #green ] /* return the output */ return start..out[:hole]&""..`(${out[hole:hole+2]&""})`..out[hole+2:]&""..end } ``` ]
[Question] [ The lambda calculus is a system of functional programming. Lambda calculus consists of variables, abstractions, and applications. A variable is simply a name denoting a function parameter. It is a single letter. An abstraction is a "function literal" of sorts, it consists of a backslash `\` followed by a variable name, and then an expression, which is the function body. For example, the function `\x.x` is a function which takes an argument `x` and returns `x`, a.k.a. the identity function. Abstractions can also return other abstractions. For example, `\x.\y.x` is a function which takes an argument `x` and returns a new function that returns `x`. There is also application. In application, you remove the header on the first value and substitute all instances of the function's argument with the value it is applied to. For example, to apply `\x.xx` to `\y.y`, substitute all `x`'s with `\y.y`'s, yielding `(\y.y)(\y.y)` (Parenthesis may need to be added for clarification.) Applications are denoted in an expression by writing the two values next to each other, where the first is the function to apply and the second is the argument to apply to. For example, you can write `xy` to apply x to y. However, you may need parenthesis (for example in `a(bcd)` or `y(\x.xx)`. The first lambda calculus notation is the one I just described. ``` \f.(\x.xx)(\x.f(xx)) ``` The second lambda calculus notation does not need parenthesis. It matches the following grammar: ``` <expression> ::= <variable> || <abstraction> || <application> <abstraction> ::= "\" <variable> <expression> <application> ::= "`" <expression> <expression> ``` Here, a `<variable>` can be any uppercase or lowercase letter. This is an example of an expression in the second notation: ``` \f`\x`xx\x`f`xx ``` Your task is to write a program that takes a lambda calculus expression in the first notation and outputs it rewritten in the second notation. ## Specifications * Every variable name is 1 letter. * Abstractions in the first notation go as far as possible, and application goes left to right: `d(abc) -> `d``abc`. * You do not have to deal with free/bound variables and scoping. ## Test Cases ``` \a.a -> \aa (\x.xx)(\x.xx) -> `\x`xx\x`xx \x.\y.\z.xz(yz) -> \x\y\z``xz`yz (\S.\K.SKK)(\x.\y.\z.xz(yz))(\p.\q.p) -> ``\S\K``SKK\x\y\z``xz`yz\p\qp ``` [Answer] ## Haskell, ~~211 197~~ 186 bytes (Saved 10 bytes by using `interact` as suggested by @Challenger5, and one more by not having a final newline.) ``` m(')':r)=([],r) m s|(a,u)<-e s,(b,v)<-m u=(a:b,v) f s|(a,r)<-m s=(tail(a>>"`"):a>>=id,r) e('\\':v:_:s)|(a,r)<-f s=('\\':v:a,')':r) e('(':s)=f s e(v:s)=([v],s) main=interact$fst.f.(++")") ``` Initially I had a function to perform the whole transformation, but now that is inlined into the `main` function which makes it a complete program. Dealing with a complete program instead of using a function `String -> String` at the interpreter also avoids the need to type and read double backslashes. The other functions follow the (simplified) pure functional parsing pattern of returning a parsing result and the unparsed rest of the string. `f` parses a list of expressions (possibly a multiple application) . It uses a helper function `m` that also parses a list of expressions and has a list of parses as result. `e` handles the remaining cases: lambdas, parenthesized expressions, and variables. Instead of generating a parsing tree, we directly generate the desired output. [Try it online!](https://tio.run/##NU7RDsIgDHzfVyzEhDbDfQARf2QsigqRuO0BGNmD/47F6Uvvrr1r@zTxZaeplBk4chlQwTCKgM3cxjcYseLpaNso4CYy0bldFRhZReN2R/i2o4Jk/ATmfGZXhpJQ@UddZIFrzWWWFxnxH3A18OsbsV@uTuBkUjQlkSuFIY8i0jvGL8ovyQZzTwcXU@966DqGDEvRxPXWbxtSdUD4AQ "Haskell – Try It Online") Using `interact` ruined clean I/O behaviour. If you don't use the TIO link but run it at the command line of your computer, you have to make sure that there is no trailing whitespace, it would be treated like a variable. You can do something like `echo -n '\f.(\x.xx)\x.f(xx)' | ./prog`. Alternatively, you could replace the last line by the previous version `main=getLine>>=putStrLn.fst.f.(++")")`. ]
[Question] [ Assume you're writing in one method, (or whatever you call them) with 3 inputs: the first string, a character that contains a `+`, `-` or `*` symbol, and the second string. Example in Java: ``` public String strCalc(String str1, char sym, String str2) { //code... } ``` What it should return: ``` str1 sym str2 ans A + A = B A + B = C B + B = D Z + A = AA W + B = Y A - A = ' ' (Space Character) A - B = -A A - C = -B B - A = A CA - A = BZ A * A = A B * B = D ``` Think of a one-indexed base 26. Then convert the numbers back to letters based on their position in the alphabet. ``` 0 = ' ' (Space Character) 1 = A 2 = B 3 = C 4 = D 5 = E 6 = F 7 = G 8 = H 9 = I 10 = J 11 = K and so on... ``` This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest code in bytes not including the method declaration wins. [Answer] # [Jelly](https://github.com/DennisMitchell/jelly), ~~64~~ 63 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page) ``` Aḃ26ịØA O_64»0ḅ26 e”-NḤ’×Ç ³Ç;“*×-_”y⁴¤;⁵ǤV ¢<0”-x;¢1Ŀ¤ ¢⁶¢L¤? ``` Not a particularly clean solution; there are no 3 argument methods in Jelly, so this is a full program. Accepts negative inputs like `"-A"`, `"- A"`, `" -A"`, ... (note however `"--A"` is treated as `"-A"`) Accepts zero inputs like `""`, `" "`, `" "`, ... **[TryItOnline](http://jelly.tryitonline.net/#code=QeG4gzI24buLw5hBCk9fNjTCuzDhuIUyNgpl4oCdLU7huKTigJnDl8OHCsKzw4c74oCcKsOXLV_igJ154oG0wqQ74oG1w4fCpFYKwqI8MOKAnS14O8KiMcS_wqQKwqLigbbCokzCpD8&input=&args=LUFC+Kw+LUNY)** ### How? ``` Aḃ26ịØA - Link 1, convert integer to absolute value string: i A - absolute value of i ḃ26 - convert to bijective base 26 (a list of integers in [1,26]) ị - index into (1-based) ØA - alphabet yield -> "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - (note: 0 will convert to an empty string here.) O_64»0ḅ26 - Link 2, convert an input string to a positive integer: s O - cast to ordinal (vectorises) _64 - subtract 64 from each (A->[1], B->[2], ..., AZ->[1,26], ...) »0 - maximum of that and zero ("-" and space become zeros; vectorises) ḅ26 - convert from base-26 to an integer (26 place values still work) e”-NḤ’×Ç - Link 3, convert an input string to an integer: s ”- - literal '-' e - exists in s? N - negate Ḥ - double ’ - increment (if "-" was in s we have -1, else we have 1) × - multiply by Ç - call last link (2) as a monad ³Ç;“*×-_”y⁴¤;⁵ǤV - Link 4, evaluate the operation: niladic ³ - first program input Ç - call last link (3) as a monad (value of first input as an integer) ; - concatenate with ¤ - nilad followed by link(s) as a nilad ⁴ - second program input y - map characters “*×-_” - literal "*×-_" - change "*" to "×" and "-" to "_" ; - concatenate with ¤ - nilad followed by link(s) as a nilad ⁵ - third program input Ç - call last link (3) as a monad (value of 3rd input as integer) V - evaluate string as Jelly code (something like "-76×5" or "3_2") ¢<0”-x;¢1Ŀ¤ - Link 5, form output for non-zero results: niladic ¢ - call the last link (4) as a nilad (integer result) <0 - less than zero? ”- - literal '-' x - repeat ('-' if negative '' if positive or zero) ; - concatenate with ¤ - nilad followed by link(s) as a nilad ¢ - call the last link (4) as a nilad (integer result) 1Ŀ - call the next link (1) as a monad (as absolute string) ¢⁶¢L¤? - Main link: niladic (the program arguments expected however) ? - ternary if ¤ - nilad followed by link(s) as a nilad ¢ - call the last link (5) as a nilad L - length - True case (has length) ¢ - call the last link (5) as a nilad - False case (no length) ⁶ - literal ' ' ``` [Answer] ## Assembler x86 (32-bit) - 142 bytes The 142 bytes are the compiled size (not the source code size, which is larger). Note that for assembler the size of the compiled code is not dependend on the compiler used but it should always be 142 bytes. The calling convention is "\_cdecl" so you can call the function from C: ``` const char *strCalc(const char *num1, char operation, const char *num2, char *bufferEnd); ``` The function accepts negative inputs (such as "-AB") and zero (" "). However malformed inputs might crash the program! The last argument points to the LAST byte of a buffer used to store the sring because C does not support strings without pre-allocated buffers. The function returns the pointer to the string (somewhere in the buffer). The function may be called the following way: ``` #include <stdio.h> const char *strCalc(const char *num1, char operation, const char *num2, char *bufferEnd); main(int argc,char **argv) { char buf[21]; puts(strCalc(argv[1],argv[2][0],argv[3],buf+20)); } ``` Here is the actual function (Linux users: Replace "\_strCalc" by "strCalc"): ``` .globl _strCalc .text _strCalc: push %ebx push %esi push %edi mov 16(%esp), %esi call loadNum push %ebx mov 28(%esp), %esi call loadNum pop %eax # This assumes that the operation is ONLY +, * or -! cmpb $0x2B, 20(%esp) je isPlus jb isMultiply sub %ebx, %eax jmp calcDone isPlus: add %ebx, %eax jmp calcDone isMultiply: xor %edx, %edx imul %ebx calcDone: push %eax mov 32(%esp), %edi std xor %al, %al stosb pop %eax call writeOut mov %al, (%edi) mov %edi, %eax inc %eax pop %edi pop %esi pop %ebx # Needed due to MSVCRT.DLL bug! cld ret # Write EAX to the buffer # EDI points to the last character to be # written (the terminating NUL has already been written) # Returns: EDI pointer to the first character! writeOut: test %eax, %eax jnz notZero mov $0x20, %al stosb ret notZero: jns notNegative neg %eax call writeOut mov $0x2D,%al stosb ret notNegative: xor %edx, %edx dec %eax div %ecx xchg %al, %dl add $0x41, %al stosb xchg %al, %dl test %eax, %eax jnz notNegative xchg %al, %dl ret # Load number from string ESI points to to EBX # Destroys EAX, ECX, EDX # Allows negative and zero inputs! # Assumes syntactically correct numbers! # Sets ECX to 26 (needed later!) loadNum: xor %ebx, %ebx xor %eax, %eax mov $26, %al mov %eax, %ecx nextLoad: cld lodsb and $0xDF, %al jz endOfLoad sub $0x40, %al jc negativeInput xchg %eax, %ebx mul %ecx add %eax, %ebx jmp nextLoad negativeInput: call loadNum neg %ebx endOfLoad: ret ``` ]
[Question] [ **This question already has answers here**: [Tips for golfing in Lisp](/questions/79719/tips-for-golfing-in-lisp) (5 answers) Closed 5 years ago. What general tips do you have for golfing in Common Lisp? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to Common Lisp (e.g. "remove comments" is not an answer). Please post one tip per answer. [Answer] Use `'` (quote) as synonym for `""` for single words. Quote stops evaluation of symbol, allowing you to e.g. print it. Note that the casing is dependant on `*print-case*` variable (most of the time it's in the upcase). ``` (print"yes") (print'yes) ; saved a byte! ``` [Answer] # Use the best looping construct for the job Use looping constructs that are as short as possible - `loop for` is rarely the way to go: * `(dotimes(i <number>))` to loop a certain number of times * `(mapcan lambda list)` to map a list * `(mapcar lambda list)` to map and flatten a list * `(do((var1 initialvalue1 nextvalue1)(var2 initialvalue2 nextvalue2)...)((endcondition)returnvalue))` for more complex loops * `(map'string body list)` to map string -> string * `(map nil body list)` to iterate over a list ]
[Question] [ **EDIT:** The incorrect A rhomb substitution has been fixed. Apologies to anoyone who had started working on a solution. Consider the following substitutions, where the substituted rhomb(us) is scaled up and shown in red: **EDIT:** Note the anchor points (circle) created where a corner of each new rhomb touches the substituted rhomb. Also note the substitution's anchor point (black circle). **A rhomb (144°, 36°)** [![rhomb a](https://i.stack.imgur.com/hqh6l.png)](https://i.stack.imgur.com/hqh6l.png) ... becomes ... [![rhomb a subsitution 1](https://i.stack.imgur.com/RGxvu.png)](https://i.stack.imgur.com/RGxvu.png) **B rhomb (72°, 108°)** [![rhomb b](https://i.stack.imgur.com/7GQ2N.png)](https://i.stack.imgur.com/7GQ2N.png) ... becomes ... [![rhomb b substitution 1](https://i.stack.imgur.com/mQjFL.png)](https://i.stack.imgur.com/mQjFL.png) Each substitution is made up of some combination of A rhombs and B rhombs, on which the same substitutions can be performed. A tiling can be created by repeating the substitutions n times. After n=2 substitutions of A rhomb: **EDIT:** The substitution is oriented by aligning the rhomb's anchor point with the substitution's anchor point [![rhomb a substitution 2](https://i.stack.imgur.com/bPiRJ.png)](https://i.stack.imgur.com/bPiRJ.png) **In the fewest bytes of code (given input n>=0) draw the tiling after n substitutions, where n=0 is A rhomb** --- *Notes:* * *The red lines and anchor points shouldn't be included, they only illustrate the substitution.* * *In each substitution the tiling is scaled up so the rhombs have a constant size.* * *Any rotation is optional.* * *Graphical choices (colour, dimensions, cropping etc.) are optional if not exploited for loopholes.* [Answer] # Java, 881 bytes ``` import java.awt.image.BufferedImage;import static java.lang.Math.*;class J{BufferedImage o=new BufferedImage(999,999,1);java.awt.Graphics g=o.getGraphics();double v=2.5132,w=1.2566,p=PI,s=(p-v)/2,u=(p+w)/2;public static void main(String[]v){new J(Integer.parseInt(v[0]));}J(int i){d(609,391,v,p/4+s,500,i);try{javax.imageio.ImageIO.write(o,"png",new java.io.File("a.png"));}catch(Exception e){}}void d(int x,int y,double o,double q,double l,int r){int m=(int)(2*l*sin((p-o)/2)),a=(int)(x+cos(q)*l),b=(int)(y+sin(q)*l),c=(int)(x+cos(q+o/2)*m),d=(int)(y+sin(q+o/2)*m),e=(int)(x+cos(q+o)*l),f=(int)(y+sin(q+o)*l);if(r-->0){double n=l/(2*sin((v)/2));if(o>w){d(x,y,v,q-s,n,r);d(c,d,v,q+p+s,n,r);d(a,b,w,q+u,n,r);}else{d(x,y,w,q-s,n,r);d(c,d,w,q+p+s,n,r);d(e,f,w,q-p/2,n,r);d(a,b,v,q+p/2-s-s,n,r);}}else{g.drawLine(x,y,a,b);g.drawLine(a,b,c,d);g.drawLine(x,y,e,f);g.drawLine(c,d,e,f);}}} ``` ### Ungolfed ``` import java.awt.image.BufferedImage; import static java.lang.Math.*; class Q79373 { BufferedImage image = new BufferedImage(999, 999, 1); java.awt.Graphics graphics = image.getGraphics(); double aRad = 2.5132, bRad = 1.2566, pi = PI, aAcuteHalf = (pi - aRad) / 2, bRadHalfPi = (pi + bRad) / 2; public static void main(String[] v) { new Q79373(Integer.parseInt(v[0])); } Q79373(int i) { draw(609, 391, aRad, pi / 4 + aAcuteHalf, 500, i); try { javax.imageio.ImageIO.write(image, "png", new java.io.File("a.png")); } catch (Exception e) { } } void draw(int x, int y, double rad, double rot, double length, int recDepth) { int height = (int) (2 * length * sin((pi - rad) / 2)), a = (int) (x + cos(rot) * length), b = (int) (y + sin(rot) * length), c = (int) (x + cos(rot + rad / 2) * height), d = (int) (y + sin(rot + rad / 2) * height), e = (int) (x + cos(rot + rad) * length), f = (int) (y + sin(rot + rad) * length); if (recDepth-- > 0) { double lengthNew = length / (2 * sin((aRad) / 2)); if (rad > bRad) { draw(x, y, aRad, rot - aAcuteHalf, lengthNew, recDepth); draw(c, d, aRad, rot + pi + aAcuteHalf, lengthNew, recDepth); draw(a, b, bRad, rot + bRadHalfPi, lengthNew, recDepth); } else { draw(x, y, bRad, rot - aAcuteHalf, lengthNew, recDepth); draw(c, d, bRad, rot + pi + aAcuteHalf, lengthNew, recDepth); draw(e, f, bRad, rot - pi / 2, lengthNew, recDepth); draw(a, b, aRad, rot + pi / 2 - aAcuteHalf - aAcuteHalf, lengthNew, recDepth); } } else { graphics.drawLine(x, y, a, b); graphics.drawLine(a, b, c, d); graphics.drawLine(x, y, e, f); graphics.drawLine(c, d, e, f); } } } ``` ### Notes * The results arent 100% acurate thanks to integer precision. I used integers for the coordinates because `Graphics::drawLine` only takes integers as arguments, and I would've ended up with way more integer casts than I have now. * I'll probably golf a bit more later, still not optimal. ### Results ``` Full image filled ``` [![enter image description here](https://i.stack.imgur.com/fnOXI.png)](https://i.stack.imgur.com/fnOXI.png) ``` Recursion 1 ``` [![enter image description here](https://i.stack.imgur.com/DvJTl.png)](https://i.stack.imgur.com/DvJTl.png) ``` Recursion 2 ``` [![enter image description here](https://i.stack.imgur.com/XRbfg.png)](https://i.stack.imgur.com/XRbfg.png) ``` Recursion 3 ``` [![enter image description here](https://i.stack.imgur.com/HqIjV.png)](https://i.stack.imgur.com/HqIjV.png) ]
[Question] [ **This question already has answers here**: [Calculate the nth term of Golomb's self-describing sequence](/questions/8374/calculate-the-nth-term-of-golombs-self-describing-sequence) (21 answers) Closed 7 years ago. This used to be an old Computer Olympiad Question, not sure what the actual source was. Assume function `f`: * `f(1) = 1` * This `f(1), f(2), f(3), f(4), ...` sequence of numbers are in ascending order. * Number `n` has been repeated `f(n)` times Here is the sequence up to the fifteenth number: ``` n : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 f(n) : 1 2 2 3 3 4 4 4 5 5 5 6 6 6 6 ``` for example number `4` has been repeated `f(4) = 3` times. So what you should do is to print out the sequence till f(1000000). There are no inputs. Also you can run out of memory, not an issue! Code with less bytes wins. So this is how to output will look like: `1 2 2 3 3 4 4 4 5` ... [Answer] ## CJam (22 bytes) ``` 1{_~$(~$-)~$)}A6#(/]S* ``` [Online demo for only 15 terms](http://cjam.aditsu.net/#code=1%7B_~%24(~%24-)~%24)%7D15(%2F%5DS*) This relies on one of the formulae given in the entry for [OEIS A001462](http://oeis.org/A001462), and the use of `~$` to index the stack from the bottom. [Answer] # Ruby, 55 bytes Dynamic programming-style solution. Generates the table iteratively, and then prints the needed terms. ``` f,i=[0],0 f+=[i+=1]*(f[i]||i)while f.size<1e6 p f[1,1e6] ``` [Answer] # [MATL](https://esolangs.org/wiki/MATL), ~~25~~ 22 bytes ``` FTTQ`@2+yy)1X"!htn1e7< ``` [**Try it online**](http://matl.tryitonline.net/#code=RlRUUWBAMit5eSkxWCIhaHRuMWUyPA&input=) replacing `1e7` in the code by a more manageable number, such as `1e2` This initiallizes the sequence as `[1 2 2]`, and from that builds the rest of the sequence applying its definition. ]
[Question] [ A while ago, we had a [challenge](https://codegolf.stackexchange.com/q/52903/34438) related to antiferromagnetism (AF) in two dimensions. Now, on a 2-d square [lattice](https://en.wikipedia.org/wiki/Bravais_lattice), antiferromagnetic is antiferromagnetic, and that is all there is to it. Moving to [other lattice types](https://en.wikipedia.org/wiki/Crystallographic_restriction_theorem) or [higher dimensionality](https://en.wikipedia.org/wiki/Crystal_system), things get more [interesting](https://en.wikipedia.org/wiki/Geometrical_frustration#Magnetic_ordering). Here, we will explore the second route: magnetic order on the 3-d cubic lattice1. We will consider the following spin patterns, as illustrated in the figure. The cubes are repeated periodically in every direction (“periodic boundary conditions”). * *G-type* is the most straightforward generalization from 2-D AF: antiferromagnetic in all directions * *A-type:* antiferromagnetically coupled ferromagnetic planes * *C-type*: ferromagnetically coupled antiferromagnetic planes (a.k.a “checkerboard”) * *D-type:* criss-crossing stripes * *E-type* and *F-type:* “[ferrimagnetic](https://en.wikipedia.org/wiki/Ferrimagnetism) planes”? * *B-type* is ferromagnetic (FM) order ![7 types of magnetic of](https://i.stack.imgur.com/23djP.png) adapted from E. Dagotto, [*Nanoscale phase separation and colossal magnetoresistance*](https://books.google.at/books?id=rS7qCAAAQBAJ&lpg=PA1&ots=pk-kieGbqz&lr&pg=PA11#v=onepage&) # The challenge Your code should take a string as input specifying a magnetic order and a lattice plane, and output the spin arrangement on that plane, in the orientation specified below. Output should be “drawn“ in some sense: writing to STDOUT, graphical output, or similar; a function returning a string is not enough. You must support at least A-, C-, and G-type (the more familiar AF arrangements); B-, E-, and F-type may be supported optionally. Your score will be code length per order type supported. ## Input Input will be of the form `S (a b c)`, i.e., a token *S* specifying the order type, a space, and three integers *a,b,c* defining a lattice plane, enclosed in parentheses and delimited by spaces. The string *S* will be either “AF-*T*” with *T* ∈ {A, C, D, E, F, G} for the antiferromagnetic cases, or “FM” in the ferromagnetic case (B). We define the following coordinate system relative to the figure: the x-axis points to the right, the y-axis into the screen, and the z-axis upwards; the origin is the lower left front corner of the cube, and the lattice parameter (the side length of the cube) will be 1. For simplicity, exactly one of the integers *a,b,c* will be nonzero. The plane of projection is perpendicular to the corresponding axis and displaced from the origin by that number of unit cells.2 To get the proper orientation, look along the axis of displacement in positive/negative direction according to the displacement, and rotate such that the first in-plane axis (alphabetically: *y* for the *yz*-plane, *x* otherwise) increases to the right. Examples are given below. ## Output On the selected plane, the spins are arranged on a square lattice. Your code should draw 2×2 spins (the “magnetic unit cell”) on this plane, taking into account the periodicity and the proper orientation. ### A ↑ by any other name … Spin “up” and “down” are just names,3 and I do not want to limit your artistic freedom. Choose any (visually distinguishable) symbols for the spin directions you like, they only have to be consistent and laid out on a “square” lattice (as rectangular as necessary according to output format). You can use ASCII/Unicode art, graphical output, what have you. Leading or trailing white space does not matter. ## Examples of input, valid output, and orientation ``` A (0 0 1) C (1 0 0) D (0 0 2) E (0 1 0) F (0 -2 0) G (0 0 7) - - ↓ ↑ ud 0 1 -> -> 🔫 • - - ↓ ↑ ud 1 0 -> <- • 🔫 --> x --> y --> x ^ z --> x --> x | | | | | | V y V z V y --> x V z V y ``` # Scoring Your score is *B/O*, the length *B* of your code in bytes divided by the number of patterns *O* your code supports (*O* is between 3 and 7). Smallest score wins. In your answer, please indicate (i) code length, (ii) supported orders, and (iii) sample output, and (iv) the correspondence of your symbols with `+` and `-` in the figure, if yours are different. 1. Which is the analogue of the square lattice in three dimensions. The general term would be “hypercubic”. 2. They are a perverted variation of [Miller indices](https://en.wikipedia.org/wiki/Miller_index#Case_of_cubic_structures). 3. We are being strictly non-[relativistic](https://en.wikipedia.org/wiki/Spin%E2%80%93orbit_interaction) here. [Answer] # Octave, 809/7 ≈ 115.57 This is a reference implementation supporting all 7 order types (not quite, since it does not parse the input string), ungolfed. Output for all distinct inputs is available [for download.](https://app.box.com/3d-afm/) Assuming the implementation is correct, there are 13 distinct outputs, two of which are unique; one more occurs twice; all others at least four times. ``` format plus "+-." A = ones(2,2,2); A(:,:,2) = -1; B = ones(2,2,2); C(:,:,1) = [ 1 -1; -1 1]; C(:,:,2) = C(:,:,1); D(:,:,1) = [ 1 1; -1 -1]; D(:,:,2) = D(:,:,1)'; E(:,:,1) = [ 1 1; 1 -1]; E(:,:,2) = -E(:,:,1); F(:,:,1) = E(:,:,1); F(:,:,2) = [ 1 -1; -1 -1]; G(:,:,1) = C(:,:,1); G(:,:,2) =-G(:,:,1); function SP = afmproj(S, idx) dim = find(idx)(1); idx = idx(dim); sgn = sign(idx); idx = mod(idx, 2) + 1; switch dim case 1 SP = S(idx,:,:); flp = sgn==+1; case 2 SP = S(:,idx,:); flp = sgn==-1; case 3 SP = S(:,:,idx); flp = sgn==+1; endswitch SP = rot90(reshape(SP,2,2)); if flp SP = flipud(SP); endif endfunction function afmproj_pretty(Str, S, idx) printf('%s (%2i %2i %2i)\n', Str, idx); disp(afmproj(S, idx)); disp('') endfunction ``` [Answer] # Ruby Rev 1, 176/7 = 25.14 Problem with negative inputs fixed: `m>>9&2` shifts the characters by 2 when `m` is negative. Magic strings with non-ASCII characters proved problematic: they produced syntax errors. So I just compressed the data to a hexadecimal number instead. ``` a=gets.delete("()").split m=e=0 4.times{|i|m+=b=a[i].to_i;b>0&&e=i-1} 4.times{|c|print 0xFFF9935871769>>568-a[0].ord*8+(" j\204\316"[c-(m>>9&2)].ord>>e*3&7^m%2<<e)&1," "[c%2]} ``` # Ruby Rev 0, 174/7 = 24.86 work in progress. I just realized I missed a rule: I have to flip the output vertically when the input is negative. Once checked and clarified I will golf the magic strings / arrays down to single characters. ``` a=gets.delete("()").split m=e=0 4.times{|i|m+=b=a[i].to_i;b>0&&e=i-1} " j\204\316".bytes{|c|print [15,255,153,53,135,23,105][a[0].ord-65]>>(c>>e*3&7^m%2<<e)&1,c==106?"\n":''} ``` The first magic string contains 4 bytes, corresponding to the first, second, third and 4th symbol to be printed. Each is a 3-digit octal number indicating which bit of the data in the array should be displayed. The table looks like this. Note that the odd values differ from the even ones by a power of 2 so only the even values need be stored. Fortunately the z values never exceed 3, so it's possible to get the 3 octal digits into 1 byte. ``` nonzero digit x y z 02 45 01 even 46 01 23 13 67 45 odd 57 23 67 ``` **Output** I use 1 for +, 0 for - . I didnt bother with the output for B because it's just plain 1's. ``` A 1 0 0 11 00 A 2 0 0 11 00 A 0 1 0 00 11 A 0 2 0 00 11 A 0 0 1 00 00 A 0 0 2 11 11 C 1 0 0 01 01 C 2 0 0 10 10 C 0 1 0 01 01 C 0 2 0 10 10 C 0 0 1 10 01 C 0 0 2 10 01 D 1 0 0 00 10 D 2 0 0 11 10 D 0 1 0 00 10 D 0 2 0 11 10 D 0 0 1 11 00 D 0 0 2 10 10 E 1 0 0 10 01 E 2 0 0 11 00 E 0 1 0 01 10 E 0 2 0 00 11 E 0 0 1 00 01 E 0 0 2 11 10 F 1 0 0 10 00 F 2 0 0 11 10 F 0 1 0 00 10 F 0 2 0 10 11 F 0 0 1 10 00 F 0 0 2 11 10 G 1 0 0 01 10 G 2 0 0 10 01 G 0 1 0 10 01 G 0 2 0 01 10 G 0 0 1 01 10 G 0 0 2 10 01 ``` ]
[Question] [ I had to write a code for finding all non-empty sublists partitionings of a list: ``` def f(s): if s: for j in range(1,len(s)+1): for p in f(s[j:]): yield [s[:j]]+p else: yield [] ``` I managed to shorten it (for Python 3.4+) to: ``` def f(s, p=[]): if s: for j in range(1,len(s)+1): yield from f(s[j:],p+[s[:j]]) else: yield p ``` using **yield from** and an accumulator argument `p` (prefix). Any suggestions on how to shorten it even more? Example output: ``` >>> for p in f([1,2,3,4]): print(p) ... [[1], [2], [3], [4]] [[1], [2], [3, 4]] [[1], [2, 3], [4]] [[1], [2, 3, 4]] [[1, 2], [3], [4]] [[1, 2], [3, 4]] [[1, 2, 3], [4]] [[1, 2, 3, 4]] >>> ``` [Answer] # 66 bytes ``` p=lambda l:[q+[l[i:]]for i in range(len(l))for q in p(l[:i])]or[l] ``` If the last part is changed from `[l]` to `[[]]`, then it can also be used with tuples or strings, in addition to lists. ]
[Question] [ In this challenge, you have to implement a basic spell checker and autocorrector. Your program will use the first input as a source for a dictionary of words, and will use that to autocorrect the second input, finding a close match to some incorrectly spelt words, outputting the result ## Specifications * You will receive two inputs, one is a sentence/paragraph you use as a source for your spell checker, and the other includes wrong words (they can be correct too) which you have to correct using the first input. * Possible mistakes: Missing one letter (e.g. helo), one extra letter (e.g. heello), substitution of one character (e.g. hilp instead of help), transposition of two adjacent characters (e.g. hlep instead of help). * In other words, the mistake and the original word have to have a Damerau–Levenshtein distance of one. * You can separate the inputs in any reasonable format. For example, instead of using a newline, you can use a pipe sign to separate them. (|) However, watch out so you don't use something like letters because they are used in the 1st input. * It's possible for a word to have neither an identical word nor a word with 1 distance from the first input. You will have to leave them unchanged. * You don't need to do anything with punctuation. That is, I won't test words that are followed by a punctuation. (E.g. From the first example, I won't ask the correction of 'blod') * Challenge is case insensitive, both the input and output. Meaning that if 'The' is used in the 1st input and the 2nd input is 'teh' you can change it to 'The', 'teh', 'teH', and similar cases. * If a word is in the first input, but also has a distance of 1 with one of the other words, do not correct it. * If there are two words with the same distance, you can output either of them. (E.g. 'en' can change into 'on' and 'in' if the words are both in the first input.) You can also output both of them, but you'll have to use a slash between them. (E.g. 'en' can be corrected into 'in/on') * You can assume words are just sequences of letters separated by spaces. * You can use STDIN or the closest alternative in your language. * [Standard loophole rules](http://meta.codegolf.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default) apply. * This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest code wins. ## Examples Input: ``` A criminal strain ran in his blood, which, instead of being modified, was increased and rendered infinitely more dangerous by his extraordinary mental powers. increasd mnetal ``` Output: ``` increased mental ``` Input: ``` The fact is that upon his entrance I had instantly recognized the extreme personal danger in which I lay. I recognizid dnger en ``` Output: ``` I recognized danger in ``` [Answer] # CJam, ~~90~~ 87 bytes ``` qelN%Sf%~f{1$:W,,_:_2ewWf{\~e\}\Wf{' t_S-}W,),Wf{1$m<S\+m>}++Sf/26,'af+\ff*:+\&\a+0=}S* ``` Try it online in the [CJam interpreter](http://cjam.aditsu.net/#code=qelN%25Sf%25~f%7B1%24%3AW%2C%2C_%3A_2ewWf%7B%5C~e%5C%7D%5CWf%7B'%20t_S-%7DW%2C)%2CWf%7B1%24m%3CS%5C%2Bm%3E%7D%2B%2BSf%2F26%2C'af%2B%5Cff*%3A%2B%5C%26%5Ca%2B0%3D%7DS*&input=I%20recognizid%20dnger%20en%0AThe%20fact%20is%20that%20upon%20his%20entrance%20I%20had%20instantly%20recognized%20the%20extreme%20personal%20danger%20in%20which%20I%20lay.). ]
[Question] [ You and a friend are playing a game - who can overflow the most containers? There are `n` containers numbered 1 to `n`. Each container has a certain maximum capacity of water, in litres. You take turns with your friend to pour discrete amounts of water into the containers. On your turn, you *may* pour 2 litres of water into *one container* (you can't distribute into multiple containers), and on your friend's turn, he *must* pour `3` litres. You may also choose, on your turn, to *not* pour water in any of the containers (you cannot, however, choose to only pour 1 litre). The person who manages to overflow the container - that is, after they finish their turn, the litres of water inside the container is greater than its maximum capacity - gets a point. The input comes in the form of space separated integers. The leftmost one is labelled 1 and the rightmost one is labelled `n`. For instance: ``` Y 2 1 4 3 ``` Note that the letter indicates who goes first. `Y` means that you go first, and `F` means that your friend goes first. The 2 litre container is labelled `1`, the 1 litre container is labelled `2`, etc. So we would call the 2 litre container "Container 1", because it is labelled `1`. Now, your friend has a very naïve strategy. He always pours all his 3 litres of water into the container that is closest to overflowing. If there is more than one container that is equally closest to overflowing, he will pour all his water in the one that is labelled with the lowest number. Suppose I use the same naïve strategy of pouring all my 2 litres of water into the container that is closest to overflowing. The example input would work out like this: 1. I pour all my water into Container 2. It overflows, and I get one point. 2. My friend pours all his water into Container 1. It overflows, and he gets one point. 3. I pour all my water into Container 4. It now has 2L of water in it, so it needs another 2L to overflow. 4. My friend pours all his water into Container 4. It overflows, and he gets one point. 5. I pour all my water into container 3. It now has 2L of water in it, so it needs another 3L to overflow. 6. My friend pours all his water into Container 3. It overflows, and he gets one point. Altogether, I only got one point, and my friend got three. That's not good. I can do better than that if I make use of my ability to pass on my turn without pouring water: 1. I pour all my water into Container 2. It overflows, and I get one point. 2. My friend pours all his water into Container 1. It overflows, and he gets one point. 3. I *pass*. 4. My friend pours all his water into Container 4. It now has 3L of water in it, so it needs another 1L to overflow. 5. I pour my water into Container 4. It overflows, and I get one point. 6. My friend pours all his water into Container 3. It has 3L of water in it now, so it needs another 2L to overflow. 7. I pour my water into Container 3. It overflows, and I get one point. By strategically choosing which container to pour my water in, I have managed to obtain 3 points instead of 1. The output format is a list of space separated instructions, where `P` indicates a pass, and an integer from `1` to `n` indicates which container I poured water into. For instance, the naïve nonoptimal strategy listed above could be represented as: ``` 2 4 3 ``` Which means I poured into Container 2, then Container 4, then Container 3. The more optimal strategy would be represented as: ``` 2 P 4 3 ``` Which means I poured into Container 2, then passed, then Container 4, then Container 3 (This, by the way, is the output format). Your program will take in input as described above and return the most optimal solution to get as many points as possible. If there is more than one optimal solution, output either. [Answer] ## Python, ~~217~~ ~~202~~ 176 ``` import sys A=sys.argv[1:] t=A>["G"] C=[[int(A[i]),i]for i in range(1,len(A))] while C: c=min(C);d=1.5 if t:d=c[0]%5<2;print["P",c[1]][d], c[0]-=2*d;t^=1 if[0]>c:C.remove(c) ``` Reads input from the command line. **Strategy:** * If the remaining capacity in the container with the least remaining capacity is congruent *0* or *1* modulo *5*, pour *2* litres (it either overflows, or our friend pours *3* more litres into the same container, bringing us back to the same point.) * Otherwise, no move improves our position, so do nothing (note that this isn't necessarily the *shortest* optimal strategy.) [Answer] # Java - 718 To generalize, the optimal amount of water in the bucket at the beginning of my turn should be capacity-1 or full. So the previous turn (ideally) it should have been capacity-4 or capacity-3, and capacity-7 or capacity-6. So the only option that is bad for me would be capacity - n where n % 3 == 2. So my strategy is to wait until the end, then grab the bucket at the last minute, taking care to keep the bucket level in the "ok range". If all the buckets are in the range, then do nothing! Because you cannot win when the capacity is 2, I simply ignored it. I think this could be the optimal solution. It beats the friend 100% of the time when the capacities are greater than 2. Here is the function (for use in simulator above): ``` BucketChoice makeMove(){ ArrayList<Bucket> bucketsNotOk = new ArrayList<Bucket>(); ArrayList<Bucket> bucketsOk = new ArrayList<Bucket>(); //sort buckets for(Bucket b:buckets){ if(b.litersLeft() % 3 == 2){bucketsNotOk.add(b);} if(b.litersLeft() % 3 == 0){bucketsOk.add(b);} if(b.litersLeft() % 3 == 1){bucketsOk.add(b);} } //first I want to grab any buckets ready for overflowing for(Bucket b:bucketsOk){ if(b.litersLeft()<2){System.out.println(buckets.indexOf(b));return new BucketChoice(b,2);} } //next change buckets to OK for(Bucket b:bucketsNotOk){ //no use adding water if it is doomed if(b.litersLeft()>2){System.out.println(buckets.indexOf(b)); return new BucketChoice(b,2); } } return new BucketChoice(buckets.get(0),0); } ``` golfed...hmmm seems long :( ``` import java.util.*;class o{List<int[]>b=new ArrayList<int[]>(),r=new ArrayList<int[]>();public o(String[]a){for(int x=1;x<a.length;x++){b.add(new int[]{Integer.valueOf(a[x]),0});}while(b.size()>0){if(a[0].equals("F")){e();}int m=0,n=-1,i=0;for(;i<b.size();i++){int[]g=b.get(i);if(g[0]-g[1]<2){n=i;m=1;g[1]+=2;break;}}for(i=0;i<b.size();i++){int[]g=b.get(i);if((g[0]-g[1])%3==2&&m==0){n=i;g[1]+=2;break;}}for(int[]h:b){if(h[0]-h[1]<0){r.add(h);}}for(int[]h:r){b.remove(h);}if(a[0].equals("Y")){e();}if(n!=-1){System.out.print(n+" ");}else{System.out.print("p ");}}}void e(){int[]r={99999,0};for(int[]i:b){if(i[0]-i[1]<r[0]-r[1]){r=i;}}r[1]+=3;if(r[0]-r[1]<0){b.remove(r);}}public static void main(String[]a){new o(a);}} ``` [Answer] # A Java Simulator I know there are lazy people out there! Here it is: To continue, just press any key + enter in the console. OverflowChallenge: ``` import java.util.ArrayList; import java.util.Scanner; public class OverflowChallenge { ArrayList<Bucket> buckets = new ArrayList<Bucket>(); int myScore=0,friendScore=0; public static void main(String[] args) { new OverflowChallenge(args); } public OverflowChallenge(String[]args){ for(int x=1;x<args.length;x++){ buckets.add(new Bucket(Integer.valueOf(args[x]))); } while(buckets.size()>0){ Scanner s = new Scanner(System.in); if(args[0].equals("F")){naivePlayerMove();} BucketChoice myMove=null; if(buckets.size()>0){myMove = makeMove();}else{System.exit(0);} myMove.bucket.addWater(myMove.litersAdded); if(myMove.bucket.overflowing){buckets.remove(myMove.bucket);} System.out.println("you added "+myMove.litersAdded+" to bucket "+buckets.indexOf(myMove.bucket)); if(myMove.bucket.overflowing){System.out.println("...and you overflowed it!");} if(!args[0].equals("F")){naivePlayerMove();} for(Bucket b:buckets){ System.out.println("bucket "+buckets.indexOf(b)+" has " + b.litersFilled +"/"+b.capacity); } System.out.println("friend score = "+friendScore); System.out.println("my score = "+myScore); s.next(); } } BucketChoice makeMove(){ return new BucketChoice(buckets.get(0),2); } void naivePlayerMove(){ Bucket lowestBucket=new Bucket(999999999); for(int x=0;x<buckets.size();x++){ if(buckets.get(x).litersLeft()<lowestBucket.litersLeft()){ lowestBucket=buckets.get(x); } } lowestBucket.addWater(3); System.out.println("your friend added 3 liters to bucket "+buckets.indexOf(lowestBucket)); if(lowestBucket.overflowing){ friendScore++; buckets.remove(lowestBucket); System.out.println("...and overflowed it!"); } } } ``` Bucket: ``` public class Bucket { int capacity,litersFilled; boolean overflowing = false; public Bucket(int capacity){ litersFilled=0; this.capacity=capacity; } public int litersLeft(){ return capacity-litersFilled; } public void addWater(int liters){ litersFilled+=liters; if(litersFilled>capacity){ overflowing=true; } } } ``` BucketChoice: ``` public class BucketChoice { public BucketChoice(Bucket myBucket, int liters){ bucket = myBucket; litersAdded = liters; } public Bucket bucket; public int litersAdded; } ``` Enjoy! ]
[Question] [ Given a grid which contains these signs: 0..9, x, =, write the fastest code that outputs the longest string of connected (horizontally, vertically, and diagonally adjacent), distinct cells which is a mathematically valid expression formed on this grammar: ``` E := T '=' T T := F 'x' T | F F -> {0..9}+ ``` More formally, a solution will have this form: an equality between a product of terms: S = F0 x .. x Fp = Fp+1 x .. x Fn I define N(S) = Max\_i(F\_i) If two strings of the same length need to be compared, then I will compare their largest multiplicand. i.e. 30x3=90 < 33x3=99 because 90 < 99 ## The grids Grid 0: 3 x 3 ``` 13x =73 481 ``` which contains: `13x37=481` Grid 1: 7 x 9 ``` 6996640 1127=39 186=940 8329706 3683980 6349307 75x19x0 5065350 0051900 ``` which contains: ``` a=611333 b=599999 c=494687 d=531337 and a*b=366799188667 and c*d=262845506519 ``` Grid 2: 8 x 8 ``` 1851x412 40081737 72330964 14461858 17604=67 89653745 13612200 14433193 ``` Grid 3: 16 x 16 ``` 0951x71=7=41659x 958525855332=25x 8462=1x119191x76 993928209055089x 1523060251420490 =883152021094970 0146645532106152 87x96=294=x80675 7960948222x0440x x577x987x0993241 29564563x=x5=800 03508x17050=6565 ``` OK so after a short discussion in the comment sections, I am adding a few restrictions to allow me to do a fair comparison of solutions: I will run the solution on my Macbook Pro which is 2,4 GHz Core 2 Duo running Mavericks. The language you are going to propose needs to be running natively on my computer, but fortunately, a lot of languages are available on OS X. I will measure the quality of a program by comparing the time taken to find my hidden solution. Your program will probably find strings that are even longer that the one I hid in the first place, but this can not be avoided as I would need a program that enumerates all the solution of the grids I'm going to submit.. and this is the reason of this code golf.. [Answer] # C, checks about 7,500,000 paths per second So here is my first pass over this. It's quite horrible code because it's all in one huge `main` and the two (nested) loops over the left-hand side and right-hand-side of the equation are pretty much exactly the same, but well, it works. ``` #include <stdlib.h> #include <stdio.h> #include <string.h> #include <time.h> #define MAX_SIZE 32 typedef struct { char symbol; int visited; } cell; typedef struct { int x; int y; } coord; static cell grid[MAX_SIZE][MAX_SIZE]; static int nEquals = 0; static coord equals[MAX_SIZE*MAX_SIZE]; static coord dirs[8] = { { .x = -1, .y = -1 }, { .x = 0, .y = -1 }, { .x = 1, .y = -1 }, { .x = 1, .y = 0 }, { .x = 1, .y = 1 }, { .x = 0, .y = 1 }, { .x = -1, .y = 1 }, { .x = -1, .y = 0 }, }; static char best_string[2*MAX_SIZE*MAX_SIZE+1]; static int best_length = 0; static unsigned long long best_factor; int main(int argc, char *argv[]) { FILE *fp = fopen("grid.txt", "r"); if (!fp) perror("Memory allocation failed"), exit(1); fseek(fp, 0L, SEEK_END); long lSize = ftell(fp); rewind(fp); char *buffer = calloc(1, lSize+1); if (!buffer) { fclose(fp); perror("Memory allocation failed"); exit(1); } if (1 != fread(buffer, lSize, 1, fp)) { fclose(fp); free(buffer); perror("Reading file failed"); exit(1); } fclose(fp); char *cp; cp = buffer; int width = (int)strtol(cp, &cp, 10); int height = (int)strtol(cp, &cp, 10); ++cp; int i, j; for (j = 0; j < height; ++j) { for (i = 0; i < width; ++i) { grid[j][i].symbol = *cp; grid[j][i].visited = 0; if (*cp == '=') { equals[nEquals].x = i; equals[nEquals].y = j; ++nEquals; } ++cp; } ++cp; } printf("Analysing %d x %d grid...\n", width, height); unsigned long long strings_checked = 0; clock_t start = clock(); for (j = 0; j < nEquals; ++j) { char expression[2*MAX_SIZE*MAX_SIZE+1]; coord lpos = equals[j]; coord rpos = equals[j]; // Set to spaces to ease parsing for (i = 0; i < 2*MAX_SIZE*MAX_SIZE+1; ++i) expression[i] = ' '; int center = MAX_SIZE*MAX_SIZE; expression[center] = '='; int lhs_size = 0; int lhs_n_factors = 0; int lhs_dirs[MAX_SIZE*MAX_SIZE]; for (i = 0; i < MAX_SIZE*MAX_SIZE; ++i) lhs_dirs[i] = -2; int rhs_dirs[MAX_SIZE*MAX_SIZE]; for (i = 0; i < MAX_SIZE*MAX_SIZE; ++i) rhs_dirs[i] = -2; unsigned long long lhs_factors[MAX_SIZE*MAX_SIZE]; unsigned long long lhs_max_factors[MAX_SIZE*MAX_SIZE]; unsigned long long lhs_products[MAX_SIZE*MAX_SIZE]; lhs_max_factors[0] = 0; lhs_products[0] = 1; while (lhs_size >= 0) { int dir = ++lhs_dirs[lhs_size]; char lmost_char = expression[center-lhs_size]; if (dir == -1) { grid[lpos.y][lpos.x].visited = 1; if (lmost_char == 'x') { unsigned long long factor = strtoll(expression+center-lhs_size + 1, NULL, 10); lhs_factors[lhs_n_factors] = factor; ++lhs_n_factors; if (factor > lhs_max_factors[lhs_n_factors-1]) lhs_max_factors[lhs_n_factors] = factor; else lhs_max_factors[lhs_n_factors] = lhs_max_factors[lhs_n_factors-1]; lhs_products[lhs_n_factors] = lhs_products[lhs_n_factors-1] * factor; continue; } else if (lmost_char == '=') continue; else { unsigned long long factor = strtoll(expression+center-lhs_size, NULL, 10); unsigned long long max_lhs_factor; if (factor > lhs_max_factors[lhs_n_factors]) max_lhs_factor = factor; else max_lhs_factor = lhs_max_factors[lhs_n_factors]; unsigned long long lhs_product = lhs_products[lhs_n_factors] * factor; int rhs_size = 0; int rhs_n_factors = 0; unsigned long long max_rhs_factor = 0; unsigned long long rhs_factors[MAX_SIZE*MAX_SIZE]; unsigned long long max_factors[MAX_SIZE*MAX_SIZE]; unsigned long long rhs_products[MAX_SIZE*MAX_SIZE]; max_factors[0] = max_lhs_factor; rhs_products[0] = 1; char *rhs_factor_pointers[MAX_SIZE*MAX_SIZE]; rhs_factor_pointers[0] = expression+center+1; while (rhs_size >= 0) { int dir = ++rhs_dirs[rhs_size]; char rmost_char = expression[center+rhs_size]; if (dir == -1) { grid[rpos.y][rpos.x].visited = 1; if (rmost_char == 'x') { factor = strtoll(rhs_factor_pointers[rhs_n_factors], NULL, 10); rhs_factors[rhs_n_factors] = factor; ++rhs_n_factors; rhs_factor_pointers[rhs_n_factors] = expression + center + rhs_size + 1; if (factor > max_factors[rhs_n_factors-1]) max_factors[rhs_n_factors] = factor; else max_factors[rhs_n_factors] = max_factors[rhs_n_factors-1]; rhs_products[rhs_n_factors] = rhs_products[rhs_n_factors-1] * factor; continue; } else if (rmost_char == '=') continue; else { // check for solution ++strings_checked; factor = strtoll(rhs_factor_pointers[rhs_n_factors], NULL, 10); unsigned long long max_factor; if (factor > max_factors[rhs_n_factors]) max_factor = factor; else max_factor = max_factors[rhs_n_factors]; unsigned long long rhs_product = rhs_products[rhs_n_factors] * factor; //printf("%.19s = %d\n", expression + center - 9, rhs_product); // printf("%.51s\n", expression + center - 25); int length = rhs_size + lhs_size + 1; if (lhs_product == rhs_product && (length > best_length || length == best_length && max_factor > best_factor)) { best_length = length; best_factor = max_factor; memcpy(best_string, expression + center - lhs_size, length); best_string[length] = 0; } } } else if (dir < 8) { coord step = dirs[dir]; int new_x = rpos.x + step.x; int new_y = rpos.y + step.y; char new_char; if (new_x < 0 || new_x >= width || new_y < 0 || new_y >= height || grid[new_y][new_x].visited || (new_char = grid[new_y][new_x].symbol) == '=' || new_char == 'x' && (rmost_char == 'x' || rmost_char == '=')) continue; // TODO: Should diagonally crossing paths be disallowed, too? ++rhs_size; rpos.x = new_x; rpos.y = new_y; expression[center+rhs_size] = new_char; } else { if (rmost_char == 'x') --rhs_n_factors; rhs_dirs[rhs_size] = -2; if (rmost_char != '=') expression[center+rhs_size] = ' '; grid[rpos.y][rpos.x].visited = 0; --rhs_size; coord step = dirs[rhs_dirs[rhs_size]]; rpos.x -= step.x; rpos.y -= step.y; } } } } else if (dir < 8) { coord step = dirs[dir]; int new_x = lpos.x + step.x; int new_y = lpos.y + step.y; char new_char; if (new_x < 0 || new_x >= width || new_y < 0 || new_y >= height || grid[new_y][new_x].visited || (new_char = grid[new_y][new_x].symbol) == '=' || new_char == 'x' && (lmost_char == 'x' || lmost_char == '=')) continue; // TODO: Should diagonally crossing paths be disallowed, too? ++lhs_size; lpos.x = new_x; lpos.y = new_y; expression[center-lhs_size] = new_char; } else { if (lmost_char == 'x') --lhs_n_factors; lhs_dirs[lhs_size] = -2; expression[center-lhs_size] = ' '; grid[lpos.y][lpos.x].visited = 0; --lhs_size; coord step = dirs[lhs_dirs[lhs_size]]; lpos.x -= step.x; lpos.y -= step.y; } } } clock_t end = clock(); float seconds = (float)(end - start) / CLOCKS_PER_SEC; printf("Checked %llu paths.\n", strings_checked); printf("Took %f seconds.\n", seconds); printf("Result: %s\n", best_string); } ``` This expects the input stored in a file `grid.txt`. The first line is the space-separated size of the grid, which is followed by the grid itself. Like: ``` 3 3 13x =73 481 ``` The algorithm is currently checking all possible well-formed paths (brute force). By well-formed, I mean that paths containing `xx` or two `=` are skipped, and I only start looking for paths starting from a `=` in both directions. Basically, I check all possible LHSs and for each such path, I check all possible RHSs. Over the next few days, I plan to add several optimisations to skip more paths, since the runtime per path will only go up and not down from here. This will run into some problems with grid sizes of more than some 20 cells, due to integer overflow. I'll have to use some bigint-library when I get to solving those in a reasonable amount of time (which, I'm afraid, will reduce the paths/second a bit). Currently, the largest sizes that can be solved in a reasonable amount of time at the moment are 7x3 or 5x4 (both taking under two minutes). 8x3 would take about half an hour, and 9x3 or 6x4 or 5x5 would take a few hours (between 1 and 7 I think). **EDIT:** Managed to speed it up by close to 20 percent, because now I'm parsing each multiplicand when it's "locked" (i.e. when an `x` next to it has been parsed) instead of parsing the entire right-hand side for each possible path. And I should add that I observed those 20% for a grid where there's only a single `x` to be found, so I expect the performance gain for grids with many `x` to actually be quite substantial. Next stop: bigints. [Answer] ### Python + networkx (Bruteforce, checks about 10000 paths per second on my machine) It's not fast, but it works at least. Checks literally every path. Amount of cycles necessary can be found [here](https://docs.google.com/spreadsheets/d/1VPlBhxiMjTDKNvllt014Yj8VjVRBJYEOL50muw1Lenw/edit?usp=sharing). This program solved a 5\*6 in half an hour. TODO: ~~replace `eval` by something less terrible.~~ Done. ``` __author__ = 'Synthetica' import networkx as nx import itertools as it import time as tm def main(): longest = 0 data = ['6996640', '1127=39', '186=940', '8329706', '3683980', '6349307', '75x19x0', '5065350', '0051900'] hor = len(data[0]) vert = len(data) threads = 8 G = nx.grid_2d_graph(vert, hor) # Q = qu.LifoQueue(maxsize=1000) #W = mp.Pool(threads) #W.map_async(evalexpr, [Q]*threads) printevery = 10**4 tested = 0 t = tm.time() for node in it.product(G.nodes(), repeat=2): if node[0]==node[1]: continue for path in nx.all_simple_paths(G, source=node[0], target=node[1]): tested += 1 path = "".join(data[x][y] for x, y in path) if tested > printevery: ot = t t = tm.time() tested = 0 print printevery, "tested. Speed:", printevery/(t-ot), "s**-1" if not all((path.count('=')==1, 'x' in path, len(path) >= longest)): continue #newpath = path.replace('=', '==').replace('x', '*') try: #print "Calling eval on", newpath parts = path.split("=") part0 = parts[0].split('x') part1 = parts[1].split('x') part0 = map(int,part0) part1 = map(int,part1) part0 = reduce(int.__mul__, part0) part1 = reduce(int.__mul__, part1) result = part0 == part1 except: result = False if result: print 'Found new best:',path longest = len(path) if __name__ == "__main__": main() ``` ]
[Question] [ For more information on Parity: [Wikipedia](http://en.wikipedia.org/wiki/Parity_bit) # Challenge Write a program that takes an input (stdin, argv, ect) of four nibbles and two parity nibbles. Your program should then test to see whether the 'block' is valid, using **even parity**; if it is then output `1`. Then try to make any corrections, if correction is possible output the corrected block. If you cannot correct the block output `-1`. You can assume **the parity nibbles are never corrupt**. To re-cap and clarify: * If the input is valid output `1`. * If the input is invalid and fixable output the fixed block. * If the input is invalid and cannot be fixed output `-1`. * You can only edit bits if their respective row and column in the parity bit is incorrect. Input Format: ``` <NIBBLE> <NIBBLE> <NIBBLE> <NIBBLE> <PARITY-Y> <PARITY-X> ``` So `1010 0111 1101 1011 1011 0111` Would look like: ![Parity Block](https://i.stack.imgur.com/sPiDN.png) # Winning This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"): Smallest program wins. # Input and Output Examples Input `1010 0111 1101 1011 1011 0111` Output `1` The Input is Valid Input `1010 0011 1101 1011 1011 0111` Output `1010 0111 1101 1011` The Input was Invalid, but correctable Input `1010 0001 1101 1011 1011 0111` Output `-1` The Input was Invalid, and not correctable [Answer] # Python 2, 387 I feel it's kinda long though. Do suggest improvements or any fixes... ``` i=raw_input() z="""#h(a?(a&1)^h(a/2)~a@0 #y(i,m,l,c=0?h(i&m)|y(i>>l,m,l,c+1)*2~c<4@0 #p(i?y(i,4369,1)*16+y(i,15,4) k=i.replace(" ","") m=int(k[:16],2) c=int(k[-8:],2) #s(i?s(i>>4)+" "+bin(i&15^16)[3:]~i@"" #q(j=16):d=m^1<<j;!s(d)[1:]~p(d)==c@q(j-1)~j@-1 #f(?1~p(m)==c@q()""" for k,l in("?","):!"),("!","return "),("@"," else "),("#","def "),("~","if "):z=z.replace(k,l) exec z print f() ``` Slightly ungolfed... ``` def y(i,m,l,c=0): h=lambda a:(a&1)^h(a/2)if a else 0 # Calculate how many set bits in i return h(i&m)|y(i>>l,m,l,c+1)*2if c<4 else 0 # Sets the parity bits accordingly recursively p=lambda i:y(i,4369,1)*16+y(i,15,4) # Returns the y and x parity together i="1010 0111 1101 1011 1011 0111" k=i.replace(" ","") # Remove all spaces m=int(k[:16],2) # Extracts the matrix c=int(k[-8:],2) # Extracts the parities s=lambda i:s(i>>4)+" "+bin(i&15^16)[3:]if i else"" # Converts from int to space separated hexas in binary def f(i): if p(m)==c:return 1 # If calculated parities matches the test for i in range(16): # Else, for each of the 16 bits in the matrix d=m^1<<i # xor it if p(d)==c:return s(d)[1:] # return the matrix if its parities matches the test return -1 # If all else fails, return -1 print f(i) ``` [Answer] ## JavaScript (ES6), 234 bytes ``` s=>(a=s.split` `,[...a.pop()].map((c,i)=>a[i]+=c),x=y=0,[...a].map((s,i)=>[...s].map((c,j)=>{x^=c<<i;y^=c<<j})),x&=15,y&=15,a.pop(),x|y?x-(x&-x)|y-(y&-y)?-1:[...a].map((s,i)=>s.slice(0,4).replace(/./g,(c,j)=>c^x>>i&y>>j&1)).join` `:1) ``` Save 21 bytes if an array of strings is an acceptable I/O format, or 46 bytes if a two-dimensional array of bits is acceptable. Explanation: The original string is split into blocks and then rearranged into an almost square formation: ``` DDDDX DDEDX DDDDX DDDDX YYYY ``` The row and column parities are then calculated, each setting the appropriate bit in the `x` and `y` variables, so for instance if the error was in the bit marked `E` it would set `x` to 2 and `y` to 4. (If the parity of the parity blocks was also provided, then it could also be checked, and an error in the parity blocks or indeed the parity bit itself could be detected. The two parity blocks should have the same parity, of course.) ``` s=>( String parameter a=s.split` `, Split it into blocks [...a.pop()] Remove the X parity block and loop over it .map((c,i)=>a[i]+=c), Append the X parity bits to the data blocks x=y=0, Initialise the X and Y parity [...a].map((s,i)=> Loop over rows [...s].map((c,j)=> and columns {x^=c<<i;y^=c<<j})), updating the parity x&=15,y&=15, Only bits 0-3 are important a.pop(), Remove the Y parity block x|y? If there were parity errors x-(x&-x)|y-(y&-y)?-1: If there were several errors then return -1 [...a].map((s,i)=> If there was one error then loop over blocks s.slice(0,4) Removing the X parity bit .replace(/./g,(c,j)=> Loop over bits c^x>>i&y>>j&1)) Flip the bit if it was the incorrect bit .join` `: Join the blocks together 1) Return 1 if there were no parity errors ``` ]
[Question] [ The quest is to convert an integer to a string in such a way that 1. the order is preserved 2. using the least number of characters in the string. Let's say I have an integer X; the objective is to create a function `f` (and respective inverse, `g`, such that: ### Conditions 1. `f(X) is a utf-8 string for all integer X` 2. `g(f(X)) = X` 3. Ordering is preserved. That is, if I have another integer Y, X > Y implies f(X) > f(Y) 4. The integer means it **can be** negative 5. Assume integers in `[-2^63, 2^63 - 1]` ### Winning criterion 1. The answer must fulfill the conditions above 2. Make `f(X)` represent the number in the least number of UTF-8 characters. 3. Of answers complying with 1 and 2, smallest code wins (sum of code of `f` and code of `g`) ### Example (Python) ``` def f(x): return '%019d' % x # log10(2^63 - 1) ~ 18.9 def g(x): return int(x) ``` Notice that it is not clear that `f` is optimal since it always uses the same number of characters (independent of x). This is my first challenge here and I'm not sure if this fits this Q&A, but it seemed to me a nice and useful problem. I'm also trying to solve it. [Answer] # Perl, 4 per integer, 115 in code ``` sub f{pack W4,map{$_|1<<($x<0?16:17)}unpack n4,pack"q>",$x=pop}sub g{unpack"q>",pack n4,map{$_&65535}unpack W4,pop} ``` **Caveat:** This only works if Perl has 64-bit integers. This is true if `perl -V:ivsize` gives 8. If `perl -V:byteorder` says 87654321, I believe that you may golf both `"q>"` into `"q"`, for 113 characters, but I have no 64-bit SPARC to test this. The strings returned by `f` and passed to `g` are **text strings**, not binary strings. A text string is a sequence of Unicode codepoints. A binary string is a sequence of bytes. The order of the strings preserves the order of the integers when one encodes each text string in UTF-8 and checks the lexical order of the UTF-8 bytes. ## Facts about UTF-8 1. Valid codepoints for UTF-8 are from 0 to 0xd7ff, and from 0xe000 to 0x10ffff. See [RFC 3629](https://www.rfc-editor.org/rfc/rfc3629). This makes 1112064 valid codepoints. Surrogates from 0xd800 to 0xdfff are not valid in UTF-8. 2. Strings have the same lexical order in Unicode codepoints and in UTF-8 bytes. It is enough to put the codepoints in order, then the UTF-8 bytes are also in order. ## Scheme of conversion Because 11120643 < 264 < 11120644, there is no scheme that can save every 64-bit integer in 3 or fewer codepoints. Some schemes would use a maximum of 4 codepoints and an average of less than 4. My simple scheme uses 4 codepoints for every integer. I unpack each 64-bit integer into four unsigned 16-bit integers. To preserve the order of negative integers before positive integers, I put negative integers in plane 1 (Supplementary Multilingual Plane), and non-negative integers in plane 2 (Supplementary Ideographic Plane). Negative example: * -9118070288978897167 * 0x81761b61bc5e96f1 * 0x8176 0x1b61 0xbc53 0x96f1 * 0x18176 0x11b61 0x1bc53 0x196f1 Postive example: * 6359689164524478505 * 0x584227999d61e029 * 0x5842 0x2799 0x9d61 0xe029 * 0x25842 0x22799 0x29d61 0x2e029 ## Are 0x1fffe, 0x1ffff, 0x2fffe, 0x2ffff valid in UTF-8? My scheme uses the Unicode noncharacters 0x1fffe, 0x1ffff, 0x2fffe, 0x2ffff. Perl refuses to encode these in UTF-8. ``` $ perl -MEncode -e 'encode "utf-8", "\x{2fffe}", Encode::FB_CROAK' "\x{2fffe}" does not map to utf8 at /usr/libdata/perl5/amd64-openbsd/5.16.3/Encode.pm line 160. ``` [Unicode Corrigendum #9](http://www.unicode.org/versions/corrigendum9.html) clarifies that Unicode noncharacters like 0x2fffe are valid in Unicode strings. There is no requirement to reject them in UTF-8 as Perl is doing. Python, Ruby and Tcl do not reject noncharacters in UTF-8. The workaround for Perl is to use 'utf8' and not 'utf-8' to encode strings. The 'utf8' encoder skips the checks in the strict 'utf-8' encoder. ## Ungolfed version ``` use strict; use warnings; # Convert 64-bit integer to Unicode string. sub f { my $x = shift; # Unicode plane = 0x10000 if $x < 0, 0x20000 else my $p = 1 << ($x < 0 ? 16 : 17); # 1. Pack $x as big-endian signed 64-bit integer "q>". # 2. Unpack four big-endian unsigned 16-bit integers "n4". # 3. Add Unicode plane. # 4. Pack four Unicode characters "W4". pack "W4", map({ $_ | $p } unpack("n4", pack("q>", $x))); } # Convert Unicode string to 64-bit integer. sub g { # Unpack characters, remove plane, pack and unpack integer. unpack "q>", pack("n4", map({ $_ & 65535 } unpack("W4", shift))); } # Test program: verify that a lexical sort on UTF-8 octets preserves # the order of these integers. use Encode; my @integers = (-9223372036854775808, -4611686018427387904, -9999, -1, 0, 5, 44, 333, 2222, 11111, 4294967295, 9223372036854775807); my @strings = map { f $_ } @integers; @strings = sort { encode('utf8', $a) cmp encode('utf8', $b) } @strings; my $want = join ',', @integers; my $have = join ',', map({ g $_ } @strings); if ($want eq $have) { printf "ok\n"; } else { die "not ok: $want ne $have"; } ``` [Answer] # PowerShell, 185 ``` $s=32767 function f($x){$a='';while($x){$r=$x%$s;$a+=[char]($r+$s) [long]$x=[bigint]::divide($x,$s)};$a} function g($x){$a=0;0..($x.length-1)|%{$a+=($x[$_]-$s)*[bigint]::pow($s,$_)};$a} ``` ## Ungolfed ``` $shift = 32767 function f($number) { $string = '' while($number) { $remain = $number % $shift $string += [char]($remain+$shift) [long]$number = [bigint]::divide($number, $shift) } $string } function g($string) { [long]$number = 0 0..($string.length-1)|%{$number += ($string[$_]-$shift)*[bigint]::pow($shift, $_)} $number } ``` At most, the output will be length 5. ``` > f ([long]::MaxValue) 耆耟耯耟耇 > g '耆耟耯耟耇' 9223372036854775807 > f ([long]::MinValue) 翷翟翏翟翷 > g '翷翟翏翟翷' -9223372036854775808 ``` ]
[Question] [ Create a program in *any* language, that takes an arbitrary binary input, and generates a valid C++11 program, which when compiled and run will print this binary input. So you could do this (on linux with gcc, where `program` is the code you've written and `file.dat` is one of the test inputs): ``` $ cat file.dat | ./program > gen.cpp $ g++ -std=c++11 -pedantic -static -O2 -o gen gen.cpp $ ./gen > file.dat.new $ diff file.dat file.dat.new $ echo $? 0 ``` The scoring depends on the byte count of the original code (**O**), and the square of the byte count of the generated codes for the following inputs: * **A**: The whole lyrics of Never gonna give you up * **B**: The uncompressed grayscale 32x32 BMP version of Lena Söderberg * **C**: The original source code (the generator, **O**) * **D**: The generated source code for the **A** input Score is **O** + **A**^2 + **B**^2 + **C**^2 + **D**^2. The values for the generated variants are squared to encourage optimizing the size of the generated code (and the size of the original code is reflected in **C** as well). Lowest score wins. Clarification of the rules: * The generated code has to conform to the C++11 standard * You have to be able to compile, run and test all generated codes with at least one of the GCC, Clang or MSVC++ compilers (the example above is just an example for linux and gcc, but you should get the idea on how it should work). * The C++11 code can only use the standard C++11 libraries, so external libraries (like zlib) are not allowed. * The generated code has to be able to print the original data without any external help, like network connections or pipes, etc. (e.g. if you move the `gen.exe` to another, isolated computer it should be able to generate the output there as well) * The code generator should also work for any other input (generates code that regenerates the original input), but compression performance for them is not measured in the score (this means that optimizing the generator only for the test inputs are okay). * The input files are supplied in base 64 only because they contain binary data (the image at least). They need to be decoded separately, which is not part of the challenge File inputs *in base 64*: **Never gonna give you up** ``` V2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VgwMZ2hp41haG17gYKDg4N/ f4ODgIB3dZyinpigzIJ2glsun5yokmJqbnyDhIWFhoSDhYOBgnSCnp2bmMKob3t9gWU= ``` [Answer] # C The extremely repetitive song makes it possible to compress this rather heavily. This program analyses the structure of the input and picks one of two compressors (one for the song, one for the picture), or falls back to raw output. I manage to shrink both the song and the picture at half the input size! Tested on Debian Jessie using gcc and g++. Score: 1185 + 957^2 + 1223^2 + 1276^2 + 1123^2 = **5 302 068** ``` #include<stdlib.h> #include<string.h> #include<stdio.h> #define R ;return; #define X(a) ;o(34);a;o(34); #define Y(a,b) X(q(s+a,b)) #define V ;r(j-66)X(q(h,strlen(h)));o(10); #define H w("#include<stdio.h>\nint main(){fwrite(\""); #define F(a) ;w("\",1,");printf("%d",g-a);w(",stdout);}")R} #define M char M*s,*h;int g=0,c,t=0,i=0,j=65,z,f,b[5][2]={210,224,225,235,208,388,403,568,142,208},n[7]={0,1,3,2,1,0,4};o(M a){putchar(a);}e(int a){if(a==10){w("\\n")R}if(a==13){w("\\r")R}a==34||a==92?o(92):1;o(a);}q(M*a,int b){for(;b--;a++)e(*a);}w(M*a){printf(a);}d(){w("#define ");o(j++);o(32);}r(int a){t=b[a][1]-b[a][0];h=memcpy(calloc(1,t+1),s+b[a][0],t);}l(M*a,int b,int*c){while(*a){f=1;for(i=0;i<b&&f;i++){r(c[i]);z=strlen(h);if(!memcmp(a,h,z)){X(e(32);o(65+c[i]);e(32));a+=z;f=0;}free(h);}if(f){e(*a);a++;}}}main(){while((c=getchar())!=EOF){s=realloc(s,++g);s[g-1]=c;if(!c)t=g;}if(g==1943&&!t){d()V d()V d();r(2)X(l(h,2,n))o(10);d()V d()V H l(s,5,n+2)F(0)if(g==2102){unsigned M*a=s+53;for(;i<=255;i++,a+=4)for(t=1;t<4;t++)if(*(a+t)!=i||*a){H q(s,g)F(0)H q(s,53)X(w(",1,53,stdout);for(int i=0,j;i<=255;i++){for(j=0;j<4;j++)putchar(j?i:0);};fwrite("))q(s+1077,g-1077)F(1077)H q(s,g)F(0) ``` Before minimizing it (I also changed some identifiers during minimization, but at least you can see the algorithm): ``` #include<stdlib.h> #include<string.h> #include<stdio.h> #define X(a) ;o('"');a;o('"'); #define Y(a,b) X(q(s+(a),(b))) #define V(a) X(q(rr(a),strlen(rr(a))));o(10); #define H ;w("#include<stdio.h>\nint main(){fwrite(\""); #define F(a) ;w("\",1,");printf("%d",sz-a);w(",stdout);}");} //Input memory handling char*s; int sz=0,c,t=0; m(char a){ s = realloc(s,++sz); s[sz-1] = a; if(a==0||a=='%')t=sz; } //Print 1 byte o(char a){putchar(a);} //Print 1 byte with C escaping e(int a){ if(a==10){w("\\n");return;} if(a==13){w("\\r");return;} if(a=='"'||a=='\\')o('\\'); o(a); } //Print b bytes p(char*a,int b){for(;b--;a++)o(*a);} //Print b bytes with escaping q(char*a,int b){for(;b--;a++)e(*a);} //Print a NUL-terminated string w(char*a){printf("%s",a);} //Helper for #defines d(char a){w("#define ");o(a);o(' ');} //Read a predefined portion of rickroll text char*rr(int a){ int b[5][2]={{0xd2,0xe0},{0xd0,0x184},{0xe1,0xeb},{0x193,0x238},{0x8e,0xd0}}; int sb=b[a][1]-b[a][0]; return memcpy(calloc(1,sb+1),s+b[a][0],sb); } //Print a with substrings from rickroll substrings in c //replaced with constants from g rs(char*a,int b,int*c,char*g){ int i,si,f;char*d; while(*a){ f=0; for(i=0;i<b&&!f;i++){ d=rr(c[i]);si=strlen(d); if(!memcmp(a,d,si)) { X(e(' ')&&e(g[i])&&e(' ')); a=a+si; f=1; } free(d); } if(!f){ e(*a);a++; } } } /*Rick Astley compression mode Defines constants for common substrings and uses them if and where they appear in the input text. */ r(){ char b[1]; d('A')V(0) d('B')V(2) int n[2]={0,2}; d('C')X(rs(rr(1),2,n,"AB"))o(10); d('D')V(3) d('E')V(4) H int m[5]={3,1,2,0,4}; rs(s,5,m,"DCBAE") F(0) /*Lena compression mode Looks for color definintion table in the input text, and prints that using a for loop in the generated code. Fallback to raw mode if no color table. */ l() { int i=0,j;unsigned char*a=s+0x35; for(;i<=0xff;i++){ for(j=1;j<4;j++) if(*(a+(i*4)+j)!=i||*(a+(i*4))){z();return;} } H q(s,0x35); // j?i:0 to output NULL byte first w("\",1,0x35,stdout);for(int i=0,j;i<=0xff;i++){for(j=0;j<4;j++)putchar(j?i:0);};fwrite(\""); q(s+0x435,sz-0x435) F(0x435) //Raw mode z(){ H q(s,sz) F(0) //Read entire input and pick compression method based on size main() { while((c=getchar())!=EOF)m(c); if(sz==1943&&!t)r(); else if(sz==2102)l(); else z(); return 0; } ``` [Answer] Python 3.2 (36,737,736) Just to get this started, a *totally dumb-as-a-rock-no-compression* implementation score. ``` import sys,base64 print("""#include <cstdio> int main(){char*s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";char t[256]={0};for(int i=0;*s;s++,i++)t[*s]=i;for(s="%s";*s;s+=4){char c[]={char(t[*s]<<2|t[s[1]]>>4&3),char(t[s[1]]<<4&240|t[s[2]]>>2&15),char(t[s[2]]<<6&192|t[s[3]]&63)};fwrite(c,3-(s[3]=='=')-(s[2]=='='),1,stdout);}}"""%(base64.b64encode(sys.stdin.buffer.read())).decode()) ``` Basically it just base64 encodes the file and decodes it in C++. Tested with `clang++` on MacOS Mavericks, current Xcode. It compiles with style warnings, but I don't see any rule against that :) Score is 408 + 2914^2 + 3126^2 + 866^2 + 4210^2 = 36,737,736 ]
[Question] [ There is already a problem on here about [calculating the total resistance of a resistor diagram](https://codegolf.stackexchange.com/questions/10863/calculating-resistance-nerd-sniping). However, that problem deals only with series-parallel diagrams, which are trivially reducible. Here I present the question that includes nontrivial bridges and the like, and uses a slightly more convenient representation. Your task is to build a program that, given a graph where each edge has a value representing the resistance of a resistor between the vertices of that edge, will calculate the resistance between two specified vertices. Your program will take input in two parts: * The resistor graph. This can be in one of two forms, depending on which one is more convenient: + An `N`-by-`N` adjacency matrix, where `N` is the number of points in the resistor graph. The `m`th entry of the `n`th row is the resistance of the resistor between points `m` and `n`, in ohms. (The `m`th entry of the `n`th row and the `n`th entry of the `m`th row will always be equal.) The way this adjacency matrix is represented in data is your choice. + A number `N`, denoting the number of vertices in the graph, followed by a list of entries, each entry containing three numbers: `p1`, `p2`, and `r`, which are the numbers of the two points and the resistance of the resistor placed between those points. There will never be more than one resistor connecting two points. Again, the way this list is represented in data is your choice. * Two numbers `v1` and `v2`, representing the vertices between which the resistance is to be calculated. All resistors will have a resistance of a positive integer of ohms. A value of `0` will refer to a resistor-less wire (i.e. zero resistance), and a value of `-1` or `infinity` (you can choose which one to accept) will refer to the absence of a wire (i.e. infinite resistance). Your program will return `R`, the resistance between `v1` and `v2` in ohms, as a floating-point number (to at least four significant digits). If the resistance is infinite, return either `-1` or your language's representation of `infinity`. Your solution must not make use of any libraries that are specifically built for solving linear equations or calculating the resistance of a resistor diagram. Since any winning criteria I could come up with will take too long to judge properly (except for "first submitted code that actually works", but that one is unacceptable for obvious reasons), this will also be code golf. The shortest code in any language that can do the above will win. However, if you have an idea for a different winning criterion, I would be glad to hear it. --- ## Example inputs ### 1. Series diagram The following matrix: ``` -1 2 -1 -1 2 -1 3 -1 -1 3 -1 4 -1 -1 4 -1 ``` is a diagram representing resistors of 2 ohms, 3 ohms, and 4 ohms, put in series in that order. An input of `1 3` as the vertices would return `5.0`, and an input of `1 4` would return `9.0`. ### 2. Parallel diagram The following matrix: ``` -1 0 0 0 -1 0 -1 -1 -1 2 0 -1 -1 -1 3 0 -1 -1 -1 4 -1 2 3 4 -1 ``` is a diagram representing resistors of 2 ohms, 3 ohms, and 4 ohms, put in parallel in that order. An input of `1 5` as the vertices would return `0.9230769230769231`. ### 3. Infinite-resistance diagram The following matrix: ``` -1 2 -1 -1 2 -1 -1 -1 -1 -1 -1 4 -1 -1 4 -1 ``` is a diagram representing two disconnected graphs of resistors. The input `1 2` would return `2.0`, but the input `1 4` would return `-1` or `infinity`, as there is no path between the vertices. ### 4. Zero-resistance diagram The following matrix: ``` -1 0 0 0 -1 0 -1 -1 -1 2 0 -1 -1 -1 0 0 -1 -1 -1 4 -1 2 0 4 -1 ``` is a diagram representing resistors of 2 ohms and 4 ohms, and a plain wire, put in parallel. An input of `1 5` as the vertices would return `0.0`, as there is a wire with zero resistance running from point 1 to point 5 via point 3. ### 5. Bridge The following matrix: ``` -1 2 1 -1 2 -1 3 5 1 3 -1 4 -1 5 4 -1 ``` represents the smallest diagram of resistors that cannot be represented as a series-parallel diagram for a specific set of points, namely 1 and 4. An input of `1 4` has a result of `2.9`. ### 6. Cube The following matrix: ``` -1 1 1 -1 1 -1 -1 -1 1 -1 -1 1 -1 1 -1 -1 1 -1 -1 1 -1 -1 1 -1 -1 1 1 -1 -1 -1 -1 1 1 -1 -1 -1 -1 1 1 -1 -1 1 -1 -1 1 -1 -1 1 -1 -1 1 -1 1 -1 -1 1 -1 -1 -1 1 -1 1 1 -1 ``` is a diagram representing a cube of one-ohm resistors. According to Wikipedia, the input `1 8` will return `0.8333333333333333`. [Answer] # J, 50 characters ``` (3 :'0 a}1 b}y+1e_5*c=:+/(-/~y)%r+1e_4')^:_[0 %a{c ``` Assumes the input is already stored in a set of global variables as: * `r` is a 2D matrix of single-precision numbers * `a`, `b` are 0-based indices of the two nodes ### Usage: ``` r=: _ 2 _ _ r=:r,.2 _ 3 _ r=:r,._ 3 _ 4 r=:r,._ _ 4 _ a=:0 b=:3 (3 :'0 a}1 b}y+1e_4*c=:+/(-/~y)%r+1e_3')^:_<./r %a{c ``` ### Explanation: * `(3 :'...')^:_=/r` - Repeat the explicit verb passed as a string until it converges (infinite power), starting with the scalar zero. It becomes a 1D array after the first iteration. + `r+1e_4` - Add 100 μΩ parasitic resistance to each pair of resistor leads. We don't like wires. **Lower values increase precision, but also limit the time step. If there are no wires, parasitic resistance is not needed.** + `(-/~y)%` - Create the table of self-differences of the node voltage list (the table of voltage differences) (The table of self-differences of a scalar is a scalar zero). Divide this by the resistances. You get a list of resistor currents. + `c=:+/` - Compute the sum of each column - the current flowing into each node - and tuck that away into a global variable. + `y+1e_5*` - Multiply that by the time step and add that to the node voltage of each node. **The time step** (divided by the parasitic capacitance of each node) **must be lower than the lowest resistance, otherwise the simulation will not converge. Lower value = slower convergence. Without wires, we can increase this value to 1/2** and save three chars (and also speed up the convergence immensely). With wires, this won't converge at 1/2 Ω. + `0 a}1 b}` - Pin the probe voltages to 0 volts and 1 volt respectively. * `%a{c` - Take the current flowing into the ground, and return its inverse. ]
[Question] [ Write a program that will determine the original sequence given five variations. The original sequence will be contain n unique elements in any order. A variation is made by making a copy of the original sequence and choosing a random item from the copy and inserting it at any random location in the sequence (this could be the same index it was originally at). Also, each item can only be chosen once so that the five variations will each operate on a different item. ## Input ``` 5 # number of items 1 2 3 4 5 # unknown 2 1 3 4 5 # 3,4,5 candidate 3 1 2 4 5 # 4,5 candidate 4 1 2 3 5 # 1,2 candidate 5 1 2 3 4 # 1,2,3 candidate # 1,2,3 + 3,4,5 = 1,2,3,4,5 ``` ## Output ``` 1 2 3 4 5 ``` In case it's not clear what I meant, here is Python code to generate an example ``` from random import shuffle,randint n = 5 # can be any number a = range(1, n+1) shuffle(a) s = set() #print str(a[0])+"".join(" "+str(x) for x in a[1:]) #debug (print orig sequence) for run in xrange(5): c = list(a) i = randint(0, n-1) while c[i] in s: i = randint(0, n-1) t = c.pop(i) s.add(t) c.insert(randint(0, n-1), t) print str(c[0])+"".join(" "+str(x) for x in c[1:]) ``` Keep in mind, the numbers aren't necessarily consecutive or all positive. The shortest wins. ## Longer Example Here's how the five variations are generated. Each is just one step away from the original. ``` 6 3 4 5 7 1 2 # original 6 4 5 7 3 1 2 # 3 moved to index 3 3 6 4 5 7 1 2 # 6 moved to index 1 6 3 4 5 1 2 7 # 7 moved to index 6 6 3 4 7 1 5 2 # 5 moved to index 5 6 3 2 4 5 7 1 # 2 moved to index 2 ``` Contiguous subsequences of the original will remain in each variation. ``` 6 4 5 7 3 1 2 3 6 4 5 7 1 2 x x # (1, 2) is a candidate 6 4 5 7 3 1 2 6 3 4 5 1 2 7 x # (6) is a candidate but we can ignore it since one item # doesn't tell us much 6 4 5 7 3 1 2 6 3 4 7 1 5 2 x x x 6 4 5 7 3 1 2 6 3 2 4 5 7 1 x 3 6 4 5 7 1 2 6 3 4 5 1 2 7 x x # (4, 5) 3 6 4 5 7 1 2 6 3 4 7 1 5 2 x 3 6 4 5 7 1 2 6 3 2 4 5 7 1 6 3 4 5 1 2 7 6 3 4 7 1 5 2 x x x # (6, 3, 4) 6 3 4 5 1 2 7 6 3 2 4 5 7 1 x x # (6, 3) 6 3 4 7 1 5 2 6 3 2 4 5 7 1 x x # (6, 3) ``` Merging the candidates together we realize the sequence has ``` (6, 3, 4, 5) and (1, 2) ``` We can get the rest by realizing that by inserting an item, the sequence may be shifted by one in either direction, so repeat the above except using a unshifted sequence. ``` 4 5 7 3 1 2 3 6 4 5 7 1 2 4 5 7 3 1 2 6 3 4 5 1 2 7 x x # (1, 2) 4 5 7 3 1 2 6 3 4 7 1 5 2 x 4 5 7 3 1 2 6 3 2 4 5 7 1 6 4 5 7 1 2 6 3 4 5 1 2 7 x x x # (1, 2) 6 4 5 7 1 2 6 3 4 7 1 5 2 x x x # (7, 1) something new! 6 4 5 7 1 2 6 3 2 4 5 7 1 x 3 4 5 1 2 7 6 3 4 7 1 5 2 3 4 5 1 2 7 6 3 2 4 5 7 1 x 3 4 7 1 5 2 6 3 2 4 5 7 1 x ``` Merging those with our previous results give us ``` (6, 3, 4, 5) and (7, 1, 2) ``` Now do the same again except unshifting the other. ``` 6 4 5 7 3 1 2 6 4 5 7 1 2 x x x x # (6, 4, 5, 7) 6 4 5 7 3 1 2 3 4 5 1 2 7 x x # (4, 5) 6 4 5 7 3 1 2 3 4 7 1 5 2 x 6 4 5 7 3 1 2 3 2 4 5 7 1 3 6 4 5 7 1 2 3 4 5 1 2 7 x 3 6 4 5 7 1 2 3 4 7 1 5 2 x 3 6 4 5 7 1 2 3 2 4 5 7 1 x x x x x # (4, 5, 7, 1) 6 3 4 5 1 2 7 3 4 7 1 5 2 6 3 4 5 1 2 7 3 2 4 5 7 1 x x # (4, 5) 6 3 4 7 1 5 2 3 2 4 5 7 1 x ``` Merging those with our previous gives us ``` (6, 3, 4, 5, 7, 1, 2) ``` Each candidate gives the "general" order of the original sequence. For example (6, 4, 5, 7) just says "6 before 4 before 5 before 7" but doesn't say anything about numbers that max exist between say 6 and 4. However, we have (6, 3, 4, 5) which lets us know a 3 exists between 6 and 4 so when we merge the two candidates, we end up with (6, 3, 4, 5, 7). ## Additional example ## Input ``` 6 1 7 2 5 3 4 1 7 2 5 6 3 4 1 7 5 6 3 4 2 1 7 2 6 5 3 4 7 2 5 6 1 3 4 ``` ## Output ``` 1 7 2 5 6 3 4 ``` Doing it similar to the above, we get candidates ``` (3, 4) (5, 3, 4) (1, 7) (1, 7, 2) (5, 6) (1, 7, 2, 5) (6, 3, 4) (7, 2, 5, 6) (7, 2) ``` Some are obviously self-contained, so simplifying we get ``` (5, 3, 4) (1, 7, 2, 5) (6, 3, 4) (7, 2, 5, 6) ``` Then one is an obvious extension of the other, so we get ``` (1, 7, 2, 5, 6) (5, 3, 4) (6, 3, 4) ``` The first lets us know 5 goes before 6 and the other two say (3, 4) go after both 5 and 6, so we get ``` (1, 7, 2, 5, 6, 3, 4) ``` If you noticed, each of the items in a candidate can represent a vertex and an edge going from one item to another. Putting them all together will allow you to make a DAG. This is just the way I do it, there may be other and better ways to do it. [Answer] ### GolfScript, 44 characters ``` n/{~]}%:^0=.,{{{.3$?\2$?>}^%$2={\}*}*]}*" "* ``` The solution can be [tested online](http://golfscript.apphb.com/?c=OyI2IDQgNSA3IDMgMSAyCjMgNiA0IDUgNyAxIDIKNiAzIDQgNSAxIDIgNwo2IDMgNCA3IDEgNSAyCjYgMyAyIDQgNSA3IDEKIgoKbi97fl19JTpeMD0uLHt7ey4zJD9cMiQ%2FPn1eJSQyPXtcfSp9Kl19KiIgIioKCg%3D%3D). The algorithm is based on the fact, that the order in which two items can be may be reversed mostly twice: once when the first item is moved and once when the second is. Thus, in at least 3 out of the five cases the original order is preserved. ``` n/ # Split the input into lines {~]}% # and evaluate each line. :^ # We now have an array of arrays # which we save to variable ^ 0= # Take the first item of this list .,{{ # We now sort this list of items using bubble-sort # The following lines calculate the comparator { # For each line in the input .3$? # Determine position of first item \2$? # Determine position of second item > # Is first before/after second? }^% # End for each $2= # Take the middle element of the list. # (i.e. was first item most of the time # positioned after the second) {\}* # Swap if it was the case. }*]}* # End of bubble-sort loops " "* # Format output ``` ]
[Question] [ ## Description There will be a grid of `9x9`, where there will be placed `12` rocks. You will start at a starting-rock and walking with a starting-direction (north, south, west or east), whenever you see a rock, you have two options: * Climb over the rock and continue in the same direction * Change direction to your \*left \*NOT to the `west`, you change to your left as if you were walking and you take your own left. So the flow of the paths will always be `counter-clockwise`. Here is an example that illustrates the flow: ![enter image description here](https://i.stack.imgur.com/lVerT.png) Note: In this case, the starting-rock is the yellow `(X)` and the starting-direction is to the `south` --- ## Rules * The code must be able to solve it for any rock (if it doesn't have complete paths, then is 0) * You can NOT memorize anything different than the rocks used * The rocks must be included on the code (so you can't pass them by input) * We will use the above's rock placement in the competition * You chose how you will pick the starting-rock (Example: passing an array index or giving a xy location, etc) and how you chose the starting-direction (Example: 1=north, 2=south or etc) * It must return, print or otherwise make us know the total number of paths somehow for that given rock * Counted by characters used Just to immortalize the grid and rock placements in case the image dies for unknown reasons, I will put it in plain text: ``` 100100000 100100010 000000000 000000000 000000000 010010000 000000000 010100000 100010010 //rocks = 1, empty = 0 ``` --- ## Clarifications * You can't walk on the same part twice on the same path (crossing ways are allowed) * We need to be able to set on the input: a) the starting-rock and b) the starting-direction * The complete paths must end on the starting-rock * Note that it shouldn't be a problem whether we can climb over a starting rock or not, because it is impossible to this to happen with the current map and rules (we do have a four-path rock where this could happen, but after analysing it, this can't happen) * You are allowed to compress the 9x9 grid. (the most it can be compressed is to a 5x5 I think) [Answer] ## Python, 274 chars ``` S=7 D=-1j R=[0,4,7,1+1j,3+1j,1+3j,4+3j,7j,3+7j,7+7j,8j,3+8j] Z={} for i in range(4096): d=D;p=R[S];L=[] while len(L)<12: p+=d;P=[(abs(r-p),r)for r in R if r-p==abs(r-p)*d] if not P:break p=min(P)[1];d*=1j**(i>>R.index(p)&1);L+=[p] if p==R[S]:Z[tuple(L)]=1;break print len(Z) ``` The code I'm counting starts at the `R=[...`, the initial two lines are "input" which I didn't count. `R` is the set of rock coordinates, listed using complex number coordinates. `S` is the starting rock. `D` is the starting direction, again using complex numbers (1=right,-1=left,1j=up,-1j=down). The code tries all of the 2^12=4096 possibilities for go straight/turn left for each rock, then walks from the starting rock until it gets back to the starting rock, or there is no more rock on the path, or the path gets too long (it loops). It saves the path in `Z` if it is successful. [Answer] **ASM - WinXP Command shell .COM 128 bytes, source = 607 characters** To run, provide the rock id and the direction, e.g. ``` program c1 ``` where the letter is the rock (top left = a, bottom right = l) and the number is the direction: up = 3, left = 2, down = 1, right = 0 ``` mov bp,1000h mov di,bp mov cx,bp xor ax,ax rep stosw mov bl,b[82h] sub bl,'a'-1 mov bh,ch add bx,bx mov cl,b[83h] sub cl,48 shl cl,2 mov di,bx call l2 mov dx,bp add b[bp],48 mov b[bp+1],'$' mov ah,9 int 21h ret l1:inc b[bp] cmp di,bx je ret dec b[bp] cmp b[di+bp],0 jne ret call l2 sub cl,4 l2:mov dx,[di+l3-2] ror dx,cl and dx,15 jz ret mov b[di+bp],1 pusha mov di,dx add di,di call l1 popa mov b[di+bp],0 ret l3:xor al,b[bx+si] inc ax add w[si+09510],sp and ax,ax add al,087 add b[bx+si+0906],dh pusha add b[bx+si+0b],cl xor b[si],cl jpe l4 l4:pop bx ``` [Answer] ## JavaScript, 466 chars * Starting-direction is equal to: North=1, West=2, South=3, East=4 * The starting-rock is in row/column notation, where the upper-left is `11`. (the grid was compressed to a 5x5) The first two lines are input and aren't included in the count of characters, also I added some break lines to wrap the code. ``` D=3;//starting direction C=21;//starting rock function a(a){return a+="",(a[0]-1)*5+(a[1]-1)} function b(a){var b=!1,c=C+"";a==4?(h=c[0]+(c[1]-1))[1]>0&&(b=!0):a==3?(h=-(-c[0]-1)+c[1]+"")[0]<6&&(b=!0):a==2?(h=c[0]+ -(-c[1]-1))[1]<6&&(b=!0):(h=c[0]-1+c[1])[0]>0&&(b=!0);if(b)return C=h*1,!0} function c(){var c=C;while(b(D)&&F[a(C)]==0);if(C!=c&&F[a(C)]==1)return!0} function d(){if(c()){F[C]++;var a=D,b=C;C!=B?(d(),C=b,D=a,D==1?D=4:D--,d()):(A++,F=E)}} A=0,B=C,E=F="1010010101010100110010011".split(""),d(),alert(A) ``` Uncompressed and explained code: ``` dir=3; start=21; //transforms row-column notation to array index function toAV(a){ return a+="",(a[0]-1)*5+(a[1]-1); } //advance one square on the current direction //returns true when it succeed function walk(num){ var walkbol=false,str=xy+""; if(num==4){ if((wal_rec=str[0]+(str[1]-1))[1]>0){ walkbol=true; } }else if(num==3){ if((wal_rec=-(-str[0]-1)+str[1]+"")[0]<6){ walkbol=true; } }else if(num==2){ if((wal_rec=str[0]+-(-str[1]-1))[1]<6){ walkbol=true; } }else{ if((wal_rec=(str[0]-1)+str[1])[0]>0){ walkbol=true; } } if(walkbol){ xy=wal_rec*1; return true; } } //start walking on the current dir until a)didn't succeed walking or b)step on a rock //returns true when it moved at least once and it ended above a rock function nextRock(){ var str1=xy; while(walk(dir)&&map[toAV(xy)]==0){} if(xy!=str1&&map[toAV(xy)]==1){ return true; } } //if it finds a rock, it calls itself twice //one with the current direction and one with the direction to its left function splitways(){ if(nextRock()){ map[xy]++; var cc=dir,dd=xy; if(xy!=start){ splitways(); //-- xy=dd; dir=cc; dir==1?dir=4:dir--; splitways(); }else{ count++; map=xmap; } } } //globals count=0,xy=start,xmap=map="1010010101010100110010011".split(""); //start splitways(); alert(count); ``` ]
[Question] [ **Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers. --- **Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/3130/edit). Closed 6 years ago. [Improve this question](/posts/3130/edit) Write the shortest function that takes one string, and returns a regular expression that matches anything EXCEPT the input string, in parenthesis. Escape necessary characters like Perl [`quotemeta`](http://perldoc.perl.org/functions/quotemeta.html). ``` Input: helloworld Output: ([^h]|h[^e]|he[^l]|hel[^l]|hell[^o]|hello[^w]|hellow[^o]|hellowo[^r]|hellowor[^l]|helloworl[^d]) Input: */ Output: ([^\*]|\*[^\/]) ``` See also: * <http://yannesposito.com/Scratch/en/blog/2010-02-15-All-but-something-regexp/> * <http://shinkirou.org/blog/2010/12/tricky-regular-expression-problems/> [Answer] **Python, 49 chars** ``` import re f=lambda x:'(^(?!%s$).*$)'%re.escape(x) ``` The answer matches anything but the input. It gives an output using conditional groups so is suited for the problem: > > regular expression that matches anything EXCEPT the input string > > > The answer uses Howard's regex (fixing my regex) You can use the same approach on Perl with a few less chars: **Perl, ~~40~~ 38** ``` sub f{'(^(?!'.quotemeta(pop).'$).*$)'} ``` Examples: ``` f('hello') -> (^(?!hello$).*$) f('*/') -> (^(?!\*\/$).*$) ``` [Answer] # [Perl](https://www.perl.org/), 32 bytes ``` sub{qr/^\Q$_[0]\E\z(*COMMIT)a|/} ``` [Try it online!](https://tio.run/nexus/perl#U6lQsP1fXJpUXVikHxcTqBIfbRAb4xpTpaHl7O/r6xmimVijX/vfWkGlKDU9FahWQaVC105DPdE@SV3TmkslBiSiD2ToABlKOgpK1lwFRZl5JVD1MF56UWqBgj5ETF9HAawdRIFJMAHm2oNIMJEMU2GflAxWY58I5qpb/wcA "Perl – TIO Nexus") This is actually a general-purpose negator for any regular expression that doesn't use control flow commands. The basic idea is that we do `(*COMMIT)` ("if this doesn't match, nothing can"), followed by something that can't possibly match (a true general-purpose negator would use `(?!)`, but we can use just `a` in this context because we know it can't appear after the end of the string `\z`), in order to force a failure in cases where the initial regular expression matches; `|` then allows a success in all other cases. Out of the 31 bytes here: * `sub{`, `$_[0]`, `}` (10 bytes) handle I/O (because the original question asked specifically for a *function*); * `qr/^\Q`, `\E\z`, `/` (11 bytes) construct a regex that matches the string provided as input, and only that string (we return the regex as a regex object; a string would be 1 byte shorter, but the regex object happens to come with parentheses around it, as required by the question, and a string would require me to add parentheses manually); * `(*COMMIT)a|` (11 bytes) are the regex negator that we use to negate that regex. It's notable how much boilerplate there is here, and how the answer might be shorter if the question were more difficult (allowing the negation of arbitrary regexes, rather than just ones that match a single string). [Answer] JAVA 61 ``` String f(String w){return "^(?!"+Pattern.quote(w)+"$)(.*)$";} ``` ]
[Question] [ This includes tips for all related derivatives, as coding in these langs often primarily consists of writing the function in the lambda calculus and then compiling it down at the end. Among others, this includes tips for: * Standard combinator calculi + [SKI system](https://en.wikipedia.org/wiki/SKI_combinator_calculus) + [BCKW system](https://en.wikipedia.org/wiki/B,_C,_K,_W_system) * Esolang combinator calculi + [Iota](https://esolangs.org/wiki/Iota)/[Jot](https://esolangs.org/wiki/Jot)/[Zot](https://esolangs.org/wiki/zot) + [Lazy K](https://tromp.github.io/cl/lazy-k.html) Please post one tip per answer. We have one tips page already for binary lambda calculus [here](https://codegolf.stackexchange.com/questions/224871/tips-for-golfing-in-binary-lambda-calculus). However it only has one answer, and it's a tip for the general calculus; not binary specific. We'll have to decide if we want to keep that question open. [Answer] # Implementations on the Web For those who are into standard Lambda calculus/combinator calculus, it is a shame that it isn't easy to find an easy-to-use interpreter and converter, especially the ones available on a web page. Here are some that I know of. * [aditsu's interpreter](http://ski.aditsu.net) runs SKIBC expressions and outputs a reduced lambda term. * Ben Lynn has several interpreters and converters on their web site. Note that each one accepts slightly different syntax, so check out the example program(s). + [plain lambda calculus](https://crypto.stanford.edu/%7Eblynn/lambda/): evaluates lambda calculus expressions and shows the result in a raw form, like aditsu's. You can write auxiliary definitions. + [combinatory logic](https://crypto.stanford.edu/%7Eblynn/lambda/cl.html): takes a lambda term and converts to SK calculus. + [SK-based compiler](https://crypto.stanford.edu/%7Eblynn/lambda/sk.html): takes a lambda program (with auxiliary definitions), compiles to SK-based intermediate representation, and evaluates it to a Church numeral. + [Crazy L](https://crypto.stanford.edu/%7Eblynn/lambda/crazyl.html): takes a lambda program (with auxiliary definitions and predefined combinators) in various syntaxes, compiles to SKIBC intermediate form, and evaluates it to a Church numeral. This one apparently supports inputs too. Crazy L can be used to demonstrate simple programs in LC or SKI(BC), but also [used as its own language for golfing](https://codegolf.stackexchange.com/a/265032/78410). I'm planning to write one that can handle various I/O formats other than Church numerals, and can compile lambda expressions to SKI(BC) and BLC (and maybe another encoding of my own). I'll update when I get it to a usable state. ]
[Question] [ We all know and love the corpulent DDL expressions one can write in PostgreSQL with wording like `DEFERRABLE INITIALLY DEFERRED`, `ALTER FOREIGN DATA WRAPPER`, or even `DROP TEXT SEARCH CONFIGURATION`. But how far can one go? Here comes the definitive challenge for the longest DDL expression, with constraints of course. Mwahahaha! Rules: * The length of the submission is counted in Unicode codepoints. * Whitespaces are contracted to minimally necessary when counting. * The semicolon counts. * The submission must be a valid data definition expression in PostgreSQL 12 as described [in the relevant manual section.](https://www.postgresql.org/docs/current/ddl.html) * Optionally repeatable subexpressions (like column definitions in a `CREATE TABLE`) must not be repeated. * Every user-specifiable identifier only adds 1 towards the total length. So a table named `a` is worth the same as `aaa`. * Function call expressions add exactly 4 towards the total length, as if they were always of the form `f(x)`. * String constants only add as much towards the total length as if they were empty strings. * Numeric constants always add exactly 1 towards the total length, as if all you had were single digit integers. * Recursion is not allowed. For example, [the `SQL SELECT` statement defines the concept of a **from\_item**](https://www.postgresql.org/docs/12/sql-select.html) recursively, where a **from\_item** can be of the form **from\_item** [...] **join\_type** [...] **from\_item**. This is a recursive definition, and its usage is forbidden. This challenge disallows terms embedded in the same type of term, in any depth. Good luck, have fun. To kickstart your thoughts, here's a beatable example of length 106: ``` create function f(x) returns table(a float) as $$$$ language sql rows 1 immutable parallel safe leakproof; ``` [Answer] # PostgreSQL 12, [`CREATE TABLE`](https://www.postgresql.org/docs/12/sql-createtable.html), [482 chars](https://tio.run/##jZDJbsMwDER/ZY420D8oelAkOhGgxaCkLMfAzcFAtjpGf9@Voh6aWy8EQZAz8/j4Oo/zaVkkk4iEtfErYRDJ9p4FHxDFyhB0B@cjaK9DDJjRC446au/gO9zRDNjpuIHvyyxA5hJZaBcxgKkjJicpYEIztbAiyk2VyFZZQ5Gh7D2VPvVKPPvip8op1wROl3VzgLaWlC5LLza0lyYpQgrarTGWTIqChEvGBHSaQ6whb20Wq7vN0NZZ88AHvtvfY@0U7St56IWkDLzbZAY09@n0OQ7H@dT@I1@LzjO2wqSMXmwa61UyKeD6lr9iRfFhXNs/71wdwMKtS7SMZ0zBHG7n83Eeb9cSvSa8PPV8ivBahfI36a3VET1TIN4S2O/CC8L7svwA): ``` CREATE GLOBAL TEMPORARY TABLE IF NOT EXISTS table_name PARTITION OF parent_table (column_name WITH OPTIONS CONSTRAINT constraint_name REFERENCES reftable (refcolumn) MATCH PARTIAL ON DELETE referential_action ON UPDATE referential_action NOT DEFERRABLE INITIALLY IMMEDIATE CONSTRAINT constraint_name EXCLUDE USING index_method (column_name opclass DESC NULLS FIRST WITH operator) INCLUDE (column_name) WITH (storage_parameter = value) USING INDEX TABLESPACE tablespace_name WHERE (predicate) NOT DEFERRABLE INITIALLY IMMEDIATE) FOR VALUES WITH (MODULUS numeric_literal, REMAINDER numeric_literal) PARTITION BY RANGE (column_name COLLATE collation opclass) USING method WITHOUT OIDS ON COMMIT PRESERVE ROWS TABLESPACE tablespace_name; ``` # How? To produce the largest possible DDL query in PostgreSQL 12, I wrote a [script](https://gist.github.com/Ajax12345/f56564d21cbf5c43015f26dc46927165) that does the following: 1. Navigates to the full list of PostgreSQL 12 [commands](https://www.postgresql.org/docs/12/sql-commands.html). 2. For each command, extracts its synopsis. 3. Parses the synopsis into an Abstract Syntax Tree. 4. Traverses the Abstract Syntax Tree, producing all queries, pruning branches for rudimentary optimization by choosing the longest keywords. 5. For the generated queries, finds the maximum by condensing non-keyword identifiers down to a single character, eliminating unnecessary whitespace, etc. ]
[Question] [ # Challenge **Given an array of positive integers and a threshold, the algorithm should output a set of consecutive-element-groupings (subarrays) such that each group/subarray has a *sum greater than the threshold*.** # Rules The solution should honor **two additional criteria**: * be of highest cardinality of the groups (i.e. highest number of groups) * having the maximum group-sum be as lowest as possible. # Mathematical Description: * input array \$L = [l\_1, l\_2, ..., l\_n]\$ * threshold \$T\$ output groups/subarrays \$G = [g\_1, g\_2, ..., g\_m]\$ where: * \$m \leq n\$ * \$\bigcap\limits\_{i=1}^m{g\_i}=\varnothing\$ * \$\bigcup\limits\_{i=1}^m{g\_i}=L\$ * if we denote the sum of elements in a group as \$s\_{g\_i} = \sum\limits\_{l \in g\_i}l\$, then all groups have sum greater than threshold \$T\$. In other words: \$\underset{g \in G}{\operatorname{min}}{\{s\_g\}} \ge T\$ * if cardinality \$|g\_i|=k\$, then \$g\_i=[l\_j, ..., l\_{j+k-1}]\$ for an arbitrary \$j\$ (i.e. all elements are consecutive). * optimal solution has highest cardinality: \$|G\_{opt}| \ge \max\left(|G| \right),\,\,\forall G\$ * optimal solution \$G\_{opt}\$ has lowest maximum group-sum: \$\underset{g \in G\_{opt}}{\operatorname{max}}{\{s\_g\}} \le \underset{g \in G}{\operatorname{max}}{\{s\_g\}}, \,\,\, \forall G\$ # Assumption for simplicity, we assume such a solution exists by having: \$\sum\limits\_{i=1}^n l\_i \ge T\$ # Example: **Example input:** ``` L = [1, 4, 12, 6, 20, 10, 11, 3, 13, 12, 4, 4, 5] T = 12 ``` **Example output:** ``` G = { '1': [1, 4, 12, 6], '2': [20], '3': [10, 11], '4': [3, 13], '5': [12], '6': [4, 4, 5] } ``` # Winning Criteria: 1. Fastest algorithm wins (computational complexity in \$O\$ notation). 2. Additionally, there might be situations where an element \$l\_i >\!\!> T\$ is really big, and thus it becomes its own group; causing the maximum subarray sum to be always a constant \$l\_i\$ for many potential solutions \$G\$. Therefore, if two potential solutions \$G\_A\$ and \$G\_B\$ exists, the winning algorithm is the one which results in output that has the **smallest** max-subarray-sum amongst the **non-intersecting groups**. *In other words*: if we denote \$G\_{A \cap B}=\{g\_i: \,\, g\_i \in G\_A \cap G\_B\}\$, then optimum grouping, \$G\_{opt}\$, is the one that has: $$\underset{g \in \mathbf{G\_{opt}} - G\_{A \cap B}}{\operatorname{max}}{\{s\_g\}} = \min\left( \underset{g \in \mathbf{G\_A} - G\_{A \cap B}}{\operatorname{max}}{\{s\_g\}}\, , \,\,\underset{g \in \mathbf{G\_{B}} - G\_{A \cap B}}{\operatorname{max}}{\{s\_g\}} \right)$$ [Answer] # [Java (JDK)](http://jdk.java.net/), 1248 bytes ``` import java.util.ArrayList; import java.util.Arrays; import java.util.List; class TestCG{ public static void main(String [] args) { int [] input = new int[] {1,4,12,6,20,10,11,3,13,12,4,4,5}; int threshold = 12; List<List<Integer>> groups = new ArrayList<>(); int currentGroupSum = 0; int previousGroupSum = 0; int maxGroupSum = 0; int boundaryValue = 0; List<Integer> currentGroup = new ArrayList<>(); for(int i=0; i<input.length; i++) { currentGroup.add(input[i]); currentGroupSum+=input[i]; if(currentGroupSum>=threshold) { if(i<input.length-1) { boundaryValue = input[i+1]; } if(currentGroupSum>maxGroupSum) { maxGroupSum = currentGroupSum; } if(currentGroupSum > previousGroupSum && (currentGroupSum - boundaryValue)>=threshold) { groups.get(groups.size()-1).add(boundaryValue); currentGroup.remove(0); } previousGroupSum = currentGroupSum; currentGroupSum = 0; groups.add(currentGroup); currentGroup = new ArrayList<>(); } } System.out.println(groups.size()); for(List<Integer> group : groups) { System.out.println(group); } } } ``` [Try it online!](https://tio.run/##dVRNb6MwED07v8KnChSCQtrdQ0mQqh6qlXrLai9VD25wiVOwkT@yzVb57VnbmDQ2hICBmTfzxm@G7NAezXblx@lEmpZxCXfakCpJ6vSBc3R4JkLmk3GfGHF0@E2NhIC/sZCPT18T0Kq3mmygkEjq256REjaI0GgtOaEVfHmFiFcihhoKCJXGQGirJFxBiv/qZ6ktX1lyl2SL5GeymCeZPrPkNslujelO/34ccxcttxyLLatLHZ4tjNUUtbTLLypxhXlRwIoz1QrHcN7qsohiE@FSbRTnmMong12rRqPnPUvL8Z4wJUKfczfocyzqjSlaIn74g2qFe4dXmcepEVfre2c8MinJap5DsrSCpTWmldzq9@m0kxNcpktRWUYW@EJebR4Q7HC66t3Way7yHgWgYnWW2JEYkF/CLOtdINyzY5hmHQc42rVPE3JdCHnO6IsbRHhJYXAMCWAxbOXNDRzAZn7v4kAEODgGJtCNXFphGblHQf7hKNZa2c74BPkwgddLjhu2x9F8BHih6MiYjur1vVyZedCXbyq9xHRzBIKxHZ1a2xVzrQ9C4iZlelxa/Rcga@orEufge8j9z8Pi4L37ft1IXMtnWTXhcTI5nk7/AQ "Java (JDK) – Try It Online") Complexity O(n) [Answer] # [Prolog](https://github.com/mthom/scryer-prolog): \$ O(n^2) \$, 785 bytes ``` :- use_module(library(clpz)). :- use_module(library(lists)). sum(Ls, S) :- sum_(Ls, 0, S). sum_([], S, S). sum_([L|Ls], S0, S) :- S1 #= L + S0, sum_(Ls, S1, S). solve([], _, _, []). solve(Ls, T, M, Ms) :- T > 0, solve_(Ls, T, M, [], Ms1), reverse(Ms1, Ms). solve_([], _, _, Ms, Ms). solve_(Ls, T, M, Ms0, Ms) :- append(As, Bs, Ls), As = [_|_], sum(As, S), S #>= T, S #=< M, solve_(Bs, T, M, [As|Ms0], Ms). solution(Ls, T, Ms, M) :- solution_(Ls, T, Ms, sup, M). solution_(Ls, T, Ms, M0, M) :- M1 in 0..M0, solve(Ls, T, M1, _), !, clpz:fd_get(M1, from_to(n(M2), _), _), M3 #= M2 - 1, ( solution_(Ls, T, Ms, M3, M), ! ; end_(Ls, T, Ms, M2, M) ). end_(Ls, T, Ms, M, M) :- solve(Ls, T, M, Ms). ``` To run it: ``` ?- solution([1, 4, 12, 6, 20, 10, 11, 3, 13, 12, 4, 4, 5], 12, Ms, M). Ms = [[1,4,12,6],[20],[10,11],[3,13],[12],[4,4,5]], M = 23. ?- ``` ]
[Question] [ **This question already has answers here**: [Given an input, move it along the keyboard by N characters](/questions/50336/given-an-input-move-it-along-the-keyboard-by-n-characters) (9 answers) Closed 4 years ago. You are in fact writing an interpreter for the language "Wrong keyboard position". You can pretend that you are not doing this and just follow the instructions below. --- I typr re;atively accuratrly, but so,etimes I made a whole nlock of text illegible by shifting a key right. So I need a program that corrects my text back to its original meaning. ## Rules * You have to *left* shift on a standard English QWERTY keyboard. * Whitespace do not count for the procedure before left-shifting and are kept as-is in a standard left-shifting procedure. If the key is the leftmost letter/symbol on a keyboard(i.e. `The ~key, Q key, A key, Z key.`), the key is kept as-is. If you reach a control character while left-shifting (`Caps lock and Shift`), their effects will not be triggered and the character before left-shifting is kept. * This is a [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") contest; the shortest answer wins. * Both the input and the output shall be given via our [default methods](https://codegolf.meta.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods). ## Representation of a subset of the QWERTY keyboard that you will need The two lines connected are possible values of the key: shifted/unshifted. ``` ~!@#$%^&*()_+ `1234567890-= QWERTYUIOP{}| qwertyuiop[]\ ASDFGHJKL:" asdfghjkl;' ZXCVBNM<>? zxcvbnm,./ (Space) (Space) ``` ## Input The input will always be a non-empty string conforming the rules above. ## Output The output will be the input string corrected to the originally intended meaning. ## Examples: ``` Yjod ,sfr yjr, imjsppu/ -> This made them unhaooy. vpfr hp;g -> code golf ``` [Answer] # [05AB1E](https://github.com/Adriandmen/05AB1E), 59 bytes *-1 byte thanks to Kevin Cruijssen* ``` žVDu«1ú`žhÀ“~!@#$%^&*()_+ `ÿ-=ÿ<>?ÿ:"ÿ{}|ÿ,./ÿ;'ÿ[]\“#vy¦y‡ ``` [Try it online!](https://tio.run/##AW8AkP9vc2FiaWX//8W@VkR1wqsxw7pgxb5ow4DigJx@IUAjJCVeJiooKV8rIGDDvy09w788Pj/Dvzoiw797fXzDvywuL8O/OyfDv1tdXOKAnCN2ecKmeeKAof//WWpvZCAsc2ZyIHlqciwgaW1qc3BwdS8 "05AB1E – Try It Online") ]
[Question] [ ## General rules The universe of the Game of Life is an infinite two-dimensional orthogonal grid of square cells, each of which is in one of two possible states, alive or dead. Every cell interacts with its eight neighbours, which are the cells that are horizontally, vertically, or diagonally adjacent. At each step in time, the following transitions occur: * Any live cell with fewer than two live neighbours dies, as if caused by underpopulation. * Any live cell with two or three live neighbours lives on to the next generation. * Any live cell with more than three live neighbours dies, as if by overpopulation. * Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction. The initial pattern constitutes the seed of the system. The first generation is created by applying the above rules simultaneously to every cell in the seed—births and deaths occur simultaneously. The rules continue to be applied repeatedly to create further generations. (Source: [Wikipedia](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life) ) --- ## Specific rules For this challenge, we will modify a few rules: * The grid is not infinite. We will provide in the inputs the size of the grid. It will **not** act as a Torus either. * The game stops when the grid reach a state it has already reached before. This prevents patterns infinite loop and can manage empty grids too. --- ## Challenge Write a program/function that takes four positive integer as input: * `x`: starting pattern width * `y`: starting pattern height * `n`: grid width * `m`: grid height and finds the starting pattern that will generate the most amount of cells through the whole game, and outputs that number. (You can also outputs the corresponding pattern if needed) The patterns is always centered on the grid. If you need to center with odd numbers, the pattern should be slightly closer to the upper left corner. Refer to that drawing for better understanding where the green area is the pattern already centered: [![Good centering](https://i.stack.imgur.com/AxVk1.png)](https://i.stack.imgur.com/AxVk1.png) --- ## Specifications * Standard I/O rules apply. * Standard loopholes are forbidden. * This challenge is not about finding the shortest approach in all languages, rather, it is about finding the shortest approach in each language. * Your code will be scored in bytes, usually in the encoding UTF-8, unless - specified otherwise. * Explanations, even for "practical" languages, are encouraged. --- ## Example Let's do a small example together. For this example, the pattern size will be `x = y = 3` and the grid size will be `n = m = 3` The program will test any possible starting pattern. After running it, we find that the maximum amount of generated cells during one whole game is `11`. It is obtained following those steps: [![Game of life](https://i.stack.imgur.com/m5M1v.png)](https://i.stack.imgur.com/m5M1v.png) Green cells are alive, lime cells are newborn and brown cells just died. One out of two grid is just the transition between two states. The starting pattern is the first state of the game, in the upper left corner. The game ended when there was no living cells left, but most of the time the game end with a repeating infinite pattern. Here we can get to `11` by counting every lime cells during the transitions. It corresponds to the total amount of generated cells through the whole game. --- ## Test cases ``` Input Output 3 3 3 3 11, *[[0, 0, 1], [1, 1, 0], [0, 0, 1]] 3 3 5 5 46, *[[0, 0, 1], [1, 1, 1], [0, 0, 1]] 3 3 12 12 596, *[[1, 0, 1], [1, 1, 1], [1, 1, 1]] 2 3 6 3 18, *[[0, 1], [1, 1], [0, 1]] 3 2 5 5 34, *[[0, 1, 0], [1, 1, 1]] 4 4 9 9 1067, *[[1, 0, 1, 1], [1, 1, 0, 1], [0, 0, 0, 1], [1, 0, 1, 1]] ``` \* *not needed, just here to help you debugging* Good luck.. --- ## Disclaimer *Thank you @totallyhuman for your Fibonacci Sequence post, from which I borrowed the presentation style. I found it very clear and I hope you don't mind me using the same layout ;)* > > This challenge differs from basic Game of Life implementation since > it asks to test out every starting pattern possible, count the number of > generated cells for each of those and check for infinite repeating > pattern. > > > [Answer] # Pyth, ~~65~~ 63 bytes ``` M}3-BGHeSm+F.n<VVM.:.ugVVuCmsM.:++0k03G2NNd)2muCm.[Hk0GQd^^U2EE ``` [Test suite](https://pyth.herokuapp.com/?code=eSm%2BF.n%3CVVM.%3A.umm%7D3-BFbCkC%2CuCmsM.%3A%2B%2B0k03G2NNd%292muCm.%5BHk0GQd%5E%5EU2EE&test_suite=1&test_suite_input=3%2C3%0A3%0A3%0A5%2C5%0A3%0A3%0A6%2C3%0A2%0A3%0A5%2C5%0A3%0A2&debug=0&input_size=3) Input is taken as: ``` n,m x y ``` On the input `3,3,12,12`, I got 594, not 596, with the same grid as the OP, so I'm not sure what's up. **How it works:** `^^U2EE`: Generate all possible patterns `muCm.[Hk0GQd`: Pad them to the appropriate size. Written as pad, rotate, repeat. `uCmsM.:++0k03G2N`: Generate the number of live neighbors for each cells. Written as pad, take subsequences of size 3, sum them, rotate, repeat. `M}3-BGH ... gVV ... N`: Pair that with the original grid, use both to calculate the new cells. We do this by checking whether live neighbors including the center, optionally minus whether it was alive, contains a 3. I really like this `VV` trick, so I wrote a helper function (`M}3-BGH`) so I could do it twice. (see below) `.u ... d)`: Do that until it stops changing, return all intermediate steps. `.: ... 2`: Take all consecutive pairs. `<VVM`: Map each pair to the number of new cells born. I'm particularly proud of `<VVM`, I thought that was very clever. `m+F.n`: Map each grid to its total number of cells born. `eS`: Max ]
[Question] [ [From the sandbox](https://codegolf.meta.stackexchange.com/a/12727/60951)! I2c or TWI, is a 2 way stream that uses 2 signal lines: `SDA` and `SCK`. This is used in sensors to communicate between a master and a slave. So, how does this work? Well, here's the boilerplate: ## Input: 1 I2c command represented by 2 strings where `-` is a high signal, and `_` is low. `SDA` is always the first string. ## Output: The debug info for that command, including weather it's a `READ` or `WRITE`, which address it's to (in Hex), and what memory the signal's addressing(in Hex). if the transmission is invalid, print "Invalid" ## How does I2c work, then? [![enter image description here](https://i.stack.imgur.com/4DDWo.png)](https://i.stack.imgur.com/4DDWo.png) Image from Sparkfun! An i2c request has 2 9-bit parts. the address and the payload. The address comes first. A bit is only `READ` when the clock signal goes from `LOW` to `HIGH`. Going from `HIGH` to `LOW` is not a valid reading event. The address is 7 bits, which come after both `SDA` and `SCL` are `LOW`. This is sent by the master. After the 7th bit, the next is sent by the master, which is the `READ` Bit. If this bit is `HIGH`, then it's a `READ` operation, if the bit is `LOW`, then it's a `WRITE` operation. After the 8 bits, the slave responds with an ACK bit, if the ACK bit is `HIGH`, then the entire transmission is invalid. Then, the second transmission is sent. The first 8 bits represent the data address that the master is `READ`ing or `WRITE`ing. and the final bit is the 2nd ACK bit. If this bit is `HIGH`, then the entire transmission is invalid. ## Examples: ``` Raw IN: ["--____--__----__----__----__--__--__","___-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-"] SDA: --____--__----__--__--__----__--__--__ SCK: ___-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- Result: 0 0 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1 0 Parse: addr[22] op:[R] data:[181] success[yes] out: address:0x16 op:Read data:0xB5 Raw IN: ["--____--__----__------__----__--__--__","___-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-"] SDA: --____--__----__------__----__--__--__ SCK: ___-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- Result: 0 0 1 0 1 1 0 1 1 1 0 1 1 0 1 0 1 0 Parse: addr[22] op:[R] data:[181] success[No] out: invalid Note: (the ACK bit flipped high); Raw IN: ["--_-_--__--_-__--_-_-__-_-_-_--__--__-","___-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-"] SDA: --_-_--__--_-__--___-__-_-_-_--__--__- SCK: ___-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- Result: 0 0 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1 0 Parse: addr[22] op:[R] data:[181] success[yes] out: address:0x16 op:Read data:0xB5 Note: (the bit before the change is read.); Raw IN: ["--_____--___-----___--___--___-----__---____--____","___--_-_--_--_-_--_-_--_-_--_-_--_-_--_-___-_--__-"] SDA: --_____--___-----___--___--___-----__---____--____ SCK: ___--_-_--_--_-_--_-_--_-_--_-_--_-_--_-___-_--__- Result: 0 0 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1 0 Parse: addr[22] op:[R] data:[181] success[yes] out: address:0x16 op:Read data:0xB5 Note: (Clock signals Don't have to be perfect.); Raw IN: ["--_____--___-----___--___--___-----__---____--____","___---_-_--_-___-_--__-"] SDA: --_____--___-----___--___--___-----__---____--____ SCK: ___---_-_--_-___-_--__- Result: 0 0 1 0 1 0 1 Parse: Invalid out: invalid Note: (They do however, have to match the length of the data dignal.); ``` ## Extra rules: The `0x` prefix must be appended to all hex values in the output, as a formality. The input is strictly `-` for `HIGH` and `_` for `LOW`, and will always be 2 separate strings with a separator character. If both `SDA` and `SCL` change at the same time, then the previous bit is read. This is a code golf, so whoever creates a running program in the least number of bytes wins! Good luck [Answer] # GNU sed, ~~427~~ ~~378~~ 364 + 1 = ~~428~~ ~~379~~ 365 bytes +1 byte for `-r` flag. Takes colon-separated input. Output format is e.g. `a0x16oRd0xB5`, where `a` precedes the address, `o` precedes the operation (`R` or `W`), and `d` precedes the data. Why do I do this to myself? ``` s/^/:/ :Q s/:.+:$|::./E/ s/:(.).(.*):_-/\1:x\2:x/ s/:./:/g tQ s/(.{7})(.)(.)(.*)(.):/#\3\1%\2#\5\4:/ /#-|E/{z;iinvalid q} s/#./#/g :R s/[:%]/!u0;%0123456789ABCDEF,/ :A s/((-)|_)!/!\2/ s/!-(u+)(.+);/!\1\2;\1/ : /u%/!bZ s/F;/;0/ t s/(.);(.*%.*\1)(.)/\3\2\3/ s/u;/u1/ s/u(u*)%/;\1%/ b :Z s/!(u+)/!\1\1/ /#!/!bA s/#!u+(.+);.+,/\1/ /:/bR s/(..)(.)/a0x\1o\2d0x/ y/-_/RW/ ``` [Try it online!](https://tio.run/##bVBdT8IwFH3vv1hmk3WjvWsB0dsnVHiXFxOtLiwYs8SAOmpQ4K87b7sYXmya3u9zTm/7vOq6Fp4AgeEtawFVgWcHRAUzCGGmhMpULrCS4DTunMFdLCgaeWHbMJOp/eQoqDPePBiE1A2d5s6kbuxGhA6pPMxg/22bZv25fG1W7P1Is6mClHBwQf4D8kdIfGl5qc1wND6fXFxOr65vZvMBqZsGpkyKQyUSSJwJKhKZ@YL4CmEppZ2xTlMrA88hqe@pY27BlsC2UaawJI@r3OmgEUihccOA4y14HZ3M54IDwXBgNcMAkQSOCK/DN4i8DlrSxBeRWRUDiCWEehF54iZgWe6c3jizKmljXyArWNxB10lZhRONDOcUnDJ9uk9V2HsyPn/236fqnUr@bN62zWbddvLjFw "sed – Try It Online") ## Explanation The code works in two phases. In phase 1 we turn the two signals into a single binary string. This is the easy part. ``` # Prepend a `:` s/^/:/ :Q # Check for length mismatch (one string exhausted before the other) s/:.+:$|::./E/ # If the first two characters of SCK are `_-`, record first character of SDA # and discard second; replace each pair with `x` so we can unconditionally... s/:(.).(.*):_-/\1:x\2:x/ # ...consume a character from each signal s/:./:/g # If we did a substitution, branch to :Q tQ ``` If this was our input: > > > ``` > --_____--___-----___--___--___-----__---____--____:___--_-_--_--_-_--_-_--_-_--_-_--_-_--_-___-_--__- > > ``` > > ...we now have this: > > > ``` > __-_--_-_-_--_-_-_: > > ``` > > Before phase 2, we reformat this to make it a little easier to work with: ``` # Reformat `.......ma........b:` to `#a.......%m#b........:` s/(.{7})(.)(.)(.*)(.):/#\3\1%\2#\5\4:/ # Check if ACK high or length mismatch; if either, print error and quit /#-|E/{z;iinvalid q} # Delete ACK bits s/#./#/g ``` Now we have: > > > ``` > #__-_--_%-#-_--_-_-: > > ``` > > In phase 2, we convert each run of `_` and `-` (0 and 1) to a hexadecimal number. Because sed doesn't do math, this is almost half of the code. It actually takes each binary digit, converts it to unary, and then increments the hexadecimal number once for each unary digit. ``` :R # Initialize: u = magnitude (unary 1); 0 = running sum (decimal); lookup table s/[:%]/!u0;%0123456789ABCDEF,/ :A # Take the least-significant bit; if it's 0 drop it s/((-)|_)!/!\2/ # If 1 (-), remove it and copy current magnitude (`u+`) after `;` s/!-(u+)(.+);/!\1\2;\1/ # Increment number for each `u` after `;` # e.g. 12;uu -> 13uu -> 13;u -> 14u -> 14; : # No more `u`s, branch to :Z /u%/!bZ # Carry: 1F;u -> 1;0u -> 20u -> 20; s/F;/;0/ t s/(.);(.*%.*\1)(.)/\3\2\3/ s/u;/u1/ # Drop a `u`; branch to `:` s/u(u*)%/;\1%/ b :Z # Double magnitude: !uu3 -> !uuuu3 s/!(u+)/!\1\1/ # If there are binary digits left, branch to :A /#!/!bA # Clean up s/#!u+(.+);.+,/\1/ # Branch to :R for the second number /:/bR # Format output s/(..)(.)/a0x\1o\2d0x/ y/-_/RW/ ``` Before formatting, we have: > > > ``` > 16-B5 > > ``` > > All that remains is to add a prefix to each hexadecimal number change the operation (`-` or `_`) to read (`R`) or write (`W`), giving us: > > > ``` > a0x16oRd0xB5 > > ``` > > ]
[Question] [ # Background The tabs versus spaces war in programming has been going on a long time, basically because spaces are too low-level to have all the properties you'd want for alignment and indentation, but tabs can't be relied upon to work in all contexts (with some programs optimizing the use of tabs for indentation whilst making them unusable for tabulation, some optimizing the use of tabs for tabulation whilst making them mostly unusable for indentation, and pretty much all programs unable to reasonably use tabs for alignment). A proposed solution was that of *elastic tabstops*; basically a method of dynamically adapting the meaning of a tab character so that it would be usable for indentation, tabulation, *and* alignment. The idea is that a tab in one line tabs to the same place as the corresponding tabs in neighbouring lines (if any exist), stretching if necessary to make the columns line up. Unfortunately, very few programs support them by default, meaning that they aren't widely used. (If only the "elastic tab" character were in Unicode!) In this task, we're bringing elastic tabstops to the world of codegolf. # The task ## Brief description Replace tabs with a minimal number of spaces, in such a way that for each *n*, the rightmost end of the *n*th tab on any given line is the same as the rightmost end of the *n*th tab on the neighbouring lines (assuming those tabs exist), and such that tabs tab to positions at least two spaces apart. ## Precise description Write a program or function whose input and output are multiline strings (you may take these as lists of single-line strings if you prefer). The input and output should be identical, except that each tab character (ASCII/Unicode 9) must be replaced with one or more spaces, subject to the following conditions: * Create a list of numbers corresponding to each line of output (its *tabstops*); specifically, for each tab character that was expanded on that line, take the column number of the last space that was expanded from that tab (here, "column number" = the number of characters on that line up to and including that character). So for example, if you expanded `a␉b␉c` to `a b c`, the list would be `[4,7]`. The lists must have the following properties: + For each pair of consecutive lines, one of those lines' tabstops list must be a prefix of the other's (a list is a prefix of itself, e.g. `[4,7]` and `[4,7]` is OK, as are `[4,7,9]` and `[4,7]`, as are `[4]` and `[4,7]`, but `[4,5]` and `[4,7]` would not be allowed). + For each number in each list, it must be greater by at least 2 than the number to its left (if it's the first element, treat the hypothetical "zeroth element" to its left as having a value of 0). (We're using a value of 2 for the purposes of this challenge because it gives good results for tabulation and alignment and decent results for indentation. Sorry, 4-space or 8-space indentation fans.) * The answer produced must be as short as possible while complying with the above restriction. ## Example ## Input `␉` represents a literal tab character, because literal tabs don't show up well on Stack Exchange. ``` // Elastic tabs handle indentation... { ␉foo; ␉{ ␉␉bar; ␉} } // alignment... int␉foo␉(int), ␉bar␉(void), ␉baz; float␉quux␉(float), ␉garply; // tabulation... ␉1␉2␉3␉4 1␉1␉2␉3␉4 2␉2␉4␉6␉8 3␉3␉6␉9␉12 4␉4␉8␉12␉16 // and all three at once. while True: ␉numbers␉=␉one␉and␉two ␉␉and␉three␉or␉four ``` ## Output I've added extra information to the right of this output to show the tabstops on each line. Those aren't part of the expected output, they're just there to help explain what's going on. ``` // Elastic tabs handle indentation... [] { [] foo; [2] { [2] bar; [2,4] } [2] } [] // alignment... [] int foo (int), [6,10] bar (void), [6,10] baz; [6] float quux (float), [6,11] garply; [6] // tabulation... [] 1 2 3 4 [2,4,6,9] 1 1 2 3 4 [2,4,6,9] 2 2 4 6 8 [2,4,6,9] 3 3 6 9 12 [2,4,6,9] 4 4 8 12 16 [2,4,6,9] // and all three at once. [] while True: [] numbers = one and two [2,10,14,20,24] and three or four [2,10,14,20,24] ``` # Clarifications * The input won't contain a tab character at the end of a line (basically because this is an uninteresting case which wouldn't make a visual difference to the output). * The input will only contain printable ASCII (including space), plus newline and tab. As such, it's up to you whether you treat the input as bytes or characters; the two will be equivalent. * This is, in its spirit, a challenge about formatting output for display on the screen. As such, this challenge uses the rules for [ascii-art](/questions/tagged/ascii-art "show questions tagged 'ascii-art'") challenges (e.g. you're allowed to output a string out of order via the use of terminal cursor motion commands if you wish), even though it technically isn't about ASCII art. * Despite the previous point, outputting the answer via displaying it on the screen isn't necessary (although you can certainly output like that if you want to); you can use any method of outputting a string that PPCG allows by default (e.g. returning it from a function). * The input will not contain trailing whitespace (except for, if you wish, a single trailing newline). Trailing whitespace on the output will be irrelevant from the point of view of correctness (i.e. you can add trailing whitespace or leave it off, it doesn't matter). Again, this is because it wouldn't show up on a screen. # Victory condition This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so shorter is better. [Answer] # [Retina](https://github.com/m-ender/retina), ~~132~~ 130 bytes ``` +m`(^| ) $1 {+sm`^(([^ ¶])*)( .*^(?<-2>[^ ¶])*(?(2)(?!))[^ ¶]+ ) $1 $3 +sm`^(([^ ¶])* .*^(?<-2>[^ ¶])*(?(2)|(?!))) $1 %1` ``` [Try it online!](https://tio.run/nexus/retina#dY9NbsIwEEbXM6dwJZBsaBMlIERJaVY9QburGsX5gURKbJo4pS1wHY7AAXIxOgmii0pd@c34e/ZMe8L2iM9he@T@0rYFDjkxtqfzuAx5sAcBOHAY4G5cl2HA@WsA7elNjAQHaxRw/@HOfbz2uM9dwf0bIS6dMYhOHkzwj/yPuu/d649DJwRk57Nts6dC1iaPmZFRzTKpkiJluUpSZaTJtbIsC3cIK609BAKIZEV0wAOSLIt8rUrKdrFcmS4HnEDcYpcE/qHz5FJ8e7gqtDTw3jSfwHvubtay2hRfHm6aqMjjBcQZebHXPU8zNcXvGOCACxOYovNLLp1TmMEcJ1TP4B4cF6fUmhOAM@tnVAnNWTCTVWnKpGFaxamF2yynTV@qJl0gqKaM0qqGJWiVAhlgtpqW7anzQFe0W1P9AA "Retina – TIO Nexus") Link includes test suite. Explanation: ``` +m`(^|␉)␉ $1␠␉ ``` Insert spaces before leading tabs and between consecutive tabs. This ensures tabs are at least two spaces apart. Then while tabs still exist: ``` { Repeat these stages until all tabs have been processed + Repeat this stage until the first line has the longest indentation sm`^(([^␉¶])*)(␉ Look for a line with a tab .*^ Look for another line (?<-2>[^␉¶])*(?(2)(?!))[^␉¶]+␉) With more indentation $1␠$3 Add indentation to the first line ``` Find the line with the most text before a tab and add spaces to the first line until it aligns. (If the first line already has the longest indentation, this might add spaces to another line, but the next stage would have added them anyway.) ``` + Repeat this stage until all lines have the same indentation sm`^(([^␉¶])*␉ Look for a line with a tab .*^ Look for another line (?<-2>[^␉¶])*(?(2)|(?!)))␉ With less indentation $1␠␉ Add indentation to that line ``` Add spaces to the remaining lines until they all align. ``` %1`␉ ␠ ``` Replace the first tab on each line with a space. ]
[Question] [ ## Challenge Given a plot with broken paths, return the plot with all paths connected in the minimum number of changes. ## Explanation This problem deals with graphs on the Cartesian plane. Every node has 8 possible edges, extending vertically, horizontally, or diagonally. Each direction is represented by a number 0-7 as follows: ``` 0 7 1 6 X 2 5 3 4 ``` In other terms: ``` 0 = North 1 = Northeast 2 = East 3 = Southeast 4 = South 5 = Southwest 6 = West 7 = Northwest ``` A "broken path" occurs when one node has an edge that would reach another node, but the node it reaches toward does not have the corresponding path to reach it. For example, assume we have nodes A, B, C, and D laid out as: ``` AB CD ``` If node A has the path 2 and all the other nodes have no paths, then there is a broken path between nodes A and B. This can be resolved in one of two ways: * Removing path 2 from A * Adding path 6 to B In this case, it does not matter which way you choose to resolve the conflict, because either way results in 1 node being changed. This first example can be illustrated as follows (`*` represents nodes): ``` Original: *- * * * First method: * * * * Second method: *--* * * ``` If node A has path 3, B has path 4, C has path 2, and D has no paths, the paths from A to D, B to D, and C to D are all broken. This can be resolved in one of two ways: * Removing path 3 from A, 4 from B, and 2 from C * Adding paths 6, 7, and 0 to D In this case, adding to node D is the optimal choice, because it results in 1 node being changed rather than 3. It does not matter how many paths get changed when you change a node; the optimal method is determined by how many nodes get changed. This example can be illustrated as: ``` Original: * * \ | *- * Suboptimal method: * * * * Optimal method: * * \ | \| *--* ``` ## Input A 2D matrix of bytes, where each bit represents whether that path is present in the node. 7 represents the most significant bit, and 0 the least significant; in other words, the bits are given in the order `76543210`. For example, the first scenario given above would be: ``` 0b00000010 0b00000000 0b00000000 0b00000000 ``` The second scenario given above would be: ``` 0b00000100 0b00001000 0b00000010 0b00000000 ``` You may take in these values as strings in the base of your choice, or integral types with the width of your choice (e.g. if your language supports a `byte` or `char` type, you may still use `int` if you so choose), but include your choice in your answer. ## Output You should either write a function that returns the corrected map or a program that prints it. Your output format should be the same as your input format. ## Test Cases These are just one example of correct output; valid output with the same number of values changed is also accepted. ``` [[0x04, 0x00], [0x00, 0x00]] -> [[0x04, 0x40], [0x00, 0x00]] [[0x08, 0x10], [0x04, 0x00]] -> [[0x08, 0x10], [0x04, 0xC1]] [[0x04, 0x10, 0x00], [[0x10, 0x10, 0x00], [0x01, 0x80, 0x10], -> [0x01, 0x09, 0x10], [0x00, 0x00, 0x81]] [0x00, 0x00, 0x81]] Or -> [[0x18, 0x10, 0x00], [0x01, 0x89, 0x10], [0x00, 0x00, 0x81]] ``` The first two test cases are illustrated above. The third test case can be illustrated as: ``` Original: *- * * | | \ * * * | \| * * * Solution: * * * | | | | * * * \ | \| * * * Another solution: * * * |\ | | \| * * * \ | \| * * * ``` This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the fewest bytes in each language wins. [Answer] # [Haskell](https://www.haskell.org/), 655 bytes ``` u%w=u!!w r=zip[-1,0,1,1,1,0,-1,-1][-1,-1,-1,0,1,1,1,0] g _[]_= -1 g i(e:l)x|x==e=i|1>0=g(i+1)l x l?x=g 0 l x d _[]_ _=[] d i(e:l)t v|i==t=v:l|1>0=e:d(i+1)l t v c=d 0 f n|all(==0).concat.q$n=n|1>0=f$foldr(\p b->s b[k,m]p)n$k!m where h=length n-1 e=mapM(\w->[0..w])[h,h] i!j=[[x,y]|[x,y]<-e,x>i-2&&x<i+2&&y>j-2&&y<j+2] q o=[[sum[1|[x,y]<-w!l,let u=(x-w,y-l) p=(w-x,l-y)in u/=p&&('1'==(o%w%l)%(r?u))/=('1'==(o%x%y)%(r?p))]|l<-[0..h]]|w<-[0..h]] v[x,y][a,b]|q n%x%y>q n%a%b=[x,y]|1>0=[a,b] [k,m]=foldr1 v e s w[x,y][a,b]|x==a&&y==b=w|'1'==w%x%y%(r?(a-x,b-y))=z '0'|'1'==w%a%b%(r?(x-a,y-b))=z '1'|1>0=w where z u=c w x$c(w%x)y$c(w%x%y)(r?(a-x,b-y))u ``` Man... 655 is a **lot**. I'm sure this isn't the best approach but since no one's answered this challenge yet I figured I would throw something at it. Input is a list of lists of strings, viz. `[[String]]` or, equivalently, `[[[Char]]]`. The string format is `"76543210"`, where the string is a `'0'` or a `'1'` in any given position based on whether or not the node points in that corresponding direction. This should conform with the spec: > > 7 represents the most significant bit, and 0 the least significant; in other words, the bits are given in the order `76543210`. > > > But the examples below that seem to contradict it, instead doing something more like `?7654321`, so I'm not sure. ## Test suite: ``` main :: IO () main = print $ f [ ["00000100", "00010000", "00000000"] , ["00000001", "10000000", "00010000"] , ["00000000", "00000000", "10000001"] ] ``` (That's the last test case in the spec^) [Answer] ## Python3, 497 bytes: ``` E=enumerate L=lambda d,x,y:(x+(K:=d not in[6,2])*[1,-1][d%7<2],y+(d%2 or K==0)*[-1,1][d<4]) def f(b): q,Z=[([[(x,y),e]for x,j in E(b)for y,e in E(j)],[])],{} while q: B,T=q.pop(0) if[]==(o:=[(Y,b,c)for Y,(a,b)in E(B)if(c:=[(i,K[0])for i,(A,p)in E(B)if(K:=[(I,R)for I in p if L(I,*A)==a and(R:=[I+4,I-4][I+4>7])not in b])])]):Z[len({*T})]=B;continue for i,b,c in o: for I,(g,h)in c:Q=eval(str(B));W=eval(str(B));Q[i][1]+=[h];W[I][1].remove(g);q+=[(W,T+[I]),(Q,T+[i])] return Z[min(Z)] ``` [Try it online!](https://tio.run/##bVHBauMwEL37K3QpjOJJcdywWZxqoYEeTHpJCYRm0MGO5UYlkR2v000o/fbsSFmWLizG0rx5b56fpfbcbxt3973tLpdHZdxxb7qiN9GT2hX7sipEhSc8Z3CKYZ6pSrimF9bRN0y1HNAIhyNN1c3kPtV4jqG6SUXTiblSCbPDEXr2fqxlVJla1FDKLBIHXCsCImBjiUbXPHHCN7YVj6zw8IzmCt@kRtK8fHxG4tfW7ow4sIWY4VIdbtumhUQytDVppaDJ2PgFS9wElxeEAksZjGbS1rDxvMU5JToILMIDtl8Ecy/I8TmwuY/Qsrd44t7gQSpViMJV8MyqPB5jPhxrX/yYaHk9F1FyVn6yNe2Mg4/B8lNqNZtuGtdbdzQc9fpdjujljf@X0MoRXnHro2yyhTLvxQ5@9h2nktPVv3BBVtNIx4q2erqi3IPbzuybdwOvcnpgAla4jJmRCAtfWc4Uic70x86JNe2tg7XUl7azroear4JSf8z8Uti1lNEX8o6b48Cm/6PTQP@ZT3iZ/NX7LmNMwtDlNw) This is a basic brute force solution. Below, however, is an optimized version, at the cost of 100 bytes: --- ## Python3, 597 bytes: ``` E=enumerate L=lambda d,x,y:(x+(K:=d not in[6,2])*[1,-1][d%7<2],y+(d%2 or K==0)*[-1,1][d<4]) def f(b): q,Z,X=[([[(x,y),e]for x,j in E(b)for y,e in E(j)],[])],{},[] while q: B,T=q.pop(0) if[]==(o:=[(Y,b,c)for Y,(a,b)in E(B)if(c:=[(i,K[0])for i,(A,p)in E(B)if(K:=[(I,R)for I in p if L(I,*A)==a and(R:=[I+4,I-4][I+4>7])not in b])])]):Z[len({*T})]=B;continue if Z and len({*T})>=min(Z):continue for i,b,c in o: for I,(g,h)in c: Q=eval(str(B));W=eval(str(B));Q[i][1]+=[h];W[I][1].remove(g) if W not in X:q+=[(W,T+[I])];X+=[W] if Q not in X:q+=[(Q,T+[i])];X+[Q] return Z[min(Z)] ``` [Try it online!](https://tio.run/##bZHRS@swFMbf@1fkRUjWM@nqcJfOCA58KPOlMuhsyEO7pi6ypV1v590Q//Z5kqrsipQm/c73y8c5TXPs1rW5@tO0p9M9V2a/VW3eKe@Bb/JtUeakhAMcI3rw6TziJTF1R7QR1xBKNhAjGI6kKC8mN6GEo0/Li5DULZlzHqA7HIF1b8aSeaWqSEULFnlkBxksuaBCUIxmoGSFZw7wgsHkHhkrj6B6@cIkCInL2zvuHvm31htFdphDZrDgu8umbmjAUOpKSM5pHWH2ExSwckFPQHMomMuaMV3RlfU1zEUgHaCB3kFzBswtEMOjc2PbRYPZ5AFrgzvGeU5yU9JHpGJ/DPFwLO3H7USy/ueQAtvFJ8rERhn6Nli8M8ln01VtOm32yrVKMptCvoFbvtWGZiw6o/rucBAbWtuJXSkG@gxr2/DK1UjC1Wu@oX@7Fgdg0/R/mQgtxUj6XKzlNBWxFZet2tavij4zF4DtpJ83S5bRDlGawsJHlsnpEmUqv7jkB5dYTvecSBBrVbdvDclEP488Na02Ha3wukVorxJf4XbJmHdmXmFx7NzwNzt09uf5AJfJN2@rqCFwh04f) ]
[Question] [ There's something (well, many things üòÄ) that really annoys me. It is when dictionaries (English, not Pythonic) use the defining word itself to define the word, also called circular definitions. Example: > > reticence: the quality of being reticent > > > -- Apple Dictionary > > Circular definition: a definition that is circular > > > -- Wikipedia (in jest) Anyway, # Challenge You are given a set of dictionary definitions. Your program should output the number of circular definitions in the input. As usual, code golf, lowest bytes wins, no standard loopholes, yada yada. ## Input Input can be in any reasonable form, including: * A dictionary (oh, the irony) * A list of strings * Line-by-line input, from STDIN or equivalent You will be given the defined word (it is a single word without spaces) and its definition, possibly containing the defined word itself. ### Circular definitions? A definition is circular for the purposes of this challenge if it satisfies one of the following conditions: * The definition contains the defined word * The definition contains the defined word minus one of these suffixes: + -ing + -ed + -ly * The definition contains the defined word plus one of the above suffixes ## Output You should output an integer stating the number of circular definitions in the input. If there are none, you can output zero, a falsy, or a nully. Good luck! ## Leaderboards Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language. To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template: ``` # Language Name, N bytes ``` where `N` is the size of your submission. If you improve your score, you *can* keep old scores in the headline, by striking them through. For instance: ``` # Ruby, <s>104</s> <s>101</s> 96 bytes ``` If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the *last* number in the header: ``` # Perl, 43 + 2 (-p flag) = 45 bytes ``` You can also make the language name a link which will then show up in the leaderboard snippet: ``` # [><>](http://esolangs.org/wiki/Fish), 121 bytes ``` ``` /* Configuration */ var QUESTION_ID = 100007; // Obtain this from the url // It will be likes://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe"; var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk"; var OVERRIDE_USER = 47670; // This should be the user ID of the challenge author. /* App */ var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page; function answersUrl(index) { return "https://api.stackexchange.com/2.2/questions/" + QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER; } function commentUrl(index, answers) { return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER; } function getAnswers() { jQuery.ajax({ url: answersUrl(answer_page++), method: "get", dataType: "jsonp", crossDomain: true, success: function (data) { answers.push.apply(answers, data.items); answers_hash = []; answer_ids = []; data.items.forEach(function(a) { a.comments = []; var id = +a.share_link.match(/\d+/); answer_ids.push(id); answers_hash[id] = a; }); if (!data.has_more) more_answers = false; comment_page = 1; getComments(); } }); } function getComments() { jQuery.ajax({ url: commentUrl(comment_page++, answer_ids), method: "get", dataType: "jsonp", crossDomain: true, success: function (data) { data.items.forEach(function(c) { if (c.owner.user_id === OVERRIDE_USER) answers_hash[c.post_id].comments.push(c); }); if (data.has_more) getComments(); else if (more_answers) getAnswers(); else process(); } }); } getAnswers(); var SCORE_REG = /<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/; var OVERRIDE_REG = /^Override\s*header:\s*/i; function getAuthorName(a) { return a.owner.display_name; } function process() { var valid = []; answers.forEach(function(a) { var body = a.body; a.comments.forEach(function(c) { if(OVERRIDE_REG.test(c.body)) body = '<h1>' + c.body.replace(OVERRIDE_REG, '') + '</h1>'; }); var match = body.match(SCORE_REG); if (match) valid.push({ user: getAuthorName(a), size: +match[2], language: match[1], link: a.share_link, }); }); valid.sort(function (a, b) { var aB = a.size, bB = b.size; return aB - bB }); var languages = {}; var place = 1; var lastSize = null; var lastPlace = 1; valid.forEach(function (a) { if (a.size != lastSize) lastPlace = place; lastSize = a.size; ++place; var answer = jQuery("#answer-template").html(); answer = answer.replace("{{PLACE}}", lastPlace + ".") .replace("{{NAME}}", a.user) .replace("{{LANGUAGE}}", a.language) .replace("{{SIZE}}", a.size) .replace("{{LINK}}", a.link); answer = jQuery(answer); jQuery("#answers").append(answer); var lang = a.language; if (/<a/.test(lang)) lang = jQuery(lang).text(); languages[lang] = languages[lang] || {lang: a.language, user: a.user, size: a.size, link: a.link}; }); var langs = []; for (var lang in languages) if (languages.hasOwnProperty(lang)) langs.push(languages[lang]); langs.sort(function (a, b) { if (a.lang > b.lang) return 1; if (a.lang < b.lang) return -1; return 0; }); for (var i = 0; i < langs.length; ++i) { var language = jQuery("#language-template").html(); var lang = langs[i]; language = language.replace("{{LANGUAGE}}", lang.lang) .replace("{{NAME}}", lang.user) .replace("{{SIZE}}", lang.size) .replace("{{LINK}}", lang.link); language = jQuery(language); jQuery("#languages").append(language); } } ``` ``` body { text-align: left !important} #answer-list { padding: 10px; width: 290px; float: left; } #language-list { padding: 10px; width: 290px; float: left; } table thead { font-weight: bold; } ``` ``` <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b"> <div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr> </thead> <tbody id="answers"> </tbody> </table> </div> <div id="language-list"> <h2>Winners by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr> </thead> <tbody id="languages"> </tbody> </table> </div> <table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr> </tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr> </tbody> </table> ``` [Answer] # Pyth, 28 bytes Really want to condense the logic. ``` sm}hKm:k"(ing|ed|ly)$";cd;tK ``` [Try it online here](http://pyth.herokuapp.com/?code=sm%7DhKm%3Ak%22%28ing%7Ced%7Cly%29%24%22%3Bcd%3BtK&input=%5B%22playing+-+people+when+they+play%22%2C+%22circle+-+a+thing+that+is+like+a+circle%22%2C+%22regular+-+this+is+normal+definition%22%2C+%22jump+-+what+someone+did+when+they+jumped%22%5D&debug=0). [Answer] # Python, ~~187~~ 185, self-disqualified! **EDIT**: I've decided to disqualify this due to its bugginess, but its good for the pun. --- Takes a Pythonic dictionary (hehe) and outputs the number to the console. This is quite buggy, though, should've done more tests... ``` def c(i): for k, v in i.items(): l,c,t,y="",0,k[-2:],k[:-2] if t=="ed":l=y if t=="ly":l=y if k[-3:]=="ing":l=k[:-3] if" "+k+" "in v:c+=1 if" "+l in v:c+=1 print(c) ``` [Answer] # Python, 129 bytes Takes a list of two item lists where the first item is the word and the second is the definition. It returns the amount circular definitions it found. ``` def f(d,n=0): for k,v in d:k,v=k.lower(),v.lower();n+=any(k+_ in v or k.rstrip(_)in v for _ in("","ing","ed","ly")) return n ``` ]
[Question] [ The goal of this challenge is to implement a digital [low-pass filter](https://en.wikipedia.org/wiki/Low-pass_filter). You are free to implement any type of digital filter you want, however whatever results produced must pass the validation script below. Here's a general description of what the validation script expects: 1. When an FFT is taken of the filtered signal, the filtered signal amplitude at any frequency bucket: 1. If the input signal has a frequency bucket with a value below -80dB, then the output signal bucket needs only be at or below the -80dB level. 2. A decade below the cutoff frequency must not differ from the source signal amplitude by more than 3dB at the corresponding frequency bucket. 3. At or above the cutoff frequency must be at least 3dB below the source signal amplitude at the corresponding frequency bucket of the input signal. 2. The output signal must be in the time domain and have the same number of samples and sample rate as the input signal. 3. You need not preserve any phase information or worry about aliasing. 4. The output signal must consist of only finite real values (no NaN/ infinities). # Input Your program is given the following inputs: * A time domain sampled signal consisting of real numbers representing the amplitude of the signal at the sample time. Your program will be given the entire sample data at the beginning, but this is not necessarily the same between different runs of your program. You may assume the number of samples is sufficiently small that you don't have to worry about running out of memory. You may assume any single input sample is between [-1, 1] * A positive real number representing the sample rate (in Hz) * A positive real number representing the cutoff frequency (in Hz) You are free to dictate the exact form of the input as long as no additional information is given (ex.: passing a data pointer+length for the time domain signal is ok, but passing in FFT information is not). The input can come from any source desired (file io, stdio, function parameter, etc.) # Output Your program should output the time domain filtered signal. The output may be written to any source desired (file io, stdio, function return value, etc.). You should not need the filtered signal sample rate since it should be the same as the input sample rate. # Validation Python function This should work with Python 2 or 3 (requires NumPy) ``` from __future__ import division, print_function import numpy as np def validate(original, filtered, srate, cfreq): ''' Validates that the filtered signal meets the minimum requirements of a low-pass filter. A message of the failure mode is printed to stdout @param original the original signal (numpy array) @param filtered the filtered signal (numpy array) @param srate the sample rate (float) @param cfreq the cutoff frequency (float) @return True if filtered signal is sufficent, else False ''' # check length if(len(original) != len(filtered)): print('filtered signal wrong length') print('len(original): %d, len(filtered): %d'%(len(original),len(filtered))) return False # assert filtered signal is not complex if(np.any(np.iscomplex(filtered))): print('filtered contains complex values') return False # assert filtered signal is all finite floats if(not np.all(np.isfinite(filtered))): print('filtered signal contains non-finite floating point values') return False o_fft = abs(np.fft.rfft(original)) f_fft = abs(np.fft.rfft(filtered)) f_fft /= np.amax(o_fft) o_fft /= np.amax(o_fft) fft_freqs = np.fft.rfftfreq(len(original), 1/srate) orig_small_mask = (o_fft < 1e-4) big_mask = ~orig_small_mask # check small values if(np.any(f_fft[orig_small_mask] > 1e-4)): print('input signal had a bucket below -80 dB which the filtered signal did not') return False ob_fft = o_fft[big_mask] fb_fft = f_fft[big_mask] fftb_freqs = fft_freqs[big_mask] low_mask = (fftb_freqs < 0.1*cfreq) high_mask = (fftb_freqs >= cfreq) lows = abs(fb_fft[low_mask]/ob_fft[low_mask]) highs = abs(fb_fft[high_mask]/ob_fft[high_mask]) # check pass bands if(np.any(lows > np.sqrt(2)) or np.any(lows < 1/np.sqrt(2))): print('pass region is outside of +/- 3dB') return False # check filter bands if(np.any(highs > 1/np.sqrt(2))): print('filter region is not at least -3dB below original') return False # passed all tests! return True ``` # Examples Here are some Python functions which can be used to generate example datasets. Note that these scripts require NumPy. The output of each function is a tuple containing `(samples, sample_rate, cutoff_freq)`. Note that it is very easy to get a different test case by choosing a different cutoff frequency; the example ones are just somewhat "interesting" cases. ``` from __future__ import division, print_function import numpy as np def case1(): # simple sine wave, cutoff including primary frequency t = np.linspace(0, 1, 10000) srate = 1/(t[1]-t[0]) return np.sin(2*pi*t),srate,1 def case2(): # simple sine wave, cutoff above primary frequency t = np.linspace(0, 1, 10000) srate = 1/(t[1]-t[0]) return np.sin(2*pi*t),srate,10 def case3(): # random noise t = np.linspace(0, 1, 10001) srate = 1/(t[1]-t[0]) return np.random.rand(t.size)*2-1,srate,10 def case4(): # sinc function t = np.linspace(-1, 1, 10000) srate = 1/(t[1]-t[0]) return np.sinc(2*np.pi*srate*t), srate, 10 def case5(): n = 200000 t = np.linspace(0, 1, n) y = np.zeros(t.size) for i in range(3): amp = np.random.rand(1) freq = i*103+101 phase = np.random.rand(1)*2*np.pi tdecay = 1e-3 decay = 1e-1 for j in range(1,10): fj = freq*j if(fj >= 0.9*n): break y += amp*(np.sin(2*np.pi*fj*t+phase))*np.exp(-decay*(j-1)**2)*np.exp(-tdecay*t) y -= np.mean(y) y /= max(np.amax(abs(y)),1) srate = 1/(t[1]-t[0]) return y,srate, 1e3 ``` # Scoring This is code golf, shortest answer in bytes wins. Standard loop-holes apply. You may use any built-ins desired. [Answer] # Python: 99 bytes ``` from numpy.fft import * def f(o,s,c): a = rfft(o);b=rfftfreq(o.size,1/s);a[b>=c]=0;return irfft(a) ``` This is a very simple rectangle/brick filter. It takes the real fft of the signal, sets all components equal to or higher than the cutoff frequency to 0, then returns the inverse real fft. [Answer] # SmileBASIC, 54 bytes ``` DEF L D,S,C DIM A[99]BQPARAM A,1,S,C,1BIQUAD D,D,A END ``` Call as: **L** *sample array* **,** *sample rate* **,** *cutoff frequency* (untested) ]
[Question] [ ## Specification For this challenge you will: * Take an array of positive integers. * For each overlapping pair in the array, calculate the difference of it's integers. If the difference is a common divisor of the integers (they are both divisible by their difference), swap their positions in the array. The values of the next pair are affected by this swap. No integer is divisible by `0`. * If an integer was not divisible by the difference of any of it's pairs, remove it from the array. * Repeat the previous two steps until the length of the array will not decrease any further. * Output the length of the resulting array. ## Example * Input = `[ 4, 5, 2, 4 ]`. * Difference of first pair `[ ( 4, 5, ) 2, 4 ]` = `1`, (common divisor of `4` and `5`) + Swap the pair and the array becomes `[ 5, 4, 2, 4 ]`. * Difference of second pair `[ 5, ( 4, 2, ) 4 ]` = `2` (common divisor of `4` and `2`) + Swap the pair so the array becomes `[ 5, 2, 4, 4 ]`. * Difference of third pair `[ 5, 2, ( 4, 4 ) ]` = `0` (not a divisor of any integer) + Do not swap the pair so the array remains the same. * The final `4` was never swapped, remove it so the array becomes `[ 5, 2, 4 ]`. * Repeat. * Difference of first pair `[ ( 5, 2, ) 4 ]` = `3` + Do not swap the pair so the array remains the same. * Difference of second pair `[ 5, ( 2, 4 ) ]` = `2` + Swap the pair so the array becomes `[ 5, 4, 2 ]`. * The `5` was never swapped, remove it so the array becomes `[ 4, 2 ]` * Repeat. * From here the array will endlessly switch between `[ 4, 2 ]` and `[ 2, 4 ]`, so output the resulting length of `2`. ## Rules * Input array will always have a length between 2 and 9 inclusive. * Integers will always be between 1 and 999 inclusive. * Input can optionally be in the form of a string delimited by a specific character. * This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so shortest code in bytes wins. ## Test Cases Format: `[ input array ] = result (steps to get result, do not output this)` ``` [ 1, 1 ] = 0 ([]) [ 1, 2 ] = 2 ([ 2, 1 ] -> [ 1, 2 ] -> ...) [ 1, 2, 3 ] = 2 ([ 2, 1 ] -> [ 1, 2 ] -> ...) [ 4, 6, 8 ] = 3 ([ 6, 8, 4 ] -> [ 8, 4, 6 ] -> [ 4, 6, 8 ] -> ...) [ 99, 1, 3 ] = 0 ([]) [ 4, 5, 2, 4 ] = 2 ([ 5, 2, 4 ] -> [ 4, 2 ] -> [ 2, 4 ] -> ...) [ 12, 4, 6, 3 ] = 3 ([ 6, 4, 3 ] -> [ 4, 3, 6 ] -> [ 3, 6, 4 ] -> ...) [ 9, 6, 10, 18 ] = 2 ([ 6, 10, 18, 9 ] -> [ 9, 18 ] -> [ 18, 9 ] -> ...) [ 55, 218, 654, 703, 948, 960 ] = 2 [ 954, 973, 925, 913, 924, 996, 927, 981, 905 ] = 2 ``` [Answer] # JavaScript (ES6), 133 Recursive function. ``` F=(m,k=[])=>(k[m]=m,f=m.map((x,i)=>x%(w=x-(y=m[i+1]))==0&y%w==0?m[m[i]=y,i+1]=x:0),k[m=m.filter((x,i)=>f[i-1]|f[i])]?m.length:F(m,k)) ``` *Less golfed and not recursive* ``` F=m=>{ for(k=[];!k[m];) // use k to find a repeated state and exit the loop { k[m]=1 console.log(m) // loop for swap and mark swap position in array f f=m.map((x,i)=>( y=m[i+1], // next element w=x-y, // difference x%w==0&y%w==0 // if common divisor ... ?m[m[i+1]=x,i]=y // swap elements,mark with nonzero :0 // no swap, mark with 0 )) m=m.filter((x,i)=>f[i-1]|f[i]) // remove elements not swapped } return m.length } ``` **Test** ``` F=(m,k=[])=>(k[m]=m,f=m.map((x,i)=>x%(w=x-(y=m[i+1]))==0&y%w==0?m[m[i]=y,i+1]=x:0),k[m=m.filter((x,i)=>f[i-1]|f[i])]?m.length:F(m,k)) console.log=x=>O.textContent+=x+'\n' ;[[1,1],[1,2],[1,2,3],[4,6,8],[99,1,3],[4,5,2,4],[12,4,6,3],[9,6,10,18] ,[ 55, 218, 654, 703, 948, 960 ],[ 954, 973, 925, 913, 924, 996, 927, 981, 905 ]] .forEach(t=>console.log(t+' -> '+F(t))) ``` ``` <pre id=O></pre> ``` ]
[Question] [ # Exposition Your mathematics teacher is a big fan of [Vieta's formulas](https://en.wikipedia.org/wiki/Vieta's_formulas), and he believes that you should use them to solve quadratic equations. Given the equation ``` ax^2 + bx + c = 0 ``` the product of its roots is `c/a`, and their sum is `-b/a`. When all of `a`, `b` and `c` are nonzero integers, **assuming the roots are rational numbers**, it's enough to try all possible numbers in the form ``` r1 = ±s/t ``` where `s` is a divisor of `abs(c)`, and `t` is a divisor of `abs(a)`. For each such `r1`, plug it into `ax^2 + bx + c`, and see whether the result is 0. If yes, then `r1` is a root. The second root is `-b/a-r1` or `(c/a)/r1` - you can choose whatever formula you like. Your teacher decided to give you many exercises, and he expects you to describe how you used Vieta's formulas to solve each one. Each exercise looks like this (example): ``` 9x^2+12x+4=0 ``` Write a subroutine or a program that gets an exercise as input, and outputs your alleged "solving process" to appease your teacher. --- # Input Since you will feed the exercise to your program manually, format it in any convenient form. For example, use space-separated values on `stdin`: ``` 9 12 4 ``` or call a function with 3 parameters: ``` SolveExercise(9, 12, 4); ``` or parse the exercise literally: ``` 9x^2+12x+4=0 ``` Your output should be formatted as described below. Use the standard output device or return it as a string from your subroutine. # Output (example) ``` x = 1? 9x^2+12x+4 = 25 x = 2? 9x^2+12x+4 = 64 x = 1/3? 9x^2+12x+4 = 9 x = 2/3? 9x^2+12x+4 = 16 ... (as many or as few failed attempts as you like) x = -2/3? 9x^2+12x+4 = 0 r1 = -2/3 r2 = -12/9-(-2/3) = -2/3 ``` Alternatively, the last line can be: ``` r2 = 4/9/(-2/3) = -2/3 ``` --- Some additional notes: * The minimum number of line-breaks in the output is as described in the example (trailing line-break is not required). Additional line-breaks are permitted. * All coefficients in input are integers in the range [-9999...9999], none can be equal to 0 * All roots are rational numbers, and should be output as such - e.g. `0.66666667` is not equal to `2/3` and so is incorrect * In the final expressions for `r1` and `r2`, integers should be output as such, e.g. `-99/1` is unacceptable, and should be output as `-99`; in other places in the output, denominator equal to ±1 is acceptable * Reduced form for rational numbers is not required - e.g. `2/4` is a good substitute for `1/2`, even though it's ugly, even for roots `r1` and `r2` * Parentheses in the output are sometimes required by rules of mathematics, e.g. in the expression `12/9/(2/3)`. When precedence rules of mathematics permit omission of parentheses, they are not required, e.g. `-12/9--2/3`. Superfluous parentheses are permitted: `4-(2)` is OK, even though it's ugly * There should be at least one case (input) for which your program tries 3 or more *non-integer* values for `r1`; however, it's allowed to "guess the right answer" almost always on the first try * All trial values for `r1` must be rational numbers `±s/t`, where `s` and `t` are constrained as described above --- # Test cases 1. Input ``` x^2-x-2=0 ``` or ``` 1 -1 -2 ``` Possible output ``` x=1? x^2-x-2=-2 x=-1? x^2-x-2=0 r1=-1 r2=-2/1/-1=2 ``` 2. Input ``` -x^2+2x-1=0 ``` or ``` -1, 2x, -1 ``` Possible output ``` x=1? -x^2+2x-1=0 r1=1 r2=-2/-1-1=1 ``` 3. Input ``` 7x^2-316x+924=0 ``` or ``` X(7, -316, 924); ``` Possible output (a divisor of 924 is 42, which solves the equation by "luck") ``` x=42? 7x^2-316x+924=0 r1=42 r2=316/7-42=22/7 ``` 4. Input ``` 6x^2-35x-6=0 ``` or ``` [6 -35 -6] ``` Possible output (even though your program may "know" that 6 is a root, it decides to show some failed trials) ``` x=1/2? 6x^2-35x-6=-88/4 x=1/3? 6x^2-35x-6=-153/9 x=3/2? 6x^2-35x-6=-180/4 x=6/1? 6x^2-35x-6=0 r1=6 r2=35/6-6=-1/6 ``` Alternative versions for the last line: ``` r2=--35/6-6=-1/6 r2=-6/6/6=-1/6 ``` 5. Impossible input (no rational solutions) ``` x^2+5x+1=0 ``` 6. Impossible input (zero coefficient) ``` x^2-1=0 ``` [Answer] # JavaScript (ES6), 373 ``` (a,b,c,z='',A=Math.abs,M=(c,x,a)=>'-+'[c>0|0]+(x&&a<2?x:a+x),G=(a,b)=>b?G(b,a%b):a,O=(n,d,g=G(n,d))=>(g=d*g<0?-g:g)-d?n/g+'/'+d/g:n/d,e=M(a,'x^2',o=A(a))+M(b,'x',A(b))+M(c,'',q=A(c)),K=s=>(z+=` x=${s}/${t}? ${e}=`+(v=a*s*s+b*s*t+c*t*t)+(v?'':` r1=${O(s,t)} r2=(${c}/${a})/(${s}/${t})=`+O(c*t,s*a)),v))=>{for(s=0;++s<=q;)for(t=0;++t<=o;)if(!(q%s||o%t||K(-s)&&K(s)))return z} ``` **Test** ``` f=(a,b,c,z='',A=Math.abs,M=(c,x,a)=>'-+'[c>0|0]+(x&&a<2?x:a+x),G=(a,b)=>b?G(b,a%b):a,O=(n,d,g=G(n,d))=>(g=d*g<0?-g:g)-d?n/g+'/'+d/g:n/d,e=M(a,'x^2',o=A(a))+M(b,'x',A(b))+M(c,'',q=A(c)),K=s=>(z+=` x=${s}/${t}? ${e}=`+(v=a*s*s+b*s*t+c*t*t)+(v?'':` r1=${O(s,t)} r2=(${c}/${a})/(${s}/${t})=`+O(c*t,s*a)),v))=>{for(s=0;++s<=q;)for(t=0;++t<=o;)if(!(q%s||o%t||K(-s)&&K(s)))return z} // Less golfed U=(a,b,c, // locals z='', A=Math.abs, M=(c,x,a)=>'-+'[c>0|0]+(x&&a<2?x:a+x), G=(a,b)=>b?G(b,a%b):a, // GCD O=(n,d,g=G(n,d))=>(g=d*g<0?-g:g)-d?n/g+'/'+d/g:n/d, // output a fraction o=A(a),q=A(c), e=M(a,'x^2',o)+M(b,'x',A(b))+M(c,'',q), // espression from coefficients K=s=>( // check & output a candidate solution z+=`\nx=${s}/${t}? ${e}=`+(v=a*s*s+b*s*t+c*t*t)+(v?'':` r1=${O(s,t)} r2=(${c}/${a})/(${s}/${t})=`+O(c*t,s*a)),v ) )=>{ for(s=0;++s<=q;) for(t=0;++t<=o;) if(!(q%s||o%t||K(-s)&&K(s))) return z } console.log=x=>O.textContent+=x+'\n' // Test console.log(f(9,12,4)) console.log(f(1,-1,-2)) console.log(f(-1,2,-1)) console.log(f(7,-316,924)) console.log(f(6,-35,-6)) ``` ``` <pre id=O></pre> ``` [Answer] # Python - ~~202~~ 200 bytes *2 bytes saved thanks to @FryAmTheEggman.* ``` from fractions import*;f=Fraction lambda a,b,c:"\n".join(["x=%s?%dx^2+%dx+%d=%s"%(i,a,b,c,a*i*i+b*i+c)for i in[f(1,a),f(-1,a),f(c,a)]]+["r%d=%s"%((3-i)/2,f(i*(b*b-4*a*c)**.5-b)/f(2*a))for i in[1,-1]]) ``` [Answer] ## Mathematica, 236 Bytes I'm sure there's a way to shorten this further, but this was my first attempt at learning the language. **Golfed** ``` s=Input[];f[x_]:=#3 x^2+#1 x+#2&@@s;t=Drop[Z1,1];r=Catch[Do[Print[StringForm["x=``? ``=``",y,f[x],f[y]]];If[f[y]==0,Throw[y]],{y,(Flatten[Outer[Divide,#1,#2]]&@@(Join[#,-#]&/@Divisors[#]&[t]))}]]StringForm["r1=``\nr2=``",r, #1/#2/r&@@t] ``` **Ungolfed with comments** ``` (*Get coefficients in list {B,C,A}*) s=Input[]; (*Create the function*) f[x_]:=#3 x^2+#1 x+#2&@@s; (*Take C and A*) t=Drop[Z1,1]; (*Get a list of all positive and negative divisors for C and A, then use those to get all possible permutations for R=S/T as given in the challenge*) (*Print out each attempt at finding a root. If one is found, exit the loop and return it*) r=Catch[Do[Print[StringForm["x=``? ``=``",y,f[x],f[y]]];If[f[y]==0,Throw[y]],{y,(Flatten[Outer[Divide,#1,#2]]&@@(Join[#,-#]&/@Divisors[#]&[t]))}]]; (*Print the roots using (c/a)/r1 *) StringForm["r1=``\nr2= ``",r, #1/#2/r&@@t] ``` Coefficients must be entered in the (convenient) form {B,C,A}. ]
[Question] [ **Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers. --- **Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/75160/edit). Closed 2 years ago. [Improve this question](/posts/75160/edit) Now that we're graduating, it's time to tally up the number of times someone suggested that PPCG was graduating, even before the annoucement! ([see here](https://codegolf.meta.stackexchange.com/a/5834/29611)) Your program will receive a list of chat messages. Each message has three pieces of data: the user (e.g. `Geobits`), the timestamp (e.g. `Aug 19 '15 2:41 PM`), and the message (e.g. `What do you mean "fake"? It clearly says we're graduating in September.`). The list will be in no particular order. The timestamp will be presented in the format that the StackExchange chat search uses: * If the date is in the current year, the date will be of the format: `%b %-d %-I:%M %p` + `%b` = three-character month (one of Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec) + `%-d` = day of month, no padding + `%-I` = hour (12-hour clock), no padding + `%M` = minute, padded to two characters with zero + `%p` = AM or PMFor example, you might have `Feb 13 8:09 PM` or `Mar 8 1:32 AM`. * If the date is in another year, the date will be of the format: `%b %-d '%y %-I:%M %p` + Same as above, with `%y` = two digit year, padded to two characters with zeroFor example, you might have `Aug 29 '13 12:02 PM` or `May 11 '15 11:11 AM`. All dates are in UTC. You may take input in whatever format you wish (array parameter, string delimited with newline, etc.) as long as the date is still in the format listed above. You may take the current year as an input if your language does not provide any mechanism for fetching the year. A message is considered to talk about PPCG's graduation if it contains at least one of: `graduate`, `graduated`, `graduating`, or `graduation`, and contains either `we` or `PPCG`. All matches should be case-insensitive, and should not be part of another word: extra letters are not allowed either directly before or after the match (so `wegraduate` is invalid). Note that `we graduate.`, `3graduate we`, and `Graduation PPCG!` are all valid matches. Graduation was announced on [February 23, 2016 at 16:54:15 UTC](https://codegolf.meta.stackexchange.com/q/8538/29611). Therefore, any message sent after this date (starting with `Feb 23 4:55 PM`) should be excluded. Furthermore, there are some messages that suggest that PPCG is **not** graduating. These, of course, should be excluded. Therefore, any message containing an **odd** number of the following should be excluded: `not`, `never`, `won't`, `aren't`, `wont`, `arent`. Once again, these must not be part of another word (see above) and matches should be case-insensitive. Your program should output a list of all the users with at least one message suggesting our graduation ahead of time, as well as the number of such messages for each user. This list should be sorted by count in descending order. In the case of multiple users with the same number of messages, any of the users may appear first. ### Example **Input**: Lines starting with `//` are not part of the input, and are only present for explanatory purposes. ``` // does not count, missing we or PPCG Geobits Sep 26 '14 4:44 PM If that's the justification for keeping it beta, then I assume it will graduate as soon as Howard hits 20k? // counts Downgoat Feb 13 8:09 PM Also, now that we've reached 10Q/D are we graduating? // does not count, has one not Geobits Sep 26 '14 5:10 PM Yea, sorry. We're not graduating. I'm going to assume from now on that Oct 1 is the southern hemisphere's April Fool's Day. // counts Rainbolt Mar 31 '15 2:36 PM It also works when we graduate Alex A. // does not count, missing we or PPCG Jan 12 9:01 PM Watch lies.se graduate before us // counts Geobits Sep 15 '15 5:59 PM When we graduate in November. // counts Geobits Feb 19 3:41 AM Maybe we'll graduate tonight and it'll jump to 3k. // counts PhiNotPi Oct 2 '14 1:26 PM I heard some weird rumor that we are graduating soon. Is there any truth to that? // does not count, posted after annoucement Geobits Feb 23 6:40 PM I guess we have to graduate this one now: // does not count, missing we or PPCG Runer112 Mar 31 '15 4:01 PM rainbolt, flag at start of each graduate? // counts Duck Nov 11 '14 11:05 AM We aren't not graduating soon. // counts Geobits Mar 3 '15 2:32 PM That's why we don't have a logo yet (until we graduate in May). We don't trust the internet. // counts (not is part of cannot, and is not considered) user-1 Apr 1 '14 10:05 PM We cannot graduate. ``` **Output**: Format may vary. You may use any delimiter, or return an array, etc. ``` Geobits - 3 Downgoat - 1 Rainbolt - 1 PhiNotPi - 1 Duck - 1 user-1 - 1 ``` [Answer] # Python 2, ~~569~~ 491 bytes ``` def g(a):t=filter(lambda m:m[1]<datetime(2016,2,23,4,55)and search(r"\bgraduat(e|ing|ion)\b",m[2],2)and search(r"\bwe|ppcg\b",m[2],2)and len(findall(r"\b(never|(no|won'|aren'|won|aren)t)\b",m[2],2))%2-1,[[m[0],datetime.strptime(m[1],"%b %d '%y %H:%M %p"),m[2]]for m in [[m[0],sub(r"(\w{3} \d\d+)(.*)",r"\1 '%s\2"%str(datetime.now().year)[2:],m[1])if len(m[1])<17else m[1],m[2]]for m in a]]);print sorted([[u,len(filter(lambda m:m[0]==u,t))]for u in set([m[0]for m in t])],key=lambda u:-u[1]) ``` [Ungolfed version and demonstration here!](https://repl.it/BuYk/9) ~~Gonna try to golf this down later~~Golfed it down a bit, ~~especially the regex part (I gotta get this into one regex)~~ but I am too noob to optimize the regexes :( ]
[Question] [ You have a deck of cards, consisting of cards with non-negative numbers on them, and you haven't shuffled it yet, and no player trusts the other players to be fair at shuffling. You devise a way to shuffle the deck that is completely deterministic, but chaotic enough that the other players are okay with using it. Here's how you perform a single shuffle: 1. Start with the deck face down. There are a series of M empty piles (where M is the maximum number in the deck) labeled as the 1st, 2nd, 3rd, ... ,Mth pile, and there is also an empty storage pile. 2. While the deck is not empty, do the following: Take the first card off the top of the deck, let N be its number and put the card face down on the top of the storage pile. If there are at least N cards left in the deck, deal the top N cards face down such that the top card goes in the 1st pile, the second card from the top goes in the 2nd pile, etc. until the Nth card gets put in the Nth pile. If there are fewer than N cards in the deck, deal all of them. 3. Construct the new deck by putting the first pile on the storage pile, then the second pile on the new pile, then the third pile on that new pile, then the fourth pile on that one, until all piles are in your deck. This method is pretty intuitive when doing by hand, but after a few games some players want a computer to do it, due to the deep-seated mistrust within the group and a few lucky draws. They refuse to use other deck shuffling programs that would work better. Write a program that takes as input a list of non-negative integers (in some format you specify) and shuffles it once using this method, outputting the result. You may assume the integers and the length of the list are less than 2^16. Here are some worked-out examples (layout is deck|storage|1st|2nd|3rd|...|Mth, cards go from bottom to top): ``` 9,8,7,6,5,4,3,2,1,0||||||||||| 9,8,7,6,5,4,3,2,1|0|||||||||| 9,8,7,6,5,4,3|0,1|2||||||||| 9,8,7|0,1,3|2,4|5|6||||||| |0,1,3,7|2,4,8|5,9|6||||||| 0,1,3,7,2,4,8,5,9,6||||||||||| (starting another iteration) 0,1,3|6|9|5|8|4|2|7|||| |6,3|9,1|5,0|8|4|2|7|||| 6,3,9,1,5,0,8,4,2,7||||||||||| ``` Here is a long string of successive shuffles: ``` [9,8,7,6,5,4,3,2,1,0]->[0,1,3,7,2,4,8,5,9,6]->[6,3,9,1,5,0,8,4,2,7]-> [7,3,2,6,4,8,0,5,1,9]->[9,1,5,0,8,4,6,2,3,7]->[7,1,3,9,2,6,4,8,0,5]-> [5,9,0,3,8,1,4,7,6,2]->[2,4,9,6,1,5,7,8,3,0]->[0,3,1,9,8,6,4,7,2,5]-> [5,9,2,1,7,3,4,0,6,8]->[8,5,6,0,4,3,7,1,2,9]->[9,2,1,7,3,4,0,6,5,8] ``` Another few: ``` [1,0,1,0]->[0,1,1,0]->[0,1,0,1]->[1,1,0,0]->[0,0,1,1]->[1,0,0,1]->[1,0,1,0] [1,1,1,0]->[0,1,1,1]->[1,1,1,0] [1,0,1,1]->[1,0,1,1] [4,3,2,1]->[1,3,2,4]->[4,2,3,1]->[1,2,3,4]->[4,3,2,1] [1,2,1,2,1,2]->[2,1,1,1,2,2]->[2,1,2,2,1,1]->[1,2,2,1,2,1]->[1,1,2,2,2,1] ``` [Answer] # Perl 5, 81 bytes A naive approach (just shuffling per the specs). Doubtless someone will find a shorter way to do it (even in Perl 5, I mean). ``` {while(@_){for(1..($.=pop)){push@{$a[$_]},pop}push@{$a[0]},$.}$,=$/;say@$_ for@a} ``` This is a subroutine, but what it prints (not returns) is the shuffled deck. It requires `-M5.01` (which is free). ``` $ perl -M5.01 -e'sub{while(@_){for(1..($.=pop)){push@{$a[$_]},pop}push@{$a[0]},$.}$,=$/;say@$_ for@a}->(9,8,7,6,5,4,3,2,1,0)' 0 1 3 7 2 4 8 5 9 6 ``` It also adds extra newlines in various places (depending on the deck), but there's… well, nothing *technically* in the specs forbidding that. `:-)` [Answer] # Ruby, 91 bytes There is probably a better way to create an array of arrays. There's probably a shorter way to do all the shuffling, too. We'll see what future answers and comments bring to the table and all golfing suggestions are welcome. ``` ->d{z=(1..d.size).map{[]};([d[-1]+1,d.size].min.times{|i|z[i]<<d.pop})while d[0];z.flatten} ``` **Ungolfing:** ``` def shuffle(deck) # an array of arrays z = (1..deck.size).map{[]} # while there are still cards in the deck while deck[0] # if we're almost out of cards, use how many are left # else, put in deck[-1] + 1 in the piles (that is, including deck[-1]) card = [deck[-1] + 1, deck.size].min card.times do |i| z[i] << deck.pop end end # flatten all of those arrays done and return return z.flatten end ``` ]
[Question] [ Lets say we have this existing data: ``` Total - 10 Won - 7 Lost - 3 Longest Winning Streak - 5 Longest Losing Streak - 2 ``` Now you need to write a function which generates an array of random boolean values (`true` representing a win and `false` representing a loss) which fulfills the above criteria. So, in this case the output can be any of the following: ``` 0011011111 1111101100 1010011111 .......... ``` ### Rules: * Solution must be function which takes in `Won, Lost, Longest Winning Streak and Longest Losing Streak` and returns a boolean array or string formed of a boolean array like (`110011001010`). It can also display output instead of returning the generated data. * You can safely assume there are no ties/draws/no-results. * This is code-golf so shortest code wins. * Input format can be in any form (Standard Input/Command-Line,etc.). And the real *input format* should be - `<Won> <Lost> <LWS> <LLS>` where `<..>` are place-holders or they can be separate parameters for the function.. whatever you deem best for your code. The parameter `Total` is unnecessary. So you needn't use it. * As far as random is concerned, you can see that in the example, there are three (and more) possible outputs. Just output any one at random. * If you have any other question, ask in the comments below. ## Important - Not any answer as of now is correct. I provide another example (this one's real data) which is possible but not working with the codes in the current answers: ``` Total - 171 Won - 111 Lost - 60 Longest Winning Streak - 10 Longest Losing Streak - 4 ``` Real Data: ``` 1110110100111111010000101111111100110001100110111101101011111011011011011111111110110001111011010001101011100101111101001011011110101101001100001111101010110001111110111111 ``` Another possible output (Basically the same, just the third and fourth digits are interchanged): ``` 1101110100111111010000101111111100110001100110111101101011111011011011011111111110110001111011010001101011100101111101001011011110101101001100001111101010110001111110111111 ``` [Answer] # JavaScript ES6, ~~83 70~~ 63 bytes ``` (b,c,d,e)=>'1'[r='repeat'](d)+'0'[r](e)+'1'[r](b-d)+'0'[r](c-e) ``` [Try it online](http://vihanserver.tk/p/esfiddle/?code=d%3D(b%2Cc%2Cd%2Ce)%3D%3E'1'%5Br%3D'repeat'%5D(d)%2B'0'%5Br%5D(e)%2B'1'%5Br%5D(b-d)%2B'0'%5Br%5D(c-e)%0A%0Ad(7%2C%203%2C%205%2C%202)) [Answer] # Python3 - 239 238 bytes ``` W,L,O,S=map(int,input().split()) from itertools import* P=lambda A,B:len(max(A.split(str(B)),key=len)) for C in product("01",repeat=W+L): C="".join(C) if P(C,0)==O and P(C,1)==S and W==C.count("1")and L==C.count("0"): print(C) break ``` Well, this is way too long, but it works. **Very slow**. Takes the inputs from STDIN as whitespace separated in the same order as OP does. ## Testcases ``` Input: 7 3 5 2 Output: 0011011111 Input: 15 10 15 5 Output: 0000011111111111111100000 ``` [Answer] # Pyth - 33 bytes ``` J_E.W|n/H1hQnJmeShMd.gekrH8mO2sQY ``` [Try it online here](http://pyth.herokuapp.com/?code=J_E.W%7Cn%2FH1hQnJmeShMd.gekrH8mO2sQY&input=%5B7%2C3%5D%0A%5B5%2C2%5D&debug=1). Rejection testing, very slow. [Answer] # Java 7, ~~319~~ 317 bytes ``` import java.util.*String c(int a,int b,int c,int d){String r="",w="",l="";List z=new ArrayList();int i,q=a+b-c-d;for(i=;i++<c;w+=1);for(i=0;i++<d;l+=0);for(;a---c>0;z.add(1));for(;b---d>0;z.add(0));Collections.shuffle(z);for(i=0;i<q;r+=z.get(i++));return new StringBuilder(r).insert(new Random().nextInt(q),w+l)+"";} ``` NOTE: The winning streak and losing streak will always be right after one-another, everything else, including their positions in the resulting string, is random. **Ungolfed & test cases:** [Try it here.](https://ideone.com/2tykLB) ``` import java.util.*; class M{ static String c(int a, int b, int c, int d){ String r = "", w = "", l = ""; List z = new ArrayList(); int i, q = a+b-c-d; for(i = 0; i++ < c; w += 1); for(i = 0; i++ < d; l += 0); for( ; a-- - c > 0; z.add(1)); for( ; b-- - d > 0; z.add(0)); Collections.shuffle(z); for(i = 0; i < q; r += z.get(i++)); return new StringBuilder(r).insert(new Random().nextInt(q), w+l)+""; } public static void main(String[] a){ System.out.println(c(7, 3, 5, 2)); System.out.println(c(171, 111, 10, 4)); } } ``` **Possible output:** ``` 1111100011 100100010110111111110011011100101111011010110011011101111010010010101111101111000010010000110100010111001100100110010011101100111111111111110110110101011100111111111100001011111000111011111010010001010001100111110011111011011011101010101011101011011101101001001100100101100111111101 ``` [Answer] ## R - (I don't know how to calculate bytes) ``` a <- read.csv("a.csv") b <- seq(1,1, seq.length = a$3) a$1 <- a$1-a$3 c <- seq(0,0, seq.length = a$4) a$2 <- a$2 - a$4 append(b,c) d <- a$1 + a$2 while(d >= 0){append(b,c(1,0)); d <- d-2} d ``` where `a.csv` is a file with the four inputs separated by commas. This program will output a long string of `1`'s (for the win streak), and then a long string of `0`'s for the loss streak, and finally a long string of `0,1` for the rest of the games. ]
[Question] [ **Context:** > > You are a cryptographer. You have stumbled upon a mysterious group of individuals, who present you with a challenge, which you must solve in order to join their secret society. > > > **Description:** > > You have been given a binary stream consisting of 3 byte sequences that have a random width (unchanging per-stream). This stream has the following properties: > > > 1. The first two bytes in a sequence are randomly generated unsigned binary numbers. > 2. The third byte is the sum of the first two bytes. > 3. If the sum overflows, the carry-bit disappears (That is, it does not affect the first 2 bytes). > 4. The bytes are big-endian. > 5. The byte-width will always be between 3 and 16. > > > **Examples of potential streams**: > > A stream is an infinite series of 3 byte sequences, where the first 2 bytes are randomly generated for each sequence in the series. > > > Byte-width = 5: 01001 01010 10011 10010 11101 01111 ... is a valid stream (without spaces, of course). 01001 + 01010 = 10011, and 10010 + 11101 = 01111 (after integer overflow). > > > Byte-width = 10: 1100110011 0101010101 0010001000 ... is a valid stream. 1100110011 + 0101010101 = 0010001000 (after overflow). > > > **The Rules:** > > Write a program that consumes the binary stream, and outputs (with 100% certainty) the byte-width. This puzzle has two parts, efficiency and code-golf. > > > Efficiency: Your score in this section is determined by the average number of bits your program must consume to make it's determination (after N>=1000 runs). > > > Golf: Your score in this section is determined by the number of characters used in your code. This number does not include the scaffolding to generate the stream, includes/imports, or boilerplate. For example, in C/C++: int main(){ ONLY\_THIS\_COUNTS }. > > > Your final score is equal to the multiplication of your scores in both sections. The lowest score wins. > > > [Answer] # Haskell 59.5 \* 228 = 13566 ``` import Data.List import Data.List.Split import Prelude.Unicode import System.Random findBW strm | i == 0 = (16, rest) | i < 3 = findBW rest | otherwise = (i, rest) where (bw,rest) = splitAt 4 strm i = sum $ zipWith ((*).(2^)) [0..] bw mkStream i strm = first ++ second ++ sum ++ mkStream i rest where (first,tmp) = splitAt i strm (second,rest) = splitAt i tmp sum = reverse $ g (reverse first) (reverse second) 0 run 100000 reps _ = print $ (reps*16*3) / 100000 run n reps gen = do p validstream run (n+1) (reps+rep) gen2 where (gen1,gen2) = System.Random.split gen (bytewidth, rndstream) = findBW $ randomRs (0::Int,1) gen1 validstream = mkStream bytewidth rndstream rep = fst $ until(\(_,t)->sum[1|x<-h#t,x]<2)(\(n,s)->(n+1,tail#s))(1,f validstream) main = do gen <- getStdGen run 0 0 gen r=reverse (#)=map h=head g[]_ _=[] g(a:b)(c:d)e=mod(a+c+e)2:g b d(div(a+c+e)2) c(m:n:o:p)=(g(r m)(r n)0≡r o):c p f s=(scanl1(∧).c.(`chunksOf`s))#[3..16] p=print.(3+).h.elemIndices True .(h#).until(\t->sum[1|x<-h#t,x]<2)(tail#).f ``` The average bits consumed in a run on 100,000 streams are around 59.3x / 59.4x , so I take 59.5 as the multiplier. For the golf part I count the characters of function `p` and it's helper functions, i.e. all characters beginning with `r=reverse` to the end. `p` is the function that analyses a bit stream and prints the byte-width. Note: there are some unicode characters, all counting 1. How it works: split the bit stream in chunks of 3 bits, 4 bits, ... 16 bits and check for validity. Repeat taking 3 of the chunks for every size until there's only one valid set. That means I consume 3\*16 = 48 bits per repetition. Most of the time one ore two repetitions are enough. ]
[Question] [ # Challenge You must, in the least bytes possible, implement the Binary Heap data structure and each of the following methods that operate on it: * A function which takes no arguments and returns an empty Heap * A function which takes a list of arguments with an arbitrary length and returns a Heap containing the elements * A function which takes two Heaps and merges them into a new Heap, returning it * A function which removes the root element of the Heap and reorders it accordingly, returning the root and new Heap * A function which takes an integer and a Heap, inserts it into the Heap, and returns the Heap # Clarifications * Your heap must be implemented as linking nodes created with structs, classes, custom types or equivalent, not using an array or list * You may implement either a max-heap or a min-heap, it is your choice. * You may assume that only integers are being stored in the heap * Your functions must be bound to a variable or name (and callable, obviously) * Standard loopholes are disallowed ## Resources * <http://en.wikipedia.org/wiki/Binary_heap> [Answer] # Haskell - 217 Golfed version ``` data H=H H Int H|E l E=0 l(H a _ b)=1+l a+l b i E x=H E x E i(H a y b)x|l a>l b=H a u$i b v|1>0=H(i a v)u b where(u,v)|x>y=(x,y)|1>0=(y,x) f=foldl i E t E=[] t(H a x b)=x:t a++t b m a b=f$t a++t b p(H a x b)=(x,m a b) ``` Same, but with meaningfull names. Straightforward heap implemented as a binary tree, it can be either `Empty` or `Heap leftBranch element rightBranch`. ``` data Heap=Heap Heap Int Heap|Empty len Empty=0 len(Heap a _ b)=1+len a+len b insert Empty x=Heap Empty x Empty insert(Heap a y b)x |len a>len b=Heap a u$insert b v |1>0=Heap(insert a v)u b where (u,v)|x>y=(x,y) |1>0=(y,x) fromList=foldl insert Empty toList Empty=[] toList(Heap a x b)=x:toList a++toList b merge a b=fromList$toList a++toList b pop(Heap a x b)=(x,merge a b) ``` [Answer] ## Lua - 275 (Already lost :D) ``` function f(s)return loadstring(s)end;f(([[a=f"_{}"b=f"t={...}&sort(t)_t"c=f"z={...}_f('x={'..&concat(z[1],',')..','..&concat(z[2],',')..'}&sort(x)_x')()"d=f"z={...}z=z[1]r=z[#z]&remove(z,#z)_z,r"e=f"z={...}&insert(z[1],z[2])_z[1]"]]):gsub("&","table."):gsub("_","return "))() ``` How it works: ``` function newHeap() return {} end function insertItemsToHeap(...) heap = {...} table.sort(heap) return heap end function margeHeaps(heap1, heap2) x = loadstring("return {"..table.concat(heap1,",")..","..table.concat(heap2,",").."}")() table.sort(x) return x end function removeRoot(...) z = {...} z = z[1] r = z[#z] table.remove(z,#z) return z, r end function insertInt(heap, int) table.insert(heap, int) return heap end ``` Note: I have no previous experience with Binary Heaps once however, hope this is right. ]
[Question] [ I wrote some perl to sort by debian package version number (specification [here](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version)). Whilst readable, it was disappointingly long (114 lines, 2042 characters) - shocking. So this challenge is to produce the shortest program (in perl or otherwise) which takes debian package version numbers on `STDIN` separated by `\n`, sorts them, and puts the output on `STDOUT` separated by `\n`. You can produce an dataset of debian versions numbers on a debian/ubuntu box by: ``` apt-cache madison . | perl -n -e 'print "$1\n" if /^\S+\s+\|\s+(\S+)\s+/;' ``` For those not on Debian / Ubuntu I've put a random selection of 1000 [here](http://pastebin.com/GuiUDQ6x). The sorted version of this sample is [here](http://pastebin.com/rh9KrShX). The `md5sum` of the unsorted and sorted versions (check they each end with a `\n`) are: ``` 5ffd12d3f59b06619a712e92791c0dfd input.sample e6b2d03ddfd9491c5bdf2594a5aa82e5 output.sample ``` *(note as Ventero points out in the comments, there are certain equivalent version numbers, e.g. lines 135-138 out of the output, where 08 and 8 are equivalent and thus the sort order is arbitrary)* For the purposes of verifying your input, you can install `Debian::Dpkg::Version` from CPAN and use the following to test: ``` #!/usr/bin/perl use strict; use warnings; use Debian::Dpkg::Version; my @input; while (<>) { chomp; push @input, $_; } my @output = sort version_compare (@input); print join("\n", @output)."\n"; ``` The following test data is thus sorted in the correct order, and (I believe) only contains lines complying with the Debian spec above, with each version being distinct: ``` 0~~-~~ 0~~-~ 0~-~~ 0~-~ 0~-0 0-0 0-1 0-02 3-0 04-0 04a-0 5-0 04:3-0 5:3-0 06:3-0 06:3a-0 06:3a-01 06:3a-3~ 06:3a-3 6:3a-04 06:3a-05 06:3.-0 06:3:a 06:3:a-01 06:3:a-05 ``` The rules are: * Package name sorting must be exactly per the Debian spec * No inclusion of external modules written to perform Debian packages sorting, as that would make it rather easy. Therefore golfing the above test program will not produce a legal answer, as it includes `Debian::Dpkg::Version`. You may of course look to the source of that module for inspiration if you lack imagination, but I believe there are shorter ways to do this. * You may assume that any input line whose format is invalid (i.e. does not constitute a version number conforming to the debian spec) must be retained, but may be sorted arbitrarily. * Equivalent version numbers may be sorted arbitrarily, e.g. `0.08-1` is equivalent to `0.8-1` as the numeric components `08` and `8` are compared as integers. * Save in respect of the arbitrary sort order of any lines not constituting version numbers conforming to the debian spec, and equivalent version numbers, your output should be identical to the test program above. [Answer] ## Ruby 2.0, 145 ~~179~~ characters ``` puts$<.sort_by{|a|(1..3).map{|i|"#{a[/^(\d+:)?(.+?)(-[^-]+)? /,i]}".scan(/(\D*)(\d*)/).map{|w,n|w.bytes.map{|c|c<126?c>58?c:c+99:-1}+[0,n.hex]}}} ``` Correctly sorts both the linked reference input (though it generates a slightly different output order due to different sorting of equivalent version numbers, e.g. `1.06-2` vs `1.6-2`) and the included test data. ]
[Question] [ This challenge is inspired by a problem I encountered recently out in the real-world, though ultimately I cheated and found a workaround. ### Challenge The input is a space-separated table of characters (each line is a row, and every line will have the same number of columns). Your challenge is to group together co-occurring column values and output a 'compressed' table, and there may be duplicate rows. Let's look at an example: **input:** ``` A X I B X I A Y I B X I B Y I ``` **output:** ``` AB XY I ``` The output is parsed as the *cartesian product* between each column: ``` AB XY = A X, B X, A Y, B Y ``` The union of cartesian products of columns in each output row must exactly match the set of all unique input rows. In other words, no skipping input rows and no specifying input rows that don't exist! For further exampling, note that if the third column contained anything other than `I`, this would be harder to compress: **input:** ``` A X I B Y I A Y $ B X I B Y I ``` **output:** ``` A X I A Y $ B XY I ``` ### Rules * no non-standard libraries or calls to high-level compression functions. The spirit of the question is to write the algorithm yourself! * output must be in the same format as inputs (zipping your output files is cheating) * no hard-coding the answers of each test file. Your program needs to be able to handle arbitrary (correct) inputs. ### Scoring (lowest wins) * Size of your program in bytes (you may count the name of the input as a single byte) * Plus the size (in bytes) of all of your output files on the given tests. * -10% bonus if you have the fastest program (as it runs on my machine). Speed will be measured as the average time on 10 randomly generated test cases using `generate.py 6 8 4 6 5` (the same 10 files for each program of course) ### Test Files These files are generated with [this python script](http://pastebin.com/Qa6F8pTM). The answer keys aren't guaranteed to be the minimum compression - you may be able to do better! * [Input 1](http://pastebin.com/uFiV5k23), [Answer Key 1](http://pastebin.com/qFfX15yT), generated with `python generate.py 5 10 4 6 5` * [Input 2](http://pastebin.com/tDfxgw98), [Answer Key 2](http://pastebin.com/4ZY7AVPh), `python generator.py 7 6 2 4 6` * [Input 3](http://pastebin.com/N2cMyEnZ), [Answer Key 3](http://pastebin.com/YuDrJpga), ...edit: the numbers here were wrong [Answer] I'll start things off with the simplest possible answer.. According to my own specifications, the input file qualifies as a 'compression' of itself (albeit not a very efficient one). **Python: 22+3359+183735+239 with 10% bonus = 168619.5** ``` print open('testfile').read() ``` ]
[Question] [ The truncated octahedron is a shape that has the interesting property that it can tessellate an entire 3D space so that any two solids that meet by an edge or corner also meet by a face, in a configuration called the [bitruncated cubic honeycomb](http://en.wikipedia.org/wiki/Bitruncated_cubic_honeycomb). This gives it the special property that there is only one metric for adjacency distance [unlike a cubic grid where two cubes touching by only a corner have a face distance of 3], a property which is shared by a hexagonal grid in two dimensions. Any solid in the bitruncated cubic honeycomb can be represented by the 3D coordinates `(a+h, b+h, c+h)` where `a, b, c` are integers and `h` is either 0 or 1/2. Any solid at `(x, y, z)` is adjacent to the solids at the following locations: ``` x, y, z+1 x, y, z-1 x, y+1, z x, y-1, z x+1, y, z x-1, y, z x+1/2, y+1/2, z+1/2 x+1/2, y+1/2, z-1/2 x+1/2, y-1/2, z+1/2 x+1/2, y-1/2, z-1/2 x-1/2, y+1/2, z+1/2 x-1/2, y+1/2, z-1/2 x-1/2, y-1/2, z+1/2 x-1/2, y-1/2, z-1/2 ``` Your task is to build a program that, given the locations of two truncated octahedrons in the above arrangement, finds their distance. You can take input in any format you wish. The shortest code to do this in any language wins. [Answer] # Golfscript, ~~10~~ 13 characters ``` ~{$~\-}%$~+\; ``` input: a space-separated array of three two-element arrays of integers, wrapped in square brackets. Each pair of integers denotes the coordinates of both octahedra in one axis. If half-coordinate inputs are to be supported, the input should be scaled up by an even factor (say, 10). output: a single integer, scaled up by the same amount as the input reads: "eval the input, for each axis: {sort both coordinates, then subtract the smaller from the larger}, sort the differences, then dump them onto the stack (resulting in three separate numbers), add the top two (= largest two coordinates) and discard the element just below". proof: the algorithm to reach a destination in this amount of steps is: * If all three coordinate differences are nonzero, make a diagonal step. This reduces all three differences by 0.5, meaning their order doesn't change and the sum of the largest two differences reduces by 1 * If only one coordinate difference is nonzero, make an orthogonal step. This reduces the largest difference by 1 * If two of the difference are nonzero, either of these steps can be chosen. Thus, this algorithm never underestimates the distance. Also, it is not possible to reduce the sum of top largest two differences by more than 1 in a single step, meaning this algorithm never overestimates either. Thus, the algorithm "sum of the largest two absolute values of coordinate differences" is correct. example: ``` ;"[[20 0] [30 0] [20 -20]]" ~{$~\-}%$~+\; #70 ``` test: <http://golfscript.apphb.com/?c=OyJbWzIwIDBdIFszMCAwXSBbMjAgLTIwXV0iCn57JH5cLX0lJH4rXDs%3D> [Answer] ## APL, ~~14~~ 13 ``` x+.×1<⍋x←|⎕-⎕ ``` 1 char saving if I'm allowed to change system variables in configurations Prompts for input twice, enter space-separated coords both times. Thanks to Jan ]
[Question] [ The [blancmange function](http://en.wikipedia.org/wiki/Blancmange_curve) is used as an example in basic calculus of a function that is continuous everywhere, but differentiable nowhere. It achieves this effect by using the sums of ever-diminishing triangle-wave functions. Your task is to build a program that takes a binary fractional number in the interval [0, 1] and returns the exact height of the blancmange curve at that position. Both fractions can be represented using the notation of your choice, but if you are using a nonstandard one (e.g. not IEEE floating-point or an integer with a fixed radix point), you must explain it in your solution, and your notation must support an accuracy of at least 2-52. [Answer] # Ruby, 53 characters ``` f=->x{x>0?f[2*x=x<0.5?x:1-x]/2+x: 0} $><<f[gets.to_f] ``` expanded: ``` f = lambda do |x| if i>0 x = 1 - x unless x < 0.5 return x + f[2*x] / 2 else return 0 end end print f[gets.to_f] ``` The input is a decimal value, assumed to be in the range 0..1 . The output is a decimal value. The platform native double precision numeric type is used, and is assumed to be at least 53 bits of mantissa. Since every floating point value in a binary fraction, this algorithm will always terminate after at most 53 (with the default precision) steps. [Answer] # Mathematica 92 chars This uses exact arithmetic (fractions). ``` b@n_:=FoldList[#+{1,#2}/2^n&,{0,0}, Total/@ (2 Reverse[IntegerDigits[#,2,n]&/@Range[0,2^n-1]]-1)] ``` > > {{{0, 0}, {1/2, 1/2}, {1, 0}}, {{0, 0}, {1/4, 1/2}, {1/2, 1/2}, {3/4, > 1/2}, {1, 0}}, {{0, 0}, {1/8, 3/8}, {1/4, 1/2}, {3/8, 5/8}, {1/2, > 1/2}, {5/8, 5/8}, {3/4, 1/2}, {7/8, 3/8}, {1, 0}}, {{0, 0}, {1/16, > 1/4}, {1/8, 3/8}, {3/16, 1/2}, {1/4, 1/2}, {5/16, 5/8}, {3/8, 5/ > 8}, {7/16, 5/8}, {1/2, 1/2}, {9/16, 5/8}, {5/8, 5/8}, {11/16, 5/ > 8}, {3/4, 1/2}, {13/16, 1/2}, {7/8, 3/8}, {15/16, 1/4}, {1, 0}}} > > > ![Takagi](https://i.stack.imgur.com/mwtul.png) Source: Borut Levart [http : // demonstrations.wolfram.com/TakagiCurve/ ] [Answer] # Mathcad, 73 "bytes" The Mathcad worksheet shown here defines the triangle function s(x) and the blancmange function (blanc(x) - but deemed to be just b(x) for golfing purposes). It also presents two variants, one specialized for rational numbers with power of two divisors, and one specialized for number of iterations of the summation. The worksheet also presents plots of the various blancmange functions and tables of their results. The blancmange function works in both numeric (IEEE floating point) and symbolic (arbitrary arithmetic) modes. [![enter image description here](https://i.stack.imgur.com/MdXtl.jpg)](https://i.stack.imgur.com/MdXtl.jpg) Mathcad uses a virtual 2D worksheet on which the user places text or executable expressions (eg, formula or programs). Mathcad saves its worksheets in an XML format, which means that even a small program can be many hundreds or thousands of text characters long. For the purposes of code golfing, I take a Mathcad "byte" to mean the number of distinct symbols that the user must enter to create a program. For example, to evaluate an expression, the user types "="; Mathcad will place an evaluation operator on the worksheet, which gives the appearance of an "=" sign bounded by two black box symbols (known as placeholders). Writing an expression in the left hand placeholder will cause Mathcad to evaluate the expression and put the result in the right hand placeholder. If the expression is a simple variable, "a" say, that contains a value, then from an user perspective this would count as 2 byte program "a" and "=". Raising one number to the power of another comprises entering the exponent operator (^) and then entering the two numbers in the appropriate placeholders. So, 3^4 would be a 3 byte program. [Answer] ## JavaScript (ES6), 35 bytes ``` B=x=>x%1?B(2*x%1)/2+(x<1/2?x:1-x):0 ``` A straightforward implementation of [this recursive formula](https://en.wikipedia.org/wiki/Blancmange_curve#Recursive_definition). [Answer] Not sure if this counts, but this Pari GP implementation works for any x. **53 bytes** `s(x)=abs(x-round(x)); bm(x)=sum(i=0,50,s(2^i*x)/2^i);` ]
[Question] [ Write a class containing a method with the signature ``` System.Array ChangeElementType(System.Array jaggedArray) ``` (you may rename identifiers `ChangeElementType`, `jaggedArray` and shorten the type `System.Array` with `using` directives). The class may contain any additional members if needed. You may assume the following preconditions (and do not need to validate them): * The argument `jaggedArray` is not `null`. * The argument `jaggedArray` is an array instance whose type can be represented in C# notation as `int[...]...`, i.e. the type `int` followed by 1 or more rank specifiers `[...]` where each rank specifier is a pair or square brackets with 0 or more commas between them. For example, it could be an array of type `int[]`, `int[,][][,,,]`, etc. * No element at any level of the `jaggedArray` is `null`. * All elements at any level of the `jaggedArray` are distinct w.r.t. reference equality (i.e. the same array instance does not appear at several different positions). * The [lower bound](http://msdn.microsoft.com/en-us/library/system.array.getlowerbound.aspx) of any array dimension is 0. * The length of any dimension and the total number of elements of any array fits into the type `int`. The method must create and return an array of type `long[...]...` which is obtained from the type of `jaggedArray` by replacing `int` with `long` and keeping all rank specifiers the same. The result must have the same shape as `jaggedArray`, i.e. all array dimensions at any level must be the same. All elements at the innermost level must have the same numeric values (cast from `int` to `long`). The method must not mutate the argument `jaggedArray` or any its elements at any level. The solution may be implemented in any language for the .NET platform: C#, F#, VB.NET, MSIL, C++/CLI, etc. All necessary `using`, `open` or `imports` directives or fully qualified names must be explicitly specified (do not rely on IDE defaults). The only referenced assembly must be `mscorlib`, no P/Invoke or COM Interop allowed. The solution cannot access any Internet services to get the result, intermediate data or to download parts of an algorithm. It is a golf — try to minimize the number of bytes in the source. [Answer] # C# - 396 ~~440~~ ~~595~~ I'm not entirely sure why I did this, and I can't help but feel I'm missing something. Rewrote the old `c` (for copy) method as a for-loop in the ChangeElementType method (`f`). Unless I find something substantial, I think I'll not be making this any shorter. Golfed code: ``` using A=System.Array;using T=System.Type;class P{T g(T o){return o.IsArray?g(o.GetElementType()).MakeArrayType(o.GetArrayRank()):typeof(long);}A f(A a){var R=a;int i,r;for(var x=new int[i=r=a.Rank];;){if(i<1){if(a!=R)return R;R=A.CreateInstance(g(a.GetType().GetElementType()),x);i=1;}if(--i<r)if(x[i]-->0)i+=2;else x[i]=a.GetLength(i);else{var o=a.GetValue(x);R.SetValue(o is A?f((A)o):o,x);}}}} ``` Readable code with an excuse for a test: ``` using A=System.Array; using T=System.Type; class P { // turns a type like "int[,][]" into "long[,][]" T g(T o) { return o.IsArray?g(o.GetElementType()).MakeArrayType(o.GetArrayRank()):typeof(long); } // ChangeElementType A f(A a) { var R=a; // R is the result, a gives us the type and a nice default value int i,r; // i is a counter, r is the rank // this loop first counts backwards filling the x array with the dimension lengths // then it does a tree traversal and copies things about for(var x=new int[i=r=a.Rank];;) // create the x array, and sets i and r { if(i<1) { // gone off start if(a!=R) // been here before return R; // return the result R=A.CreateInstance(g(a.GetType().GetElementType()),x); // create the array to fill i=1; // move to start of x } if(--i<r) // move back if(x[i]-->0) // decrement index i+=2; // move forward instead else x[i]=a.GetLength(i); // reset index else { var o=a.GetValue(x); // get the int/array R.SetValue(o is A?f((A)o):o,x); // if it's an array, Change it, if not, pass it directly (the int) } } } // test method (prints True if the code works, might print False if it doesn't) static void Main() { string old = ""; var a = new int[10][,]; for (int i = 0; i < 10; i++) { a[i] = new int[3,5]; for (int j = 0; j < 3; j++) { for (int k = 0; k < 5; k++) { int v = i * j * k; a[i][j,k] = v; old += v.ToString(); } } } long[][,] l = (long[][,])(new P().f(a)); string nwe = ""; for (int i = 0; i < 10; i++) { for (int j = 0; j < 3; j++) { for (int k = 0; k < 5; k++) { nwe += l[i][j,k].ToString(); } } } System.Console.WriteLine(old == nwe); System.Console.ReadKey(true); } } ``` ]
[Question] [ Here is a real question somebody asked me. Suppose you have `n` teams, one terrain. * Each team must play each other team exactly once. * The number of times a team plays two matches in a row should be minimized. The problem is hard if not optimized. Your program should be able to answer this question for up to 6 teams (at least) in a reasonable time (say less than an hour). For 5 teams I have a working program which works in less than a minute. Here is an example for 5 teams. ``` $ organize_for 5 [(3,5),(1,2),(4,5),(1,3),(2,4),(1,5),(2,3),(1,4),(2,5),(3,4)] ``` And another for 6 teams. ``` $ organize_for 6 [(2,4),(1,5),(2,3),(1,6),(3,5),(1,4),(2,5),(1,3),(4,6),(1,2),(3,6),(4,5),(2,6),(3,4),(5,6)] ``` NB for 3 and 4 teams, you'll have at least two occurrences of a team playing two matches in a row. To win: make the shortest program to answer this problem fast enough to give you a correct answer for 6 teams. **Bonuses**: 1. The median of the median of the waiting time between two matches for all teams should be maximized. Example: from organize\_for 5 ; nb match between the next one (sorted, median is the one in the center) ``` team 1 -> 1, 1, 1 (sorted => 1, 1, 1, median => 1) team 2 -> 2, 1, 1 (sorted => 1, 1, 2, median => 1) team 3 -> 2, 2, 2 (sorted => 2, 2, 2, median => 2) team 4 -> 1, 2, 1 (sorted => 1, 1, 2, median => 1) team 5 -> 1, 2, 2 (sorted => 1, 2, 2, median => 2) medians: (1, 1, 2, 1, 2), sorted => (1, 1, 1, 2, 2) median of the medians = 1. ``` 2. Generalize for `k` terrains. All match have the same duration. * The most important rules remains a team shouldn't do a match just after another. * The global time for all matches should be minimized [Answer] Haskell: **291** chars Another solution which terminate only if there is a solution without any collision (5 and 6). It is also very fast: ``` import System.Environment import Data.List a n=[(x,y)|x<-[1..n],y<-[1..n],x<y] s []=[[]] s (m:[])=[[m]] s ((x,y):(x',y'):xs ) |(x==x')||(x==y')||(y==x')||(y==y')=s((x,y):xs++[(x',y')]) |0<1=[(x,y):ys|ys<-s((x',y'):xs)] main=do args <- getArgs print $ head $ s $ a (read(head args)::Int) ``` [Answer] ## Python 282 247 chars ``` import sys n=int(sys.argv[1])+1 r=range l=[(i,j)for i in r(1,n)for j in r(i+1,n)] m=[(),()] while l: o,p=h=l.pop(0);v=[] for k in r(len(m)-1):g=m[k]+m[k+1];v+=[o in g or p in g] m.insert(v.index(0)+1,h)if min(v)<1 else l.append(h) print m[1:-1] ``` UPD: working for n>4, for testing add: ``` lst = m[1:-1] conflicts = 0 for i in range(len(lst)-1): if lst[i][0] in lst[i+1] or lst[i][1] in lst[i+1]: conflicts += 1 print 'Conflicts: {}'.format(conflicts) ``` [Answer] Haskell **585** chars ``` import System.Environment import Data.Ord import Data.List a::Int->[(Int,Int)] a n=[(x,y)|x<-[1..n],y<-[1..n],x<y] b::[(Int,Int)]->Int b ((x,y):((z,t):rest))|x==z=1+b ((z,t):rest) |x==t=1+b ((z,t):rest) |y==z=1+b ((z,t):rest) |y==t=1+b ((z,t):rest) |otherwise=b ((z,t):rest) b _=0 c l=(b l,l) d [] _=[[]] d l minimal=[x:s|x<-l,s<-take 10 $ filter (\ts->b ts<minimal) (d (delete x l) minimal)] e n minimal=take 1 $ sortBy (comparing fst) $ map c (d (a n) minimal) f []=False f _=True g n=head $ filter f $ map (e n) [0..] main = do args<-getArgs print $ g (read (head args)::Int) ``` Here is the non code golfed version: ``` import System.Environment import Data.Ord import Data.List all_matches :: Int -> [(Int,Int)] all_matches n = [ (x,y) | x <- [1..n], y <- [1..n], x < y ] price :: [(Int,Int)] -> Int price ((x,y):((z,t):rest)) | x==z = 1 + price ((z,t):rest) | x==t = 1 + price ((z,t):rest) | y==z = 1 + price ((z,t):rest) | y==t = 1 + price ((z,t):rest) | otherwise = price ((z,t):rest) price _ = 0 addPrices xs = (price xs, xs) myPerm [] _ = [[]] myPerm xs minimal = [x:ys | x <- xs, ys <- take 10 $ filter (\ts -> price ts < minimal) (myPerm (delete x xs) minimal)] find_best_under n minimal = take 1 $ sortBy (comparing fst) $ map addPrices ( myPerm (all_matches n) minimal) isNonEmpty [] = False isNonEmpty _ = True find_best n = head $ filter isNonEmpty $ map (find_best_under n) [0..] main = do args <- getArgs putStrLn $ show $ find_best (read (head args)::Int) ``` It only search for local optima. But in this case, local optima are also global one up to 6 teams. ]
[Question] [ **Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers. --- **Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/1766/edit). Closed 1 year ago. [Improve this question](/posts/1766/edit) Train a two-layer perceptron. You will find the [Wikipedia](http://en.wikipedia.org/wiki/Multilayer_perceptron) article and these [lecture slides](http://redwood.berkeley.edu/vs265/superlearn.pdf) useful. Use a sigmoid activation function for both the hidden and output layers, $$\sigma(x) = \frac{1}{1 + e^{-x}}$$ Your function should take in a list or array of input/output pairs and an integer specifying how many training passes through the input set to make. Both the input and output will be vectors of any convenient representation in your language. You should output or otherwise initialize a classifier function or object. Initialize the weights randomly and to prevent overflow/underflow, normalize the weight vectors after each update. You should handle input data vectors up to 1000 dimensions and at least 10 output dimensions. The classifier function should return a vector of the activation levels of each of the outputs. You may assume access to implementations of all of the [BLAS](http://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms) routines. The [MNIST](http://yann.lecun.com/exdb/mnist/) database has a very large training and test set you might find useful for testing purposes. **EDIT:** Example dataset. Input and output vectors (input). ``` Input Output [0,0] [0] [0,1] [1] [1,0] [1] [1,1] [0] ``` Your program should produce a classifier that takes in a vector of two elements and returns a vector of one element that has similar behavior as the input. [Answer] I'm going to cheat here, hence community wiki: instead of logistic sigmoid, I'll use the hyperbolic tangent and instead of backprop, I'll use [ELM](http://www.ntu.edu.sg/home/egbhuang/) to train the perceptron. Here's the version for XOR, in Python, using BLAS via SciPy. ``` import numpy as np from scipy.linalg import pinv2 n_hidden = 10 # hyperparameter # Training set X_train = np.array([[0,0], [0,1], [1,0], [1,1]]) y_train = [0, 1, 1, 0] # set hidden layer parameters randomly w = np.random.randn(X_train.shape[1], n_hidden) b = np.random.randn(n_hidden) # compute hidden layer activation H = np.tanh(np.dot(X_train, w) + b) # fit output layer parameters beta = np.dot(pinv2(H), np.atleast_2d(y_train).T) # prediction and evaluation pred_train = (np.dot(H, beta) > .5).ravel() print "Training set accuracy:", np.mean(pred_train == y_train) ``` I previously published a [digits classification](https://gist.github.com/2493300) script using this algorithm. After removing comments, this is 11 lines of code @ 425 characters. ]
[Question] [ ## Introduction I would like to drawn a nice *spinner* by using eight braille patterns on two lines, drawing a square of 8x8 ***pixel***, for showing a kind of *snake* growing and reducing: ``` declare -a shapes=([0]=$'\E[A⠁⠀⠀⠀\E[B\E[4D⠀⠀⠀⠀' [1]=$'\E[A⠈⠀⠀⠀\E[B\E[4D⠀⠀⠀⠀' [2]=$'\E[A⠀⠁⠀⠀\E[B\E[4D⠀⠀⠀⠀' [3]=$'\E[A⠀⠈⠀⠀\E[B\E[4D⠀⠀⠀⠀' [4]=$'\E[A⠀⠀⠁⠀\E[B\E[4D⠀⠀⠀⠀' [5]=$'\E[A⠀⠀⠈⠀\E[B\E[4D⠀⠀⠀⠀' [6]=$'\E[A⠀⠀⠀⠁\E[B\E[4D⠀⠀⠀⠀' [7]=$'\E[A⠀⠀⠀⠈\E[B\E[4D⠀⠀⠀⠀' [8]=$'\E[A⠀⠀⠀⠐\E[B\E[4D⠀⠀⠀⠀' [9]=$'\E[A⠀⠀⠀⠠\E[B\E[4D⠀⠀⠀⠀' [10]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⠀⠀⠀⠀' [11]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⠀⠈' [12]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⠀⠐' [13]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⠀⠠' [14]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⠀⢀' [15]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⠀⡀' [16]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⢀⠀' [17]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⡀⠀' [18]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⢀⠀⠀' [19]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⡀⠀⠀' [20]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⢀⠀⠀⠀' [21]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⡀⠀⠀⠀' [22]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠄⠀⠀⠀' [23]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠂⠀⠀⠀' [24]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠁⠀⠀⠀' [25]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⠀⠀⠀⠀' [26]=$'\E[A⠄⠀⠀⠀\E[B\E[4D⠀⠀⠀⠀' [27]=$'\E[A⠂⠀⠀⠀\E[B\E[4D⠀⠀⠀⠀' [28]=$'\E[A⠁⠀⠀⠀\E[B\E[4D⠀⠀⠀⠀' [29]=$'\E[A⠉⠀⠀⠀\E[B\E[4D⠀⠀⠀⠀' [30]=$'\E[A⠈⠁⠀⠀\E[B\E[4D⠀⠀⠀⠀' [31]=$'\E[A⠀⠉⠀⠀\E[B\E[4D⠀⠀⠀⠀' [32]=$'\E[A⠀⠈⠁⠀\E[B\E[4D⠀⠀⠀⠀' [33]=$'\E[A⠀⠀⠉⠀\E[B\E[4D⠀⠀⠀⠀' [34]=$'\E[A⠀⠀⠈⠁\E[B\E[4D⠀⠀⠀⠀' [35]=$'\E[A⠀⠀⠀⠉\E[B\E[4D⠀⠀⠀⠀' [36]=$'\E[A⠀⠀⠀⠘\E[B\E[4D⠀⠀⠀⠀' [37]=$'\E[A⠀⠀⠀⠰\E[B\E[4D⠀⠀⠀⠀' [38]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⠀⠀⠀⠀' [39]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⠀⠀⠀⠈' [40]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⠀⠘' [41]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⠀⠰' [42]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⠀⢠' [43]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⠀⣀' [44]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⢀⡀' [45]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⣀⠀' [46]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⢀⡀⠀' [47]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⣀⠀⠀' [48]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⢀⡀⠀⠀' [49]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣀⠀⠀⠀' [50]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⡄⠀⠀⠀' [51]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠆⠀⠀⠀' [52]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠃⠀⠀⠀' [53]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⠁⠀⠀⠀' [54]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⠀⠀⠀⠀' [55]=$'\E[A⠆⠀⠀⠀\E[B\E[4D⠀⠀⠀⠀' [56]=$'\E[A⠃⠀⠀⠀\E[B\E[4D⠀⠀⠀⠀' [57]=$'\E[A⠉⠀⠀⠀\E[B\E[4D⠀⠀⠀⠀' [58]=$'\E[A⠉⠁⠀⠀\E[B\E[4D⠀⠀⠀⠀' [59]=$'\E[A⠈⠉⠀⠀\E[B\E[4D⠀⠀⠀⠀' [60]=$'\E[A⠀⠉⠁⠀\E[B\E[4D⠀⠀⠀⠀' [61]=$'\E[A⠀⠈⠉⠀\E[B\E[4D⠀⠀⠀⠀' [62]=$'\E[A⠀⠀⠉⠁\E[B\E[4D⠀⠀⠀⠀' [63]=$'\E[A⠀⠀⠈⠉\E[B\E[4D⠀⠀⠀⠀' [64]=$'\E[A⠀⠀⠀⠙\E[B\E[4D⠀⠀⠀⠀' [65]=$'\E[A⠀⠀⠀⠸\E[B\E[4D⠀⠀⠀⠀' [66]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⠀⠀⠀⠀' [67]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⠀⠀⠀⠈' [68]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⠀⠀⠀⠘' [69]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⠀⠸' [70]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⠀⢰' [71]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⠀⣠' [72]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⢀⣀' [73]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⣀⡀' [74]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⢀⣀⠀' [75]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⣀⡀⠀' [76]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⢀⣀⠀⠀' [77]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣀⡀⠀⠀' [78]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣄⠀⠀⠀' [79]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⡆⠀⠀⠀' [80]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠇⠀⠀⠀' [81]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⠃⠀⠀⠀' [82]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⠁⠀⠀⠀' [83]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⠀⠀⠀⠀' [84]=$'\E[A⠇⠀⠀⠀\E[B\E[4D⠀⠀⠀⠀' [85]=$'\E[A⠋⠀⠀⠀\E[B\E[4D⠀⠀⠀⠀' [86]=$'\E[A⠉⠁⠀⠀\E[B\E[4D⠀⠀⠀⠀' [87]=$'\E[A⠉⠉⠀⠀\E[B\E[4D⠀⠀⠀⠀' [88]=$'\E[A⠈⠉⠁⠀\E[B\E[4D⠀⠀⠀⠀' [89]=$'\E[A⠀⠉⠉⠀\E[B\E[4D⠀⠀⠀⠀' [90]=$'\E[A⠀⠈⠉⠁\E[B\E[4D⠀⠀⠀⠀' [91]=$'\E[A⠀⠀⠉⠉\E[B\E[4D⠀⠀⠀⠀' [92]=$'\E[A⠀⠀⠈⠙\E[B\E[4D⠀⠀⠀⠀' [93]=$'\E[A⠀⠀⠀⠹\E[B\E[4D⠀⠀⠀⠀' [94]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⠀⠀⠀⠀' [95]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⠀⠀⠀⠈' [96]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⠀⠀⠀⠘' [97]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⠀⠀⠀⠸' [98]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⠀⢸' [99]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⠀⣰' [100]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⢀⣠' [101]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⣀⣀' [102]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⢀⣀⡀' [103]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⣀⣀⠀' [104]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⢀⣀⡀⠀' [105]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣀⣀⠀⠀' [106]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣄⡀⠀⠀' [107]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣆⠀⠀⠀' [108]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⡇⠀⠀⠀' [109]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⠇⠀⠀⠀' [110]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⠃⠀⠀⠀' [111]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⠁⠀⠀⠀' [112]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⠀⠀⠀⠀' [113]=$'\E[A⠏⠀⠀⠀\E[B\E[4D⠀⠀⠀⠀' [114]=$'\E[A⠋⠁⠀⠀\E[B\E[4D⠀⠀⠀⠀' [115]=$'\E[A⠉⠉⠀⠀\E[B\E[4D⠀⠀⠀⠀' [116]=$'\E[A⠉⠉⠁⠀\E[B\E[4D⠀⠀⠀⠀' [117]=$'\E[A⠈⠉⠉⠀\E[B\E[4D⠀⠀⠀⠀' [118]=$'\E[A⠀⠉⠉⠁\E[B\E[4D⠀⠀⠀⠀' [119]=$'\E[A⠀⠈⠉⠉\E[B\E[4D⠀⠀⠀⠀' [120]=$'\E[A⠀⠀⠉⠙\E[B\E[4D⠀⠀⠀⠀' [121]=$'\E[A⠀⠀⠈⠹\E[B\E[4D⠀⠀⠀⠀' [122]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⠀⠀⠀⠀' [123]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⠀⠀⠀⠈' [124]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⠀⠀⠀⠘' [125]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⠀⠀⠀⠸' [126]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⠀⠀⠀⢸' [127]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⠀⣸' [128]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⢀⣰' [129]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⣀⣠' [130]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⢀⣀⣀' [131]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⣀⣀⡀' [132]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⢀⣀⣀⠀' [133]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣀⣀⡀⠀' [134]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣄⣀⠀⠀' [135]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣆⡀⠀⠀' [136]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣇⠀⠀⠀' [137]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⡇⠀⠀⠀' [138]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⠇⠀⠀⠀' [139]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⠃⠀⠀⠀' [140]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⠁⠀⠀⠀' [141]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⠀⠀⠀⠀' [142]=$'\E[A⠏⠁⠀⠀\E[B\E[4D⠀⠀⠀⠀' [143]=$'\E[A⠋⠉⠀⠀\E[B\E[4D⠀⠀⠀⠀' [144]=$'\E[A⠉⠉⠁⠀\E[B\E[4D⠀⠀⠀⠀' [145]=$'\E[A⠉⠉⠉⠀\E[B\E[4D⠀⠀⠀⠀' [146]=$'\E[A⠈⠉⠉⠁\E[B\E[4D⠀⠀⠀⠀' [147]=$'\E[A⠀⠉⠉⠉\E[B\E[4D⠀⠀⠀⠀' [148]=$'\E[A⠀⠈⠉⠙\E[B\E[4D⠀⠀⠀⠀' [149]=$'\E[A⠀⠀⠉⠹\E[B\E[4D⠀⠀⠀⠀' [150]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⠀⠀⠀⠀' [151]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⠀⠀⠀⠈' [152]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⠀⠀⠀⠘' [153]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⠀⠀⠀⠸' [154]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⠀⠀⠀⢸' [155]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⠀⠀⠀⣸' [156]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⢀⣸' [157]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⣀⣰' [158]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⢀⣀⣠' [159]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⣀⣀⣀' [160]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⢀⣀⣀⡀' [161]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣀⣀⣀⠀' [162]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣄⣀⡀⠀' [163]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣆⣀⠀⠀' [164]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣇⡀⠀⠀' [165]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⣇⠀⠀⠀' [166]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⡇⠀⠀⠀' [167]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⠇⠀⠀⠀' [168]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⠃⠀⠀⠀' [169]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⠁⠀⠀⠀' [170]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⠀⠀⠀⠀' [171]=$'\E[A⠏⠉⠀⠀\E[B\E[4D⠀⠀⠀⠀' [172]=$'\E[A⠋⠉⠁⠀\E[B\E[4D⠀⠀⠀⠀' [173]=$'\E[A⠉⠉⠉⠀\E[B\E[4D⠀⠀⠀⠀' [174]=$'\E[A⠉⠉⠉⠁\E[B\E[4D⠀⠀⠀⠀' [175]=$'\E[A⠈⠉⠉⠉\E[B\E[4D⠀⠀⠀⠀' [176]=$'\E[A⠀⠉⠉⠙\E[B\E[4D⠀⠀⠀⠀' [177]=$'\E[A⠀⠈⠉⠹\E[B\E[4D⠀⠀⠀⠀' [178]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⠀⠀⠀⠀' [179]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⠀⠀⠀⠈' [180]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⠀⠀⠀⠘' [181]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⠀⠀⠀⠸' [182]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⠀⠀⠀⢸' [183]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⠀⠀⠀⣸' [184]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⠀⠀⢀⣸' [185]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⣀⣸' [186]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⢀⣀⣰' [187]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⣀⣀⣠' [188]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⢀⣀⣀⣀' [189]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣀⣀⣀⡀' [190]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣄⣀⣀⠀' [191]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣆⣀⡀⠀' [192]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣇⣀⠀⠀' [193]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⣇⡀⠀⠀' [194]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⣇⠀⠀⠀' [195]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⡇⠀⠀⠀' [196]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⠇⠀⠀⠀' [197]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⠃⠀⠀⠀' [198]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⠁⠀⠀⠀' [199]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⠀⠀⠀⠀' [200]=$'\E[A⠏⠉⠁⠀\E[B\E[4D⠀⠀⠀⠀' [201]=$'\E[A⠋⠉⠉⠀\E[B\E[4D⠀⠀⠀⠀' [202]=$'\E[A⠉⠉⠉⠁\E[B\E[4D⠀⠀⠀⠀' [203]=$'\E[A⠉⠉⠉⠉\E[B\E[4D⠀⠀⠀⠀' [204]=$'\E[A⠈⠉⠉⠙\E[B\E[4D⠀⠀⠀⠀' [205]=$'\E[A⠀⠉⠉⠹\E[B\E[4D⠀⠀⠀⠀' [206]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⠀⠀⠀⠀' [207]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⠀⠀⠀⠈' [208]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⠀⠀⠀⠘' [209]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⠀⠀⠀⠸' [210]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⠀⠀⠀⢸' [211]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⠀⠀⠀⣸' [212]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⠀⠀⢀⣸' [213]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⠀⠀⣀⣸' [214]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⢀⣀⣸' [215]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⣀⣀⣰' [216]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⢀⣀⣀⣠' [217]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣀⣀⣀⣀' [218]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣄⣀⣀⡀' [219]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣆⣀⣀⠀' [220]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣇⣀⡀⠀' [221]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⣇⣀⠀⠀' [222]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⣇⡀⠀⠀' [223]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⣇⠀⠀⠀' [224]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⡇⠀⠀⠀' [225]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⠇⠀⠀⠀' [226]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⠃⠀⠀⠀' [227]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⠁⠀⠀⠀' [228]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⠀⠀⠀⠀' [229]=$'\E[A⠏⠉⠉⠀\E[B\E[4D⠀⠀⠀⠀' [230]=$'\E[A⠋⠉⠉⠁\E[B\E[4D⠀⠀⠀⠀' [231]=$'\E[A⠉⠉⠉⠉\E[B\E[4D⠀⠀⠀⠀' [232]=$'\E[A⠉⠉⠉⠙\E[B\E[4D⠀⠀⠀⠀' [233]=$'\E[A⠈⠉⠉⠹\E[B\E[4D⠀⠀⠀⠀' [234]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⠀⠀⠀⠀' [235]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⠀⠀⠀⠈' [236]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⠀⠀⠀⠘' [237]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⠀⠀⠀⠸' [238]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⠀⠀⠀⢸' [239]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⠀⠀⠀⣸' [240]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⠀⠀⢀⣸' [241]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⠀⠀⣀⣸' [242]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⠀⢀⣀⣸' [243]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⣀⣀⣸' [244]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⢀⣀⣀⣰' [245]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣀⣀⣀⣠' [246]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣄⣀⣀⣀' [247]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣆⣀⣀⡀' [248]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣇⣀⣀⠀' [249]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⣇⣀⡀⠀' [250]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⣇⣀⠀⠀' [251]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⣇⡀⠀⠀' [252]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⣇⠀⠀⠀' [253]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⡇⠀⠀⠀' [254]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⠇⠀⠀⠀' [255]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⠃⠀⠀⠀' [256]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⠁⠀⠀⠀' [257]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⠀⠀⠀⠀' [258]=$'\E[A⠏⠉⠉⠁\E[B\E[4D⠀⠀⠀⠀' [259]=$'\E[A⠋⠉⠉⠉\E[B\E[4D⠀⠀⠀⠀' [260]=$'\E[A⠉⠉⠉⠙\E[B\E[4D⠀⠀⠀⠀' [261]=$'\E[A⠉⠉⠉⠹\E[B\E[4D⠀⠀⠀⠀' [262]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⠀⠀⠀⠀' [263]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⠀⠀⠀⠈' [264]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⠀⠀⠀⠘' [265]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⠀⠀⠀⠸' [266]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⠀⠀⠀⢸' [267]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⠀⠀⠀⣸' [268]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⠀⠀⢀⣸' [269]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⠀⠀⣀⣸' [270]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⠀⢀⣀⣸' [271]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⠀⣀⣀⣸' [272]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⢀⣀⣀⣸' [273]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣀⣀⣀⣰' [274]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣄⣀⣀⣠' [275]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣆⣀⣀⣀' [276]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣇⣀⣀⡀' [277]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⣇⣀⣀⠀' [278]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⣇⣀⡀⠀' [279]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⣇⣀⠀⠀' [280]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⣇⡀⠀⠀' [281]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⣇⠀⠀⠀' [282]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⡇⠀⠀⠀' [283]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⠇⠀⠀⠀' [284]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⠃⠀⠀⠀' [285]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⠁⠀⠀⠀' [286]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⠀⠀⠀⠀' [287]=$'\E[A⠏⠉⠉⠉\E[B\E[4D⠀⠀⠀⠀' [288]=$'\E[A⠋⠉⠉⠙\E[B\E[4D⠀⠀⠀⠀' [289]=$'\E[A⠉⠉⠉⠹\E[B\E[4D⠀⠀⠀⠀' [290]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⠀⠀⠀' [291]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⠀⠀⠀⠈' [292]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⠀⠀⠀⠘' [293]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⠀⠀⠀⠸' [294]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⠀⠀⠀⢸' [295]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⠀⠀⠀⣸' [296]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⠀⠀⢀⣸' [297]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⠀⠀⣀⣸' [298]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⠀⢀⣀⣸' [299]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⠀⣀⣀⣸' [300]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⢀⣀⣀⣸' [301]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣀⣀⣀⣸' [302]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣄⣀⣀⣰' [303]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣆⣀⣀⣠' [304]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣇⣀⣀⣀' [305]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⣇⣀⣀⡀' [306]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⣇⣀⣀⠀' [307]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⣇⣀⡀⠀' [308]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⣇⣀⠀⠀' [309]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⣇⡀⠀⠀' [310]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⣇⠀⠀⠀' [311]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⡇⠀⠀⠀' [312]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⠇⠀⠀⠀' [313]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⠃⠀⠀⠀' [314]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⠁⠀⠀⠀' [315]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⠀⠀⠀⠀' [316]=$'\E[A⠏⠉⠉⠙\E[B\E[4D⠀⠀⠀⠀' [317]=$'\E[A⠋⠉⠉⠹\E[B\E[4D⠀⠀⠀⠀' [318]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⠀⠀⠀' [319]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⠀⠀⠈' [320]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⠀⠀⠀⠘' [321]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⠀⠀⠀⠸' [322]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⠀⠀⠀⢸' [323]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⠀⠀⠀⣸' [324]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⠀⠀⢀⣸' [325]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⠀⠀⣀⣸' [326]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⠀⢀⣀⣸' [327]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⠀⣀⣀⣸' [328]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⢀⣀⣀⣸' [329]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⣀⣀⣀⣸' [330]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣄⣀⣀⣸' [331]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣆⣀⣀⣰' [332]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣇⣀⣀⣠' [333]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⣇⣀⣀⣀' [334]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⣇⣀⣀⡀' [335]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⣇⣀⣀⠀' [336]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⣇⣀⡀⠀' [337]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⣇⣀⠀⠀' [338]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⣇⡀⠀⠀' [339]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⣇⠀⠀⠀' [340]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⡇⠀⠀⠀' [341]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⠇⠀⠀⠀' [342]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⠃⠀⠀⠀' [343]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⠁⠀⠀⠀' [344]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⠀⠀⠀⠀' [345]=$'\E[A⠏⠉⠉⠹\E[B\E[4D⠀⠀⠀⠀' [346]=$'\E[A⠋⠉⠉⢹\E[B\E[4D⠀⠀⠀⠀' [347]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⠀⠀⠈' [348]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⠀⠀⠘' [349]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⠀⠀⠀⠸' [350]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⠀⠀⠀⢸' [351]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⠀⠀⠀⣸' [352]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⠀⠀⢀⣸' [353]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⠀⠀⣀⣸' [354]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⠀⢀⣀⣸' [355]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⠀⣀⣀⣸' [356]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⢀⣀⣀⣸' [357]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⣀⣀⣀⣸' [358]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⣄⣀⣀⣸' [359]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣆⣀⣀⣸' [360]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣇⣀⣀⣰' [361]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⣇⣀⣀⣠' [362]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⣇⣀⣀⣀' [363]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⣇⣀⣀⡀' [364]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⣇⣀⣀⠀' [365]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⣇⣀⡀⠀' [366]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⣇⣀⠀⠀' [367]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⣇⡀⠀⠀' [368]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⣇⠀⠀⠀' [369]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⡇⠀⠀⠀' [370]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⠇⠀⠀⠀' [371]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⠃⠀⠀⠀' [372]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⠁⠀⠀⠀' [373]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⠀⠀⠀⠀' [374]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⠀⠀⠀⠀' [375]=$'\E[A⠋⠉⠉⢹\E[B\E[4D⠀⠀⠀⠈' [376]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⠀⠀⠘' [377]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⠀⠀⠸' [378]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⠀⠀⠀⢸' [379]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⠀⠀⠀⣸' [380]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⠀⠀⢀⣸' [381]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⠀⠀⣀⣸' [382]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⠀⢀⣀⣸' [383]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⠀⣀⣀⣸' [384]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⢀⣀⣀⣸' [385]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⣀⣀⣀⣸' [386]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⣄⣀⣀⣸' [387]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⣆⣀⣀⣸' [388]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣇⣀⣀⣸' [389]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⣇⣀⣀⣰' [390]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⣇⣀⣀⣠' [391]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⣇⣀⣀⣀' [392]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⣇⣀⣀⡀' [393]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⣇⣀⣀⠀' [394]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⣇⣀⡀⠀' [395]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⣇⣀⠀⠀' [396]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⣇⡀⠀⠀' [397]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⣇⠀⠀⠀' [398]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⡇⠀⠀⠀' [399]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⠇⠀⠀⠀' [400]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⠃⠀⠀⠀' [401]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⠁⠀⠀⠀' [402]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠀⠀⠀⠀' [403]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⠀⠀⠀⠈' [404]=$'\E[A⠋⠉⠉⢹\E[B\E[4D⠀⠀⠀⠘' [405]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⠀⠀⠸' [406]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⠀⠀⢸' [407]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⠀⠀⠀⣸' [408]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⠀⠀⢀⣸' [409]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⠀⠀⣀⣸' [410]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⠀⢀⣀⣸' [411]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⠀⣀⣀⣸' [412]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⢀⣀⣀⣸' [413]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⣀⣀⣀⣸' [414]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⣄⣀⣀⣸' [415]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⣆⣀⣀⣸' [416]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⣇⣀⣀⣸' [417]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⣇⣀⣀⣸' [418]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⣇⣀⣀⣰' [419]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⣇⣀⣀⣠' [420]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⣇⣀⣀⣀' [421]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⣇⣀⣀⡀' [422]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⣇⣀⣀⠀' [423]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⣇⣀⡀⠀' [424]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⣇⣀⠀⠀' [425]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⣇⡀⠀⠀' [426]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⣇⠀⠀⠀' [427]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⡇⠀⠀⠀' [428]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⠇⠀⠀⠀' [429]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⠃⠀⠀⠀' [430]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠁⠀⠀⠀' [431]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠀⠀⠀⠈' [432]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⠀⠀⠀⠘' [433]=$'\E[A⠋⠉⠉⢹\E[B\E[4D⠀⠀⠀⠸' [434]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⠀⠀⢸' [435]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⠀⠀⣸' [436]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⠀⠀⢀⣸' [437]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⠀⠀⣀⣸' [438]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⠀⢀⣀⣸' [439]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⠀⣀⣀⣸' [440]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⢀⣀⣀⣸' [441]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⣀⣀⣀⣸' [442]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⣄⣀⣀⣸' [443]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⣆⣀⣀⣸' [444]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⣇⣀⣀⣸' [445]=$'\E[A⡀⠀⠀⢀\E[B\E[4D⣇⣀⣀⣸' [446]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⣇⣀⣀⣸' [447]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⣇⣀⣀⣰' [448]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⣇⣀⣀⣠' [449]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⣇⣀⣀⣀' [450]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⣇⣀⣀⡀' [451]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⣇⣀⣀⠀' [452]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⣇⣀⡀⠀' [453]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⣇⣀⠀⠀' [454]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⣇⡀⠀⠀' [455]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⣇⠀⠀⠀' [456]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⡇⠀⠀⠀' [457]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⠇⠀⠀⠀' [458]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠃⠀⠀⠀' [459]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠁⠀⠀⠈' [460]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠀⠀⠀⠘' [461]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⠀⠀⠀⠸' [462]=$'\E[A⠋⠉⠉⢹\E[B\E[4D⠀⠀⠀⢸' [463]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⠀⠀⣸' [464]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⠀⢀⣸' [465]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⠀⠀⣀⣸' [466]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⠀⢀⣀⣸' [467]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⠀⣀⣀⣸' [468]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⢀⣀⣀⣸' [469]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⣀⣀⣀⣸' [470]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⣄⣀⣀⣸' [471]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⣆⣀⣀⣸' [472]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⣇⣀⣀⣸' [473]=$'\E[A⡀⠀⠀⢠\E[B\E[4D⣇⣀⣀⣸' [474]=$'\E[A⡄⠀⠀⢀\E[B\E[4D⣇⣀⣀⣸' [475]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⣇⣀⣀⣸' [476]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⣇⣀⣀⣰' [477]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⣇⣀⣀⣠' [478]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⣇⣀⣀⣀' [479]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⣇⣀⣀⡀' [480]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⣇⣀⣀⠀' [481]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⣇⣀⡀⠀' [482]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⣇⣀⠀⠀' [483]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⣇⡀⠀⠀' [484]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⣇⠀⠀⠀' [485]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⡇⠀⠀⠀' [486]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠇⠀⠀⠀' [487]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠃⠀⠀⠈' [488]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠁⠀⠀⠘' [489]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠀⠀⠀⠸' [490]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⠀⠀⠀⢸' [491]=$'\E[A⠋⠉⠉⢹\E[B\E[4D⠀⠀⠀⣸' [492]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⠀⢀⣸' [493]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⠀⣀⣸' [494]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⠀⢀⣀⣸' [495]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⠀⣀⣀⣸' [496]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⢀⣀⣀⣸' [497]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⣀⣀⣀⣸' [498]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⣄⣀⣀⣸' [499]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⣆⣀⣀⣸' [500]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⣇⣀⣀⣸' [501]=$'\E[A⡀⠀⠀⢰\E[B\E[4D⣇⣀⣀⣸' [502]=$'\E[A⡄⠀⠀⢠\E[B\E[4D⣇⣀⣀⣸' [503]=$'\E[A⡆⠀⠀⢀\E[B\E[4D⣇⣀⣀⣸' [504]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⣇⣀⣀⣸' [505]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⣇⣀⣀⣰' [506]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⣇⣀⣀⣠' [507]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⣇⣀⣀⣀' [508]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⣇⣀⣀⡀' [509]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⣇⣀⣀⠀' [510]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⣇⣀⡀⠀' [511]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⣇⣀⠀⠀' [512]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⣇⡀⠀⠀' [513]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⣇⠀⠀⠀' [514]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⡇⠀⠀⠀' [515]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠇⠀⠀⠈' [516]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠃⠀⠀⠘' [517]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠁⠀⠀⠸' [518]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠀⠀⠀⢸' [519]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⠀⠀⠀⣸' [520]=$'\E[A⠋⠉⠉⢹\E[B\E[4D⠀⠀⢀⣸' [521]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⠀⣀⣸' [522]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⢀⣀⣸' [523]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⠀⣀⣀⣸' [524]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⢀⣀⣀⣸' [525]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⣀⣀⣀⣸' [526]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⣄⣀⣀⣸' [527]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⣆⣀⣀⣸' [528]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⣇⣀⣀⣸' [529]=$'\E[A⡀⠀⠀⢸\E[B\E[4D⣇⣀⣀⣸' [530]=$'\E[A⡄⠀⠀⢰\E[B\E[4D⣇⣀⣀⣸' [531]=$'\E[A⡆⠀⠀⢠\E[B\E[4D⣇⣀⣀⣸' [532]=$'\E[A⡇⠀⠀⢀\E[B\E[4D⣇⣀⣀⣸' [533]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⣇⣀⣀⣸' [534]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⣇⣀⣀⣰' [535]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⣇⣀⣀⣠' [536]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⣇⣀⣀⣀' [537]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⣇⣀⣀⡀' [538]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⣇⣀⣀⠀' [539]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⣇⣀⡀⠀' [540]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⣇⣀⠀⠀' [541]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⣇⡀⠀⠀' [542]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⠀⠀⠀' [543]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⡇⠀⠀⠈' [544]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠇⠀⠀⠘' [545]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠃⠀⠀⠸' [546]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠁⠀⠀⢸' [547]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠀⠀⠀⣸' [548]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⠀⠀⢀⣸' [549]=$'\E[A⠋⠉⠉⢹\E[B\E[4D⠀⠀⣀⣸' [550]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⢀⣀⣸' [551]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⣀⣀⣸' [552]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⢀⣀⣀⣸' [553]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⣀⣀⣀⣸' [554]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⣄⣀⣀⣸' [555]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⣆⣀⣀⣸' [556]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⣇⣀⣀⣸' [557]=$'\E[A⡀⠀⠀⢹\E[B\E[4D⣇⣀⣀⣸' [558]=$'\E[A⡄⠀⠀⢸\E[B\E[4D⣇⣀⣀⣸' [559]=$'\E[A⡆⠀⠀⢰\E[B\E[4D⣇⣀⣀⣸' [560]=$'\E[A⡇⠀⠀⢠\E[B\E[4D⣇⣀⣀⣸' [561]=$'\E[A⡏⠀⠀⢀\E[B\E[4D⣇⣀⣀⣸' [562]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⣇⣀⣀⣸' [563]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⣇⣀⣀⣰' [564]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⣇⣀⣀⣠' [565]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⣇⣀⣀⣀' [566]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⣇⣀⣀⡀' [567]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⣇⣀⣀⠀' [568]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⣇⣀⡀⠀' [569]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⣇⣀⠀⠀' [570]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⡀⠀⠀' [571]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⠀⠀⠈' [572]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⡇⠀⠀⠘' [573]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠇⠀⠀⠸' [574]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠃⠀⠀⢸' [575]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠁⠀⠀⣸' [576]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠀⠀⢀⣸' [577]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⠀⠀⣀⣸' [578]=$'\E[A⠋⠉⠉⢹\E[B\E[4D⠀⢀⣀⣸' [579]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⣀⣀⣸' [580]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⢀⣀⣀⣸' [581]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⣀⣀⣀⣸' [582]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⣄⣀⣀⣸' [583]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⣆⣀⣀⣸' [584]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⣇⣀⣀⣸' [585]=$'\E[A⡀⠀⠈⢹\E[B\E[4D⣇⣀⣀⣸' [586]=$'\E[A⡄⠀⠀⢹\E[B\E[4D⣇⣀⣀⣸' [587]=$'\E[A⡆⠀⠀⢸\E[B\E[4D⣇⣀⣀⣸' [588]=$'\E[A⡇⠀⠀⢰\E[B\E[4D⣇⣀⣀⣸' [589]=$'\E[A⡏⠀⠀⢠\E[B\E[4D⣇⣀⣀⣸' [590]=$'\E[A⡏⠁⠀⢀\E[B\E[4D⣇⣀⣀⣸' [591]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⣇⣀⣀⣸' [592]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⣇⣀⣀⣰' [593]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⣇⣀⣀⣠' [594]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⣇⣀⣀⣀' [595]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⣇⣀⣀⡀' [596]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⣇⣀⣀⠀' [597]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⣇⣀⡀⠀' [598]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⠀⠀' [599]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⡀⠀⠈' [600]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⠀⠀⠘' [601]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⡇⠀⠀⠸' [602]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠇⠀⠀⢸' [603]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠃⠀⠀⣸' [604]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠁⠀⢀⣸' [605]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠀⠀⣀⣸' [606]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⠀⢀⣀⣸' [607]=$'\E[A⠋⠉⠉⢹\E[B\E[4D⠀⣀⣀⣸' [608]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⢀⣀⣀⣸' [609]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⣀⣀⣀⣸' [610]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⣄⣀⣀⣸' [611]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⣆⣀⣀⣸' [612]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⣇⣀⣀⣸' [613]=$'\E[A⡀⠀⠉⢹\E[B\E[4D⣇⣀⣀⣸' [614]=$'\E[A⡄⠀⠈⢹\E[B\E[4D⣇⣀⣀⣸' [615]=$'\E[A⡆⠀⠀⢹\E[B\E[4D⣇⣀⣀⣸' [616]=$'\E[A⡇⠀⠀⢸\E[B\E[4D⣇⣀⣀⣸' [617]=$'\E[A⡏⠀⠀⢰\E[B\E[4D⣇⣀⣀⣸' [618]=$'\E[A⡏⠁⠀⢠\E[B\E[4D⣇⣀⣀⣸' [619]=$'\E[A⡏⠉⠀⢀\E[B\E[4D⣇⣀⣀⣸' [620]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⣇⣀⣀⣸' [621]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⣇⣀⣀⣰' [622]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⣇⣀⣀⣠' [623]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⣇⣀⣀⣀' [624]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⣇⣀⣀⡀' [625]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⣇⣀⣀⠀' [626]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⡀⠀' [627]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⠀⠈' [628]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⡀⠀⠘' [629]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⠀⠀⠸' [630]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⡇⠀⠀⢸' [631]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠇⠀⠀⣸' [632]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠃⠀⢀⣸' [633]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠁⠀⣀⣸' [634]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠀⢀⣀⣸' [635]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⠀⣀⣀⣸' [636]=$'\E[A⠋⠉⠉⢹\E[B\E[4D⢀⣀⣀⣸' [637]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⣀⣀⣀⣸' [638]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⣄⣀⣀⣸' [639]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⣆⣀⣀⣸' [640]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⣇⣀⣀⣸' [641]=$'\E[A⡀⠈⠉⢹\E[B\E[4D⣇⣀⣀⣸' [642]=$'\E[A⡄⠀⠉⢹\E[B\E[4D⣇⣀⣀⣸' [643]=$'\E[A⡆⠀⠈⢹\E[B\E[4D⣇⣀⣀⣸' [644]=$'\E[A⡇⠀⠀⢹\E[B\E[4D⣇⣀⣀⣸' [645]=$'\E[A⡏⠀⠀⢸\E[B\E[4D⣇⣀⣀⣸' [646]=$'\E[A⡏⠁⠀⢰\E[B\E[4D⣇⣀⣀⣸' [647]=$'\E[A⡏⠉⠀⢠\E[B\E[4D⣇⣀⣀⣸' [648]=$'\E[A⡏⠉⠁⢀\E[B\E[4D⣇⣀⣀⣸' [649]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⣇⣀⣀⣸' [650]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⣇⣀⣀⣰' [651]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⣇⣀⣀⣠' [652]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⣇⣀⣀⣀' [653]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⣇⣀⣀⡀' [654]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⣀⠀' [655]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⡀⠈' [656]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⠀⠘' [657]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⡀⠀⠸' [658]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⠀⠀⢸' [659]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⡇⠀⠀⣸' [660]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠇⠀⢀⣸' [661]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠃⠀⣀⣸' [662]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠁⢀⣀⣸' [663]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠀⣀⣀⣸' [664]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⢀⣀⣀⣸' [665]=$'\E[A⠋⠉⠉⢹\E[B\E[4D⣀⣀⣀⣸' [666]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⣄⣀⣀⣸' [667]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⣆⣀⣀⣸' [668]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⣇⣀⣀⣸' [669]=$'\E[A⡀⠉⠉⢹\E[B\E[4D⣇⣀⣀⣸' [670]=$'\E[A⡄⠈⠉⢹\E[B\E[4D⣇⣀⣀⣸' [671]=$'\E[A⡆⠀⠉⢹\E[B\E[4D⣇⣀⣀⣸' [672]=$'\E[A⡇⠀⠈⢹\E[B\E[4D⣇⣀⣀⣸' [673]=$'\E[A⡏⠀⠀⢹\E[B\E[4D⣇⣀⣀⣸' [674]=$'\E[A⡏⠁⠀⢸\E[B\E[4D⣇⣀⣀⣸' [675]=$'\E[A⡏⠉⠀⢰\E[B\E[4D⣇⣀⣀⣸' [676]=$'\E[A⡏⠉⠁⢠\E[B\E[4D⣇⣀⣀⣸' [677]=$'\E[A⡏⠉⠉⢀\E[B\E[4D⣇⣀⣀⣸' [678]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⣇⣀⣀⣸' [679]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⣇⣀⣀⣰' [680]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⣇⣀⣀⣠' [681]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⣇⣀⣀⣀' [682]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⣀⡀' [683]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⣀⠈' [684]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⡀⠘' [685]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⠀⠸' [686]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⡀⠀⢸' [687]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⠀⠀⣸' [688]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⡇⠀⢀⣸' [689]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠇⠀⣀⣸' [690]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠃⢀⣀⣸' [691]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠁⣀⣀⣸' [692]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⢀⣀⣀⣸' [693]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⣀⣀⣀⣸' [694]=$'\E[A⠋⠉⠉⢹\E[B\E[4D⣄⣀⣀⣸' [695]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⣆⣀⣀⣸' [696]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⣇⣀⣀⣸' [697]=$'\E[A⡈⠉⠉⢹\E[B\E[4D⣇⣀⣀⣸' [698]=$'\E[A⡄⠉⠉⢹\E[B\E[4D⣇⣀⣀⣸' [699]=$'\E[A⡆⠈⠉⢹\E[B\E[4D⣇⣀⣀⣸' [700]=$'\E[A⡇⠀⠉⢹\E[B\E[4D⣇⣀⣀⣸' [701]=$'\E[A⡏⠀⠈⢹\E[B\E[4D⣇⣀⣀⣸' [702]=$'\E[A⡏⠁⠀⢹\E[B\E[4D⣇⣀⣀⣸' [703]=$'\E[A⡏⠉⠀⢸\E[B\E[4D⣇⣀⣀⣸' [704]=$'\E[A⡏⠉⠁⢰\E[B\E[4D⣇⣀⣀⣸' [705]=$'\E[A⡏⠉⠉⢠\E[B\E[4D⣇⣀⣀⣸' [706]=$'\E[A⡏⠉⠉⢁\E[B\E[4D⣇⣀⣀⣸' [707]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⣇⣀⣀⣸' [708]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⣇⣀⣀⣰' [709]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⣇⣀⣀⣠' [710]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⣀⣀' [711]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⣀⡈' [712]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⣀⠘' [713]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⡀⠸' [714]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⠀⢸' [715]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⡀⠀⣸' [716]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⠀⢀⣸' [717]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⡇⠀⣀⣸' [718]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠇⢀⣀⣸' [719]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠃⣀⣀⣸' [720]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⢁⣀⣀⣸' [721]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣀⣀⣀⣸' [722]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⣄⣀⣀⣸' [723]=$'\E[A⠋⠉⠉⢹\E[B\E[4D⣆⣀⣀⣸' [724]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⣇⣀⣀⣸' [725]=$'\E[A⡉⠉⠉⢹\E[B\E[4D⣇⣀⣀⣸' [726]=$'\E[A⡌⠉⠉⢹\E[B\E[4D⣇⣀⣀⣸' [727]=$'\E[A⡆⠉⠉⢹\E[B\E[4D⣇⣀⣀⣸' [728]=$'\E[A⡇⠈⠉⢹\E[B\E[4D⣇⣀⣀⣸' [729]=$'\E[A⡏⠀⠉⢹\E[B\E[4D⣇⣀⣀⣸' [730]=$'\E[A⡏⠁⠈⢹\E[B\E[4D⣇⣀⣀⣸' [731]=$'\E[A⡏⠉⠀⢹\E[B\E[4D⣇⣀⣀⣸' [732]=$'\E[A⡏⠉⠁⢸\E[B\E[4D⣇⣀⣀⣸' [733]=$'\E[A⡏⠉⠉⢰\E[B\E[4D⣇⣀⣀⣸' [734]=$'\E[A⡏⠉⠉⢡\E[B\E[4D⣇⣀⣀⣸' [735]=$'\E[A⡏⠉⠉⢉\E[B\E[4D⣇⣀⣀⣸' [736]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⣇⣀⣀⣸' [737]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⣇⣀⣀⣰' [738]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⣀⣠' [739]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⣀⣈' [740]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⣀⡘' [741]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⣀⠸' [742]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⡀⢸' [743]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⠀⣸' [744]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⡀⢀⣸' [745]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⠀⣀⣸' [746]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⡇⢀⣀⣸' [747]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠇⣀⣀⣸' [748]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⢃⣀⣀⣸' [749]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣁⣀⣀⣸' [750]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣄⣀⣀⣸' [751]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⣆⣀⣀⣸' [752]=$'\E[A⠋⠉⠉⢹\E[B\E[4D⣇⣀⣀⣸' [753]=$'\E[A⡉⠉⠉⢹\E[B\E[4D⣇⣀⣀⣸' [754]=$'\E[A⡍⠉⠉⢹\E[B\E[4D⣇⣀⣀⣸' [755]=$'\E[A⡎⠉⠉⢹\E[B\E[4D⣇⣀⣀⣸' [756]=$'\E[A⡇⠉⠉⢹\E[B\E[4D⣇⣀⣀⣸' [757]=$'\E[A⡏⠈⠉⢹\E[B\E[4D⣇⣀⣀⣸' [758]=$'\E[A⡏⠁⠉⢹\E[B\E[4D⣇⣀⣀⣸' [759]=$'\E[A⡏⠉⠈⢹\E[B\E[4D⣇⣀⣀⣸' [760]=$'\E[A⡏⠉⠁⢹\E[B\E[4D⣇⣀⣀⣸' [761]=$'\E[A⡏⠉⠉⢸\E[B\E[4D⣇⣀⣀⣸' [762]=$'\E[A⡏⠉⠉⢱\E[B\E[4D⣇⣀⣀⣸' [763]=$'\E[A⡏⠉⠉⢩\E[B\E[4D⣇⣀⣀⣸' [764]=$'\E[A⡏⠉⠉⢙\E[B\E[4D⣇⣀⣀⣸' [765]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⣇⣀⣀⣸' [766]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⣀⣰' [767]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⣀⣨' [768]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⣀⣘' [769]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⣀⡸' [770]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⣀⢸' [771]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⡀⣸' [772]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⢀⣸' [773]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⡀⣀⣸' [774]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⢀⣀⣸' [775]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⡇⣀⣀⣸' [776]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⢇⣀⣀⣸' [777]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣃⣀⣀⣸' [778]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣅⣀⣀⣸' [779]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣆⣀⣀⣸' [780]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⣇⣀⣀⣸' [781]=$'\E[A⡉⠉⠉⢹\E[B\E[4D⣇⣀⣀⣸' [782]=$'\E[A⡌⠉⠉⢹\E[B\E[4D⣇⣀⣀⣸' [783]=$'\E[A⡆⠉⠉⢹\E[B\E[4D⣇⣀⣀⣸' [784]=$'\E[A⡇⠈⠉⢹\E[B\E[4D⣇⣀⣀⣸' [785]=$'\E[A⡏⠀⠉⢹\E[B\E[4D⣇⣀⣀⣸' [786]=$'\E[A⡏⠁⠈⢹\E[B\E[4D⣇⣀⣀⣸' [787]=$'\E[A⡏⠉⠀⢹\E[B\E[4D⣇⣀⣀⣸' [788]=$'\E[A⡏⠉⠁⢸\E[B\E[4D⣇⣀⣀⣸' [789]=$'\E[A⡏⠉⠉⢰\E[B\E[4D⣇⣀⣀⣸' [790]=$'\E[A⡏⠉⠉⢡\E[B\E[4D⣇⣀⣀⣸' [791]=$'\E[A⡏⠉⠉⢉\E[B\E[4D⣇⣀⣀⣸' [792]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⣇⣀⣀⣸' [793]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⣇⣀⣀⣰' [794]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⣀⣠' [795]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⣀⣈' [796]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⣀⡘' [797]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⣀⠸' [798]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⡀⢸' [799]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⠀⣸' [800]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⡀⢀⣸' [801]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⠀⣀⣸' [802]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⡇⢀⣀⣸' [803]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠇⣀⣀⣸' [804]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⢃⣀⣀⣸' [805]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣁⣀⣀⣸' [806]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣄⣀⣀⣸' [807]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⣆⣀⣀⣸' [808]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⣇⣀⣀⣸' [809]=$'\E[A⡈⠉⠉⢹\E[B\E[4D⣇⣀⣀⣸' [810]=$'\E[A⡄⠉⠉⢹\E[B\E[4D⣇⣀⣀⣸' [811]=$'\E[A⡆⠈⠉⢹\E[B\E[4D⣇⣀⣀⣸' [812]=$'\E[A⡇⠀⠉⢹\E[B\E[4D⣇⣀⣀⣸' [813]=$'\E[A⡏⠀⠈⢹\E[B\E[4D⣇⣀⣀⣸' [814]=$'\E[A⡏⠁⠀⢹\E[B\E[4D⣇⣀⣀⣸' [815]=$'\E[A⡏⠉⠀⢸\E[B\E[4D⣇⣀⣀⣸' [816]=$'\E[A⡏⠉⠁⢰\E[B\E[4D⣇⣀⣀⣸' [817]=$'\E[A⡏⠉⠉⢠\E[B\E[4D⣇⣀⣀⣸' [818]=$'\E[A⡏⠉⠉⢁\E[B\E[4D⣇⣀⣀⣸' [819]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⣇⣀⣀⣸' [820]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⣇⣀⣀⣰' [821]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⣇⣀⣀⣠' [822]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⣀⣀' [823]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⣀⡈' [824]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⣀⠘' [825]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⡀⠸' [826]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⠀⢸' [827]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⡀⠀⣸' [828]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⠀⢀⣸' [829]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⡇⠀⣀⣸' [830]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠇⢀⣀⣸' [831]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠃⣀⣀⣸' [832]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⢁⣀⣀⣸' [833]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣀⣀⣀⣸' [834]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⣄⣀⣀⣸' [835]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⣆⣀⣀⣸' [836]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⣇⣀⣀⣸' [837]=$'\E[A⡀⠉⠉⢹\E[B\E[4D⣇⣀⣀⣸' [838]=$'\E[A⡄⠈⠉⢹\E[B\E[4D⣇⣀⣀⣸' [839]=$'\E[A⡆⠀⠉⢹\E[B\E[4D⣇⣀⣀⣸' [840]=$'\E[A⡇⠀⠈⢹\E[B\E[4D⣇⣀⣀⣸' [841]=$'\E[A⡏⠀⠀⢹\E[B\E[4D⣇⣀⣀⣸' [842]=$'\E[A⡏⠁⠀⢸\E[B\E[4D⣇⣀⣀⣸' [843]=$'\E[A⡏⠉⠀⢰\E[B\E[4D⣇⣀⣀⣸' [844]=$'\E[A⡏⠉⠁⢠\E[B\E[4D⣇⣀⣀⣸' [845]=$'\E[A⡏⠉⠉⢀\E[B\E[4D⣇⣀⣀⣸' [846]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⣇⣀⣀⣸' [847]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⣇⣀⣀⣰' [848]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⣇⣀⣀⣠' [849]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⣇⣀⣀⣀' [850]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⣀⡀' [851]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⣀⠈' [852]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⡀⠘' [853]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⠀⠸' [854]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⡀⠀⢸' [855]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⠀⠀⣸' [856]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⡇⠀⢀⣸' [857]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠇⠀⣀⣸' [858]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠃⢀⣀⣸' [859]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠁⣀⣀⣸' [860]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⢀⣀⣀⣸' [861]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⣀⣀⣀⣸' [862]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⣄⣀⣀⣸' [863]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⣆⣀⣀⣸' [864]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⣇⣀⣀⣸' [865]=$'\E[A⡀⠈⠉⢹\E[B\E[4D⣇⣀⣀⣸' [866]=$'\E[A⡄⠀⠉⢹\E[B\E[4D⣇⣀⣀⣸' [867]=$'\E[A⡆⠀⠈⢹\E[B\E[4D⣇⣀⣀⣸' [868]=$'\E[A⡇⠀⠀⢹\E[B\E[4D⣇⣀⣀⣸' [869]=$'\E[A⡏⠀⠀⢸\E[B\E[4D⣇⣀⣀⣸' [870]=$'\E[A⡏⠁⠀⢰\E[B\E[4D⣇⣀⣀⣸' [871]=$'\E[A⡏⠉⠀⢠\E[B\E[4D⣇⣀⣀⣸' [872]=$'\E[A⡏⠉⠁⢀\E[B\E[4D⣇⣀⣀⣸' [873]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⣇⣀⣀⣸' [874]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⣇⣀⣀⣰' [875]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⣇⣀⣀⣠' [876]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⣇⣀⣀⣀' [877]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⣇⣀⣀⡀' [878]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⣀⠀' [879]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⡀⠈' [880]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⠀⠘' [881]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⡀⠀⠸' [882]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⠀⠀⢸' [883]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⡇⠀⠀⣸' [884]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠇⠀⢀⣸' [885]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠃⠀⣀⣸' [886]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠁⢀⣀⣸' [887]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠀⣀⣀⣸' [888]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⢀⣀⣀⣸' [889]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⣀⣀⣀⣸' [890]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⣄⣀⣀⣸' [891]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⣆⣀⣀⣸' [892]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⣇⣀⣀⣸' [893]=$'\E[A⡀⠀⠉⢹\E[B\E[4D⣇⣀⣀⣸' [894]=$'\E[A⡄⠀⠈⢹\E[B\E[4D⣇⣀⣀⣸' [895]=$'\E[A⡆⠀⠀⢹\E[B\E[4D⣇⣀⣀⣸' [896]=$'\E[A⡇⠀⠀⢸\E[B\E[4D⣇⣀⣀⣸' [897]=$'\E[A⡏⠀⠀⢰\E[B\E[4D⣇⣀⣀⣸' [898]=$'\E[A⡏⠁⠀⢠\E[B\E[4D⣇⣀⣀⣸' [899]=$'\E[A⡏⠉⠀⢀\E[B\E[4D⣇⣀⣀⣸' [900]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⣇⣀⣀⣸' [901]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⣇⣀⣀⣰' [902]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⣇⣀⣀⣠' [903]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⣇⣀⣀⣀' [904]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⣇⣀⣀⡀' [905]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⣇⣀⣀⠀' [906]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⡀⠀' [907]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⠀⠈' [908]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⡀⠀⠘' [909]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⠀⠀⠸' [910]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⡇⠀⠀⢸' [911]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠇⠀⠀⣸' [912]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠃⠀⢀⣸' [913]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠁⠀⣀⣸' [914]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠀⢀⣀⣸' [915]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⠀⣀⣀⣸' [916]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⢀⣀⣀⣸' [917]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⣀⣀⣀⣸' [918]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⣄⣀⣀⣸' [919]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⣆⣀⣀⣸' [920]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⣇⣀⣀⣸' [921]=$'\E[A⡀⠀⠈⢹\E[B\E[4D⣇⣀⣀⣸' [922]=$'\E[A⡄⠀⠀⢹\E[B\E[4D⣇⣀⣀⣸' [923]=$'\E[A⡆⠀⠀⢸\E[B\E[4D⣇⣀⣀⣸' [924]=$'\E[A⡇⠀⠀⢰\E[B\E[4D⣇⣀⣀⣸' [925]=$'\E[A⡏⠀⠀⢠\E[B\E[4D⣇⣀⣀⣸' [926]=$'\E[A⡏⠁⠀⢀\E[B\E[4D⣇⣀⣀⣸' [927]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⣇⣀⣀⣸' [928]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⣇⣀⣀⣰' [929]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⣇⣀⣀⣠' [930]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⣇⣀⣀⣀' [931]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⣇⣀⣀⡀' [932]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⣇⣀⣀⠀' [933]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⣇⣀⡀⠀' [934]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⣀⠀⠀' [935]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⡀⠀⠈' [936]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⠀⠀⠘' [937]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⡇⠀⠀⠸' [938]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠇⠀⠀⢸' [939]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠃⠀⠀⣸' [940]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠁⠀⢀⣸' [941]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠀⠀⣀⣸' [942]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⠀⢀⣀⣸' [943]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⣀⣀⣸' [944]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⢀⣀⣀⣸' [945]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⣀⣀⣀⣸' [946]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⣄⣀⣀⣸' [947]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⣆⣀⣀⣸' [948]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⣇⣀⣀⣸' [949]=$'\E[A⡀⠀⠀⢹\E[B\E[4D⣇⣀⣀⣸' [950]=$'\E[A⡄⠀⠀⢸\E[B\E[4D⣇⣀⣀⣸' [951]=$'\E[A⡆⠀⠀⢰\E[B\E[4D⣇⣀⣀⣸' [952]=$'\E[A⡇⠀⠀⢠\E[B\E[4D⣇⣀⣀⣸' [953]=$'\E[A⡏⠀⠀⢀\E[B\E[4D⣇⣀⣀⣸' [954]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⣇⣀⣀⣸' [955]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⣇⣀⣀⣰' [956]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⣇⣀⣀⣠' [957]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⣇⣀⣀⣀' [958]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⣇⣀⣀⡀' [959]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⣇⣀⣀⠀' [960]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⣇⣀⡀⠀' [961]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⣇⣀⠀⠀' [962]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⡀⠀⠀' [963]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⠀⠀⠈' [964]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⡇⠀⠀⠘' [965]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠇⠀⠀⠸' [966]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠃⠀⠀⢸' [967]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠁⠀⠀⣸' [968]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠀⠀⢀⣸' [969]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⠀⠀⣀⣸' [970]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⢀⣀⣸' [971]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⠀⣀⣀⣸' [972]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⢀⣀⣀⣸' [973]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⣀⣀⣀⣸' [974]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⣄⣀⣀⣸' [975]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⣆⣀⣀⣸' [976]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⣇⣀⣀⣸' [977]=$'\E[A⡀⠀⠀⢸\E[B\E[4D⣇⣀⣀⣸' [978]=$'\E[A⡄⠀⠀⢰\E[B\E[4D⣇⣀⣀⣸' [979]=$'\E[A⡆⠀⠀⢠\E[B\E[4D⣇⣀⣀⣸' [980]=$'\E[A⡇⠀⠀⢀\E[B\E[4D⣇⣀⣀⣸' [981]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⣇⣀⣀⣸' [982]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⣇⣀⣀⣰' [983]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⣇⣀⣀⣠' [984]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⣇⣀⣀⣀' [985]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⣇⣀⣀⡀' [986]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⣇⣀⣀⠀' [987]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⣇⣀⡀⠀' [988]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⣇⣀⠀⠀' [989]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⣇⡀⠀⠀' [990]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⣇⠀⠀⠀' [991]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⡇⠀⠀⠈' [992]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠇⠀⠀⠘' [993]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠃⠀⠀⠸' [994]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠁⠀⠀⢸' [995]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠀⠀⠀⣸' [996]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⠀⠀⢀⣸' [997]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⠀⣀⣸' [998]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⠀⢀⣀⣸' [999]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⠀⣀⣀⣸' [1000]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⢀⣀⣀⣸' [1001]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⣀⣀⣀⣸' [1002]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⣄⣀⣀⣸' [1003]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⣆⣀⣀⣸' [1004]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⣇⣀⣀⣸' [1005]=$'\E[A⡀⠀⠀⢰\E[B\E[4D⣇⣀⣀⣸' [1006]=$'\E[A⡄⠀⠀⢠\E[B\E[4D⣇⣀⣀⣸' [1007]=$'\E[A⡆⠀⠀⢀\E[B\E[4D⣇⣀⣀⣸' [1008]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⣇⣀⣀⣸' [1009]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⣇⣀⣀⣰' [1010]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⣇⣀⣀⣠' [1011]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⣇⣀⣀⣀' [1012]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⣇⣀⣀⡀' [1013]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⣇⣀⣀⠀' [1014]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⣇⣀⡀⠀' [1015]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⣇⣀⠀⠀' [1016]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⣇⡀⠀⠀' [1017]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⣇⠀⠀⠀' [1018]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⡇⠀⠀⠀' [1019]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠇⠀⠀⠈' [1020]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠃⠀⠀⠘' [1021]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠁⠀⠀⠸' [1022]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠀⠀⠀⢸' [1023]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⠀⠀⠀⣸' [1024]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⠀⢀⣸' [1025]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⠀⠀⣀⣸' [1026]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⠀⢀⣀⣸' [1027]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⠀⣀⣀⣸' [1028]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⢀⣀⣀⣸' [1029]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⣀⣀⣀⣸' [1030]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⣄⣀⣀⣸' [1031]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⣆⣀⣀⣸' [1032]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⣇⣀⣀⣸' [1033]=$'\E[A⡀⠀⠀⢠\E[B\E[4D⣇⣀⣀⣸' [1034]=$'\E[A⡄⠀⠀⢀\E[B\E[4D⣇⣀⣀⣸' [1035]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⣇⣀⣀⣸' [1036]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⣇⣀⣀⣰' [1037]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⣇⣀⣀⣠' [1038]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⣇⣀⣀⣀' [1039]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⣇⣀⣀⡀' [1040]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⣇⣀⣀⠀' [1041]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⣇⣀⡀⠀' [1042]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⣇⣀⠀⠀' [1043]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⣇⡀⠀⠀' [1044]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⣇⠀⠀⠀' [1045]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⡇⠀⠀⠀' [1046]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠇⠀⠀⠀' [1047]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠃⠀⠀⠈' [1048]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠁⠀⠀⠘' [1049]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠀⠀⠀⠸' [1050]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⠀⠀⠀⢸' [1051]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⠀⠀⣸' [1052]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⠀⠀⢀⣸' [1053]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⠀⠀⣀⣸' [1054]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⠀⢀⣀⣸' [1055]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⠀⣀⣀⣸' [1056]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⢀⣀⣀⣸' [1057]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⣀⣀⣀⣸' [1058]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⣄⣀⣀⣸' [1059]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⣆⣀⣀⣸' [1060]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⣇⣀⣀⣸' [1061]=$'\E[A⡀⠀⠀⢀\E[B\E[4D⣇⣀⣀⣸' [1062]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⣇⣀⣀⣸' [1063]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⣇⣀⣀⣰' [1064]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⣇⣀⣀⣠' [1065]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⣇⣀⣀⣀' [1066]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⣇⣀⣀⡀' [1067]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⣇⣀⣀⠀' [1068]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⣇⣀⡀⠀' [1069]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⣇⣀⠀⠀' [1070]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⣇⡀⠀⠀' [1071]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⣇⠀⠀⠀' [1072]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⡇⠀⠀⠀' [1073]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⠇⠀⠀⠀' [1074]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠃⠀⠀⠀' [1075]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠁⠀⠀⠈' [1076]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠀⠀⠀⠘' [1077]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⠀⠀⠀⠸' [1078]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⠀⠀⢸' [1079]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⠀⠀⠀⣸' [1080]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⠀⠀⢀⣸' [1081]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⠀⠀⣀⣸' [1082]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⠀⢀⣀⣸' [1083]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⠀⣀⣀⣸' [1084]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⢀⣀⣀⣸' [1085]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⣀⣀⣀⣸' [1086]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⣄⣀⣀⣸' [1087]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⣆⣀⣀⣸' [1088]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⣇⣀⣀⣸' [1089]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⣇⣀⣀⣸' [1090]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⣇⣀⣀⣰' [1091]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⣇⣀⣀⣠' [1092]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⣇⣀⣀⣀' [1093]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⣇⣀⣀⡀' [1094]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⣇⣀⣀⠀' [1095]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⣇⣀⡀⠀' [1096]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⣇⣀⠀⠀' [1097]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⣇⡀⠀⠀' [1098]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⣇⠀⠀⠀' [1099]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⡇⠀⠀⠀' [1100]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⠇⠀⠀⠀' [1101]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⠃⠀⠀⠀' [1102]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠁⠀⠀⠀' [1103]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠀⠀⠀⠈' [1104]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⠀⠀⠀⠘' [1105]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⠀⠀⠸' [1106]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⠀⠀⠀⢸' [1107]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⠀⠀⠀⣸' [1108]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⠀⠀⢀⣸' [1109]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⠀⠀⣀⣸' [1110]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⠀⢀⣀⣸' [1111]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⠀⣀⣀⣸' [1112]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⢀⣀⣀⣸' [1113]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⣀⣀⣀⣸' [1114]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⣄⣀⣀⣸' [1115]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⣆⣀⣀⣸' [1116]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣇⣀⣀⣸' [1117]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⣇⣀⣀⣰' [1118]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⣇⣀⣀⣠' [1119]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⣇⣀⣀⣀' [1120]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⣇⣀⣀⡀' [1121]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⣇⣀⣀⠀' [1122]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⣇⣀⡀⠀' [1123]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⣇⣀⠀⠀' [1124]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⣇⡀⠀⠀' [1125]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⣇⠀⠀⠀' [1126]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⡇⠀⠀⠀' [1127]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⠇⠀⠀⠀' [1128]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⠃⠀⠀⠀' [1129]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⠁⠀⠀⠀' [1130]=$'\E[A⡏⠉⠉⢹\E[B\E[4D⠀⠀⠀⠀' [1131]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⠀⠀⠀⠈' [1132]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⠀⠀⠘' [1133]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⠀⠀⠀⠸' [1134]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⠀⠀⠀⢸' [1135]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⠀⠀⠀⣸' [1136]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⠀⠀⢀⣸' [1137]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⠀⠀⣀⣸' [1138]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⠀⢀⣀⣸' [1139]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⠀⣀⣀⣸' [1140]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⢀⣀⣀⣸' [1141]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⣀⣀⣀⣸' [1142]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⣄⣀⣀⣸' [1143]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣆⣀⣀⣸' [1144]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣇⣀⣀⣰' [1145]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⣇⣀⣀⣠' [1146]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⣇⣀⣀⣀' [1147]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⣇⣀⣀⡀' [1148]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⣇⣀⣀⠀' [1149]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⣇⣀⡀⠀' [1150]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⣇⣀⠀⠀' [1151]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⣇⡀⠀⠀' [1152]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⣇⠀⠀⠀' [1153]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⡇⠀⠀⠀' [1154]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⠇⠀⠀⠀' [1155]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⠃⠀⠀⠀' [1156]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⠁⠀⠀⠀' [1157]=$'\E[A⡏⠉⠉⠹\E[B\E[4D⠀⠀⠀⠀' [1158]=$'\E[A⠏⠉⠉⢹\E[B\E[4D⠀⠀⠀⠀' [1159]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⠀⠀⠈' [1160]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⠀⠀⠀⠘' [1161]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⠀⠀⠀⠸' [1162]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⠀⠀⠀⢸' [1163]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⠀⠀⠀⣸' [1164]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⠀⠀⢀⣸' [1165]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⠀⠀⣀⣸' [1166]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⠀⢀⣀⣸' [1167]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⠀⣀⣀⣸' [1168]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⢀⣀⣀⣸' [1169]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⣀⣀⣀⣸' [1170]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣄⣀⣀⣸' [1171]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣆⣀⣀⣰' [1172]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣇⣀⣀⣠' [1173]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⣇⣀⣀⣀' [1174]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⣇⣀⣀⡀' [1175]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⣇⣀⣀⠀' [1176]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⣇⣀⡀⠀' [1177]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⣇⣀⠀⠀' [1178]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⣇⡀⠀⠀' [1179]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⣇⠀⠀⠀' [1180]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⡇⠀⠀⠀' [1181]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⠇⠀⠀⠀' [1182]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⠃⠀⠀⠀' [1183]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⠁⠀⠀⠀' [1184]=$'\E[A⡏⠉⠉⠙\E[B\E[4D⠀⠀⠀⠀' [1185]=$'\E[A⠏⠉⠉⠹\E[B\E[4D⠀⠀⠀⠀' [1186]=$'\E[A⠉⠉⠉⢹\E[B\E[4D⠀⠀⠀⠀' [1187]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⠀⠀⠀⠈' [1188]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⠀⠀⠀⠘' [1189]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⠀⠀⠀⠸' [1190]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⠀⠀⠀⢸' [1191]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⠀⠀⠀⣸' [1192]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⠀⠀⢀⣸' [1193]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⠀⠀⣀⣸' [1194]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⠀⢀⣀⣸' [1195]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⠀⣀⣀⣸' [1196]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⢀⣀⣀⣸' [1197]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣀⣀⣀⣸' [1198]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣄⣀⣀⣰' [1199]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣆⣀⣀⣠' [1200]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣇⣀⣀⣀' [1201]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⣇⣀⣀⡀' [1202]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⣇⣀⣀⠀' [1203]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⣇⣀⡀⠀' [1204]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⣇⣀⠀⠀' [1205]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⣇⡀⠀⠀' [1206]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⣇⠀⠀⠀' [1207]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⡇⠀⠀⠀' [1208]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⠇⠀⠀⠀' [1209]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⠃⠀⠀⠀' [1210]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⠁⠀⠀⠀' [1211]=$'\E[A⡏⠉⠉⠉\E[B\E[4D⠀⠀⠀⠀' [1212]=$'\E[A⠏⠉⠉⠙\E[B\E[4D⠀⠀⠀⠀' [1213]=$'\E[A⠉⠉⠉⠹\E[B\E[4D⠀⠀⠀⠀' [1214]=$'\E[A⠈⠉⠉⢹\E[B\E[4D⠀⠀⠀⠀' [1215]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⠀⠀⠀⠈' [1216]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⠀⠀⠀⠘' [1217]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⠀⠀⠀⠸' [1218]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⠀⠀⠀⢸' [1219]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⠀⠀⠀⣸' [1220]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⠀⠀⢀⣸' [1221]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⠀⠀⣀⣸' [1222]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⠀⢀⣀⣸' [1223]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⠀⣀⣀⣸' [1224]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⢀⣀⣀⣸' [1225]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣀⣀⣀⣰' [1226]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣄⣀⣀⣠' [1227]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣆⣀⣀⣀' [1228]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣇⣀⣀⡀' [1229]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⣇⣀⣀⠀' [1230]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⣇⣀⡀⠀' [1231]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⣇⣀⠀⠀' [1232]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⣇⡀⠀⠀' [1233]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⣇⠀⠀⠀' [1234]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⡇⠀⠀⠀' [1235]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⠇⠀⠀⠀' [1236]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⠃⠀⠀⠀' [1237]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⠁⠀⠀⠀' [1238]=$'\E[A⡏⠉⠉⠁\E[B\E[4D⠀⠀⠀⠀' [1239]=$'\E[A⠏⠉⠉⠉\E[B\E[4D⠀⠀⠀⠀' [1240]=$'\E[A⠉⠉⠉⠙\E[B\E[4D⠀⠀⠀⠀' [1241]=$'\E[A⠈⠉⠉⠹\E[B\E[4D⠀⠀⠀⠀' [1242]=$'\E[A⠀⠉⠉⢹\E[B\E[4D⠀⠀⠀⠀' [1243]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⠀⠀⠀⠈' [1244]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⠀⠀⠀⠘' [1245]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⠀⠀⠀⠸' [1246]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⠀⠀⠀⢸' [1247]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⠀⠀⠀⣸' [1248]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⠀⠀⢀⣸' [1249]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⠀⠀⣀⣸' [1250]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⠀⢀⣀⣸' [1251]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⣀⣀⣸' [1252]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⢀⣀⣀⣰' [1253]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣀⣀⣀⣠' [1254]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣄⣀⣀⣀' [1255]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣆⣀⣀⡀' [1256]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣇⣀⣀⠀' [1257]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⣇⣀⡀⠀' [1258]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⣇⣀⠀⠀' [1259]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⣇⡀⠀⠀' [1260]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⣇⠀⠀⠀' [1261]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⡇⠀⠀⠀' [1262]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⠇⠀⠀⠀' [1263]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⠃⠀⠀⠀' [1264]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⠁⠀⠀⠀' [1265]=$'\E[A⡏⠉⠉⠀\E[B\E[4D⠀⠀⠀⠀' [1266]=$'\E[A⠏⠉⠉⠁\E[B\E[4D⠀⠀⠀⠀' [1267]=$'\E[A⠉⠉⠉⠉\E[B\E[4D⠀⠀⠀⠀' [1268]=$'\E[A⠈⠉⠉⠙\E[B\E[4D⠀⠀⠀⠀' [1269]=$'\E[A⠀⠉⠉⠹\E[B\E[4D⠀⠀⠀⠀' [1270]=$'\E[A⠀⠈⠉⢹\E[B\E[4D⠀⠀⠀⠀' [1271]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⠀⠀⠀⠈' [1272]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⠀⠀⠀⠘' [1273]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⠀⠀⠀⠸' [1274]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⠀⠀⠀⢸' [1275]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⠀⠀⠀⣸' [1276]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⠀⠀⢀⣸' [1277]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⠀⠀⣀⣸' [1278]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⢀⣀⣸' [1279]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⣀⣀⣰' [1280]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⢀⣀⣀⣠' [1281]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣀⣀⣀⣀' [1282]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣄⣀⣀⡀' [1283]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣆⣀⣀⠀' [1284]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣇⣀⡀⠀' [1285]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⣇⣀⠀⠀' [1286]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⣇⡀⠀⠀' [1287]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⣇⠀⠀⠀' [1288]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⡇⠀⠀⠀' [1289]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⠇⠀⠀⠀' [1290]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⠃⠀⠀⠀' [1291]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⠁⠀⠀⠀' [1292]=$'\E[A⡏⠉⠁⠀\E[B\E[4D⠀⠀⠀⠀' [1293]=$'\E[A⠏⠉⠉⠀\E[B\E[4D⠀⠀⠀⠀' [1294]=$'\E[A⠉⠉⠉⠁\E[B\E[4D⠀⠀⠀⠀' [1295]=$'\E[A⠈⠉⠉⠉\E[B\E[4D⠀⠀⠀⠀' [1296]=$'\E[A⠀⠉⠉⠙\E[B\E[4D⠀⠀⠀⠀' [1297]=$'\E[A⠀⠈⠉⠹\E[B\E[4D⠀⠀⠀⠀' [1298]=$'\E[A⠀⠀⠉⢹\E[B\E[4D⠀⠀⠀⠀' [1299]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⠀⠀⠀⠈' [1300]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⠀⠀⠀⠘' [1301]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⠀⠀⠀⠸' [1302]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⠀⠀⠀⢸' [1303]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⠀⠀⠀⣸' [1304]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⠀⠀⢀⣸' [1305]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⣀⣸' [1306]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⢀⣀⣰' [1307]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⣀⣀⣠' [1308]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⢀⣀⣀⣀' [1309]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣀⣀⣀⡀' [1310]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣄⣀⣀⠀' [1311]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣆⣀⡀⠀' [1312]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣇⣀⠀⠀' [1313]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⣇⡀⠀⠀' [1314]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⣇⠀⠀⠀' [1315]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⡇⠀⠀⠀' [1316]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⠇⠀⠀⠀' [1317]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⠃⠀⠀⠀' [1318]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⠁⠀⠀⠀' [1319]=$'\E[A⡏⠉⠀⠀\E[B\E[4D⠀⠀⠀⠀' [1320]=$'\E[A⠏⠉⠁⠀\E[B\E[4D⠀⠀⠀⠀' [1321]=$'\E[A⠉⠉⠉⠀\E[B\E[4D⠀⠀⠀⠀' [1322]=$'\E[A⠈⠉⠉⠁\E[B\E[4D⠀⠀⠀⠀' [1323]=$'\E[A⠀⠉⠉⠉\E[B\E[4D⠀⠀⠀⠀' [1324]=$'\E[A⠀⠈⠉⠙\E[B\E[4D⠀⠀⠀⠀' [1325]=$'\E[A⠀⠀⠉⠹\E[B\E[4D⠀⠀⠀⠀' [1326]=$'\E[A⠀⠀⠈⢹\E[B\E[4D⠀⠀⠀⠀' [1327]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⠀⠀⠀⠈' [1328]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⠀⠀⠀⠘' [1329]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⠀⠀⠀⠸' [1330]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⠀⠀⠀⢸' [1331]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⠀⠀⠀⣸' [1332]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⢀⣸' [1333]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⣀⣰' [1334]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⢀⣀⣠' [1335]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⣀⣀⣀' [1336]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⢀⣀⣀⡀' [1337]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣀⣀⣀⠀' [1338]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣄⣀⡀⠀' [1339]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣆⣀⠀⠀' [1340]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣇⡀⠀⠀' [1341]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⣇⠀⠀⠀' [1342]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⡇⠀⠀⠀' [1343]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⠇⠀⠀⠀' [1344]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⠃⠀⠀⠀' [1345]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⠁⠀⠀⠀' [1346]=$'\E[A⡏⠁⠀⠀\E[B\E[4D⠀⠀⠀⠀' [1347]=$'\E[A⠏⠉⠀⠀\E[B\E[4D⠀⠀⠀⠀' [1348]=$'\E[A⠉⠉⠁⠀\E[B\E[4D⠀⠀⠀⠀' [1349]=$'\E[A⠈⠉⠉⠀\E[B\E[4D⠀⠀⠀⠀' [1350]=$'\E[A⠀⠉⠉⠁\E[B\E[4D⠀⠀⠀⠀' [1351]=$'\E[A⠀⠈⠉⠉\E[B\E[4D⠀⠀⠀⠀' [1352]=$'\E[A⠀⠀⠉⠙\E[B\E[4D⠀⠀⠀⠀' [1353]=$'\E[A⠀⠀⠈⠹\E[B\E[4D⠀⠀⠀⠀' [1354]=$'\E[A⠀⠀⠀⢹\E[B\E[4D⠀⠀⠀⠀' [1355]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⠀⠀⠀⠈' [1356]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⠀⠀⠀⠘' [1357]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⠀⠀⠀⠸' [1358]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⠀⠀⠀⢸' [1359]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⠀⣸' [1360]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⢀⣰' [1361]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⣀⣠' [1362]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⢀⣀⣀' [1363]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⣀⣀⡀' [1364]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⢀⣀⣀⠀' [1365]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣀⣀⡀⠀' [1366]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣄⣀⠀⠀' [1367]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣆⡀⠀⠀' [1368]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣇⠀⠀⠀' [1369]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⡇⠀⠀⠀' [1370]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⠇⠀⠀⠀' [1371]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⠃⠀⠀⠀' [1372]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⠁⠀⠀⠀' [1373]=$'\E[A⡏⠀⠀⠀\E[B\E[4D⠀⠀⠀⠀' [1374]=$'\E[A⠏⠁⠀⠀\E[B\E[4D⠀⠀⠀⠀' [1375]=$'\E[A⠉⠉⠀⠀\E[B\E[4D⠀⠀⠀⠀' [1376]=$'\E[A⠈⠉⠁⠀\E[B\E[4D⠀⠀⠀⠀' [1377]=$'\E[A⠀⠉⠉⠀\E[B\E[4D⠀⠀⠀⠀' [1378]=$'\E[A⠀⠈⠉⠁\E[B\E[4D⠀⠀⠀⠀' [1379]=$'\E[A⠀⠀⠉⠉\E[B\E[4D⠀⠀⠀⠀' [1380]=$'\E[A⠀⠀⠈⠙\E[B\E[4D⠀⠀⠀⠀' [1381]=$'\E[A⠀⠀⠀⠹\E[B\E[4D⠀⠀⠀⠀' [1382]=$'\E[A⠀⠀⠀⢸\E[B\E[4D⠀⠀⠀⠀' [1383]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⠀⠀⠀⠈' [1384]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⠀⠀⠀⠘' [1385]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⠀⠀⠀⠸' [1386]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⠀⢸' [1387]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⠀⣰' [1388]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⢀⣠' [1389]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⣀⣀' [1390]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⢀⣀⡀' [1391]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⣀⣀⠀' [1392]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⢀⣀⡀⠀' [1393]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣀⣀⠀⠀' [1394]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣄⡀⠀⠀' [1395]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣆⠀⠀⠀' [1396]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⡇⠀⠀⠀' [1397]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⠇⠀⠀⠀' [1398]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⠃⠀⠀⠀' [1399]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⠁⠀⠀⠀' [1400]=$'\E[A⡇⠀⠀⠀\E[B\E[4D⠀⠀⠀⠀' [1401]=$'\E[A⠏⠀⠀⠀\E[B\E[4D⠀⠀⠀⠀' [1402]=$'\E[A⠉⠁⠀⠀\E[B\E[4D⠀⠀⠀⠀' [1403]=$'\E[A⠈⠉⠀⠀\E[B\E[4D⠀⠀⠀⠀' [1404]=$'\E[A⠀⠉⠁⠀\E[B\E[4D⠀⠀⠀⠀' [1405]=$'\E[A⠀⠈⠉⠀\E[B\E[4D⠀⠀⠀⠀' [1406]=$'\E[A⠀⠀⠉⠁\E[B\E[4D⠀⠀⠀⠀' [1407]=$'\E[A⠀⠀⠈⠉\E[B\E[4D⠀⠀⠀⠀' [1408]=$'\E[A⠀⠀⠀⠙\E[B\E[4D⠀⠀⠀⠀' [1409]=$'\E[A⠀⠀⠀⠸\E[B\E[4D⠀⠀⠀⠀' [1410]=$'\E[A⠀⠀⠀⢰\E[B\E[4D⠀⠀⠀⠀' [1411]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⠀⠀⠀⠈' [1412]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⠀⠀⠀⠘' [1413]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⠀⠸' [1414]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⠀⢰' [1415]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⠀⣠' [1416]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⢀⣀' [1417]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⣀⡀' [1418]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⢀⣀⠀' [1419]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⣀⡀⠀' [1420]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⢀⣀⠀⠀' [1421]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣀⡀⠀⠀' [1422]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣄⠀⠀⠀' [1423]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⡆⠀⠀⠀' [1424]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠇⠀⠀⠀' [1425]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⠃⠀⠀⠀' [1426]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⠁⠀⠀⠀' [1427]=$'\E[A⡆⠀⠀⠀\E[B\E[4D⠀⠀⠀⠀' [1428]=$'\E[A⠇⠀⠀⠀\E[B\E[4D⠀⠀⠀⠀' [1429]=$'\E[A⠉⠀⠀⠀\E[B\E[4D⠀⠀⠀⠀' [1430]=$'\E[A⠈⠁⠀⠀\E[B\E[4D⠀⠀⠀⠀' [1431]=$'\E[A⠀⠉⠀⠀\E[B\E[4D⠀⠀⠀⠀' [1432]=$'\E[A⠀⠈⠁⠀\E[B\E[4D⠀⠀⠀⠀' [1433]=$'\E[A⠀⠀⠉⠀\E[B\E[4D⠀⠀⠀⠀' [1434]=$'\E[A⠀⠀⠈⠁\E[B\E[4D⠀⠀⠀⠀' [1435]=$'\E[A⠀⠀⠀⠉\E[B\E[4D⠀⠀⠀⠀' [1436]=$'\E[A⠀⠀⠀⠘\E[B\E[4D⠀⠀⠀⠀' [1437]=$'\E[A⠀⠀⠀⠰\E[B\E[4D⠀⠀⠀⠀' [1438]=$'\E[A⠀⠀⠀⢠\E[B\E[4D⠀⠀⠀⠀' [1439]=$'\E[A⠀⠀⠀⢀\E[B\E[4D⠀⠀⠀⠈' [1440]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⠀⠘' [1441]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⠀⠰' [1442]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⠀⢠' [1443]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⠀⣀' [1444]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⢀⡀' [1445]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⠀⣀⠀' [1446]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⢀⡀⠀' [1447]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠀⣀⠀⠀' [1448]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⢀⡀⠀⠀' [1449]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⣀⠀⠀⠀' [1450]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⡄⠀⠀⠀' [1451]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠆⠀⠀⠀' [1452]=$'\E[A⠀⠀⠀⠀\E[B\E[4D⠃⠀⠀⠀' [1453]=$'\E[A⡀⠀⠀⠀\E[B\E[4D⠁⠀⠀⠀' [1454]=$'\E[A⡄⠀⠀⠀\E[B\E[4D⠀⠀⠀⠀' [1455]=$'\E[A⠆⠀⠀⠀\E[B\E[4D⠀⠀⠀⠀') ``` then: ``` mySpinner() { printf '\n%s\e7' "$*" while ! read -sn 1 -t .02 _;do printf '\e8%s ' ${shapes[shcnt++%${#shapes[@]}]} done echo } mySpinner "Simple test: " ⡏⠉⠀⠀ Simple test: ⣇⣀⠀⠀ ``` [![snake spinner braille sample](https://i.stack.imgur.com/IY4Nu.gif)](https://i.stack.imgur.com/IY4Nu.gif) ## Some explanations We have 28 *pixels* around a square of `8 x 8`. building a *shape array*, growing from `1` to `27`, making a full loop with each length, then shrinking from `26` to `2` in order to loop correctly, we must obtain: `( 27 + 25 ) * 28 = 1456` *`shapes`*. Here is how look 2 1st shapes: ``` [0]=$'\e[A\U2801\U2800\U2800\U2800\e[B\e[4D\U2800\U2800\U2800\U2800' [1]=$'\e[A\U2808\U2800\U2800\U2800\e[B\e[4D\U2800\U2800\U2800\U2800' ``` As shape use two lines, I use ANSI escape sequences for *moving cursor*: * `\e[A` : Move cursor up * `\e[B` : Move cursor down * `\e[D` : Move cursor left (`\e[4D` move 4 position left) * In order to ensure correct placement even using non monospace font, whitespace are drawn by using `BRAILLE PATTERN BLANK` (`\U2800`) ## My question: What's the shortest way to populate `$shapes` array. The goal of this is to build the array of 1456 shapes, for a 8x8 square... **But even** if user want a smaller square, I think, the ideal tool must accept as optional argument, an integer, between 2 to 8, specifying the size of desired square! So in fine. * The tool could be written in any language, * If no argument are given, the tool must compute a *progessive snake* around a 8x8 square * The snake + Start at upper left corner with 1 pixel, + Do a full turn around desired size square starting horizontally, + Grown by 1 pixel at begin of each new turn, upto full size - 1 pixel, then + shrink by 1 pixed at begin of each new turn, upto 2 pixel. * If argument between 2 to 8 are given, the tool must compute a *progessive snake* around a (smaller) square of given size. * The output could be + A full bash array, as cited sample, + space separated + new line separated * This is a [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so shorter code win. ## About [bash](/questions/tagged/bash "show questions tagged 'bash'") and final test. Answering [@Jonah's comment](https://codegolf.stackexchange.com/questions/261468/my-eight-braille-pattern-progressive-snake-spinner#comment574689_261468), I use bash for everything, so having a *`shape array`* for playing under bash while other task are running in background seem usefull. ( Playing with backgroud tasks are my every day work! You could have a look at my [Practical GNU/Linux sample 2: sha1sum with progress bar](https://stackoverflow.com/a/68298090/1765658) (near bottom of answer). ### Final script to test *any language* tool: First a little test function whith: ``` mySpinner() { local delay=.003 shcnt [[ $1 == -d ]] && delay=$2 && shift 2 printf '\n%s\e[A\e7' "$*" while ! read -sn 1 -t $delay _; do printf '\e8%s ' ${shapes[shcnt%${#shapes[@]}]} ((shcnt++ > ${#shapes[@]}*3/2)) && break 2 done echo } ``` ``` Usage: mySpinner [-d delay] [prompt string] ``` Use `$shapes` array to be populated by: ``` mapfile < <(./buildBrailleSnakeSpinner) ``` or ``` mapfile < <(./buildBrailleSnakeSpinner 6) ``` Then ``` mapfile < <(./braille-matrix.sh 7) mySpinner 'Demo: ' mySpinner -d .05 'Slowed: ' ``` # Leaderboard ``` var QUESTION_ID=261468; var OVERRIDE_USER=0; var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;function answersUrl(d){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+d+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(d,e){return"https://api.stackexchange.com/2.2/answers/"+e.join(";")+"/comments?page="+d+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(d){answers.push.apply(answers,d.items),answers_hash=[],answer_ids=[],d.items.forEach(function(e){e.comments=[];var f=+e.share_link.match(/\d+/);answer_ids.push(f),answers_hash[f]=e}),d.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(d){d.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),d.has_more?getComments():more_answers?getAnswers():process()}})}getAnswers();var SCORE_REG=function(){var d=String.raw`h\d`,e=String.raw`\-?\d+\.?\d*`,f=String.raw`[^\n<>]*`,g=String.raw`<s>${f}</s>|<strike>${f}</strike>|<del>${f}</del>`,h=String.raw`[^\n\d<>]*`,j=String.raw`<[^\n<>]+>`;return new RegExp(String.raw`<${d}>`+String.raw`\s*([^\n,]*[^\s,]),.*?`+String.raw`(${e})`+String.raw`(?=`+String.raw`${h}`+String.raw`(?:(?:${g}|${j})${h})*`+String.raw`</${d}>`+String.raw`)`)}(),OVERRIDE_REG=/^Override\s*header:\s*/i;function getAuthorName(d){return d.owner.display_name}function process(){var d=[];answers.forEach(function(n){var o=n.body;n.comments.forEach(function(q){OVERRIDE_REG.test(q.body)&&(o="<h1>"+q.body.replace(OVERRIDE_REG,"")+"</h1>")});var p=o.match(SCORE_REG);p&&d.push({user:getAuthorName(n),size:+p[2],language:p[1],link:n.share_link})}),d.sort(function(n,o){var p=n.size,q=o.size;return p-q});var e={},f=1,g=null,h=1;d.forEach(function(n){n.size!=g&&(h=f),g=n.size,++f;var o=jQuery("#answer-template").html();o=o.replace("{{PLACE}}",h+".").replace("{{NAME}}",n.user).replace("{{LANGUAGE}}",n.language).replace("{{SIZE}}",n.size).replace("{{LINK}}",n.link),o=jQuery(o),jQuery("#answers").append(o);var p=n.language;p=jQuery("<i>"+n.language+"</i>").text().toLowerCase(),e[p]=e[p]||{lang:n.language,user:n.user,size:n.size,link:n.link,uniq:p}});var j=[];for(var k in e)e.hasOwnProperty(k)&&j.push(e[k]);j.sort(function(n,o){return n.uniq>o.uniq?1:n.uniq<o.uniq?-1:0});for(var l=0;l<j.length;++l){var m=jQuery("#language-template").html(),k=j[l];m=m.replace("{{LANGUAGE}}",k.lang).replace("{{NAME}}",k.user).replace("{{SIZE}}",k.size).replace("{{LINK}}",k.link),m=jQuery(m),jQuery("#languages").append(m)}} ``` ``` body{text-align:left!important}#answer-list{padding:10px;float:left}#language-list{padding:10px;float:left}table thead{font-weight:700}table td{padding:5px} ``` ``` <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="https://cdn.sstatic.net/Sites/codegolf/primary.css?v=f52df912b654"> <div id="language-list"> <h2>Winners by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr></thead> <tbody id="languages"> </tbody> </table> </div><div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr></thead> <tbody id="answers"> </tbody> </table> </div><table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td><a href="{{LINK}}">{{SIZE}}</a></td></tr></tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td><a href="{{LINK}}">{{SIZE}}</a></td></tr></tbody> </table> ``` [Answer] # [JavaScript (Node.js)](https://nodejs.org), 371 bytes ``` n=process.argv[2]-1||7,i=[],b=[],[x=y=0,1,2,3].map(d=>[...Array(n)].map(_=>(i.push(y&4|x>>1),b.push(1<<(y%4>2?x%2+6:y%4+x%2*3)),d>2?y--:d>1?x--:d?y++:x++))),n*=4,[...Array(n*2-4)].map((_,l)=>[...Array(n)].map((s=Array(8).fill(10240),p)=>([...Array(l+1<n?l+1:n*2-3-l)].map(_=>s[i[p%n]]|=b[p++%n]),console.log(String.fromCharCode(...s).replace(/..../,"$&\x1b[4D\x1b[B"))))) ``` [Try it online!](https://tio.run/##bVDLboMwEPyXqIlsbBwMqK0QBrXpH/Toosg8QqgcY9lpBBL/Tk2plB66h93Z2dG@PsVN2Mp0@uqrvm7mWTFt@qqxlgjT3nhY@HSannDHeIHLxfGBjSzAFIc4KshFaFCzjBNCXowRI1BwJY8sAx3RX/YMxl08DVlGIS5XgqYpGLdxFubDNkSPicPIIS@CENeOHX0/qTOaD0vMR4SSASHoispjMf4zywv9@HceOGIJ/1sEWLYSz5CcOikBDcI4gFg7NbjLJaKpyp1Plq6RL@93WN5xvVVFMbGSa4QchLjqle1lQ2Tfgver6VRLTqa/HM7CHNwjgWtsITGNlqJqwN6lZI83D7uPgZY8fvsJrxu42Dx/Aw "JavaScript (Node.js) – Try It Online") Explanation: Full program that outputs each shape on its own line. ``` n=process.argv[2]-1||7, ``` Get the desired size, but subtract 1. ``` i=[],b=[],[x=y=0,1,2,3].map(d=>[...Array(n)].map(_=>(i.push(y&4|x>>1),b.push(1<<(y%4>2?x%2+6:y%4+x%2*3)),d>2?y--:d>1?x--:d?y++:x++))), ``` For each pixel on the edge of the desired square, calculate the character offset and bitmask that will turn on that Braille dot. ``` n*=4, ``` Get the perimeter of the square. ``` [...Array(n*2-4)].map((_,l)=> ``` Loop over the lengths. ``` [...Array(n)].map((s=Array(8).fill(10240),p)=> ``` Loop around the perimeter. ``` ([...Array(l+1<n?l+1:n*2-3-l)].map(_=>s[i[p%n]]|=b[p++%n]), ``` Set the desired Braille dots. ``` console.log(String.fromCharCode(...s).replace(/..../,"$&\x1b[4D\x1b[B"))))) ``` Output the resultant string but with the cursor movements in the middle. [Answer] # [bash](https://www.gnu.org/software/bash/), 880 bytes For making this script truncated at 80 characters by line, I've added some unuseful... this could be reduced be at least 4 characters... ``` a=(01 [1]=08 [10]=02 [11]=10 [20]=04 [21]=20 [30]=40 [31]=80);P(){ printf -v "\ $@";};for((i=0;i<8;i++)){ for((l=0;l<8;l++)){ P r %*s $[7-i/4*4-l/2];P r "%*s%s\ " $[2+i/4*4+l/2] ${a[i%4*10+l%2]} "$r";m[$i$l]=$((16#${r// /00}));};};d(){ ((t<= c||t+n-q-1>++c))&&((r|=m[$1]))&&((++p>=n));};s(){ local -i i w z n q;s=$1;q=(s-1 )*4;local -n r=$2;t=${5:-0};n=${6:-2+q};c=0 p=0;((s>1))&&((s<17))||return;i=(8-s )/2;u=${3:-$i} v=${4:-$i};for((x=0;x<s;x++)){ w=u+x;d $v$w&&return;};for((x--,y= 1;y<s;y++)){ z=v+y;d $z$w&&return;};for((y--,x--;x>0;x--)){ w=v+x;d $z$w&&return };for((;y>0;y--)){ z=v+y;d $z$u&&return;};};L() { P d %016X $1;printf "%b%b%b%b\ \e[B\e[4D%b%b%b%b\n" \\U28{${d:0:2},${d:2:2},${d:4:2},${d:6:2},${d:8:2},${d:10:2 },${d:12:2},${d:14}};};b=${1:-8};for((i=1;i<(b-1)*8-3;i++)){ l=$((i>(b-1)*4-1?(b -1)*8-2-i:i));for((h=0;h<(b-1)*4;h++)){ j=0;s $b j 0 0 $h $l;L $j;};} ``` Sample: ``` shapes=($(bash <<"eof" a=(01 [1]=08 [10]=02 [11]=10 [20]=04 [21]=20 [30]=40 [31]=80);P(){ printf -v "\ $@";};for((i=0;i<8;i++)){ for((l=0;l<8;l++)){ P r %*s $[7-i/4*4-l/2];P r "%*s%s\ " $[2+i/4*4+l/2] ${a[i%4*10+l%2]} "$r";m[$i$l]=$((16#${r// /00}));};};d(){ ((t<= c||t+n-q-1>++c))&&((r|=m[$1]))&&((++p>=n));};s(){ local -i i w z n q;s=$1;q=(s-1 )*4;local -n r=$2;t=${5:-0};n=${6:-2+q};c=0 p=0;((s>1))&&((s<17))||return;i=(8-s )/2;u=${3:-$i} v=${4:-$i};for((x=0;x<s;x++)){ w=u+x;d $v$w&&return;};for((x--,y= 1;y<s;y++)){ z=v+y;d $z$w&&return;};for((y--,x--;x>0;x--)){ w=v+x;d $z$w&&return };for((;y>0;y--)){ z=v+y;d $z$u&&return;};};L() { P d %016X $1;printf "%b%b%b%b\ \e[B\e[4D%b%b%b%b\n" \\U28{${d:0:2},${d:2:2},${d:4:2},${d:6:2},${d:8:2},${d:10:2 },${d:12:2},${d:14}};};b=${1:-8};for((i=1;i<(b-1)*8-3;i++)){ l=$((i>(b-1)*4-1?(b -1)*8-2-i:i));for((h=0;h<(b-1)*4;h++)){ j=0;s $b j 0 0 $h $l;L $j;};} eof )) echo $'\n\e[A\e7';while ! read -sn1 -t .01 _;do printf '\e8%b ' ${shapes[shcnt++%${#shapes[@]}]};done ``` ``` ⡏⠀⠀⠀ ⣇⣀⣀⣰ ``` or ``` mySpinner() { local d=.003 c;[[ $1 == -d ]]&&d=$2&&shift 2;printf \ '\n%s\e[A\e7' "$*";while ! read -sn 1 -t $d _;do printf '\e8%s ' ${shapes[c% ${#shapes[@]}]};((c++>${#shapes[@]}*3/2))&&break 2;done;echo;} for((l=1;++l<9;)){ shapes=($(bash /dev/stdin <<"eof" $l a=(01 [1]=08 [10]=02 [11]=10 [20]=04 [21]=20 [30]=40 [31]=80);P(){ printf -v "\ $@";};for((i=0;i<8;i++)){ for((l=0;l<8;l++)){ P r %*s $[7-i/4*4-l/2];P r "%*s%s\ " $[2+i/4*4+l/2] ${a[i%4*10+l%2]} "$r";m[$i$l]=$((16#${r// /00}));};};d(){ ((t<= c||t+n-q-1>++c))&&((r|=m[$1]))&&((++p>=n));};s(){ local -i i w z n q;s=$1;q=(s-1 )*4;local -n r=$2;t=${5:-0};n=${6:-2+q};c=0 p=0;((s>1))&&((s<17))||return;i=(8-s )/2;u=${3:-$i} v=${4:-$i};for((x=0;x<s;x++)){ w=u+x;d $v$w&&return;};for((x--,y= 1;y<s;y++)){ z=v+y;d $z$w&&return;};for((y--,x--;x>0;x--)){ w=v+x;d $z$w&&return };for((;y>0;y--)){ z=v+y;d $z$u&&return;};};L() { P d %016X $1;printf "%b%b%b%b\ \e[B\e[4D%b%b%b%b\n" \\U28{${d:0:2},${d:2:2},${d:4:2},${d:6:2},${d:8:2},${d:10:2 },${d:12:2},${d:14}};};b=${1:-8};for((i=1;i<(b-1)*8-3;i++)){ l=$((i>(b-1)*4-1?(b -1)*8-2-i:i));for((h=0;h<(b-1)*4;h++)){ j=0;s $b j 0 0 $h $l;L $j;};} eof )) mySpinner "Test $l: " } ``` ``` ⠚⠀⠀⠀ Test 2: ⠀⠀⠀⠀ ⠮⠇⠀⠀ Test 3: ⠀⠀⠀⠀ ⣎⣹⠀⠀ Test 4: ⠀⠀⠀⠀ ⡎⠉⡇⠀ Test 5: ⠉⠉⠁⠀ ⡎⠉⢹⠀ Test 6: ⠓⠒⠚⠀ ⡎⠉⠉⡇ Test 7: ⠧⠤⠤⠇ ⡎⠉⠉⢹ Test 8: ⣇⣀⣀⣸ ``` ]
[Question] [ ## Background In Python, function arguments are defined within the parentheses following the function name in the function definition. There are different ways to present function arguments, and they can be categorised into three types: 1. Positional-only arguments, 2. Positional or keyword arguments, and 3. Keyword-only arguments Each of these may also have a default value. ### Example function (de)composition Let's break down an example function definition: ``` def fn(q: str, /, z: int, x: float, b: int = 1, *, c: int = 1) -> None: ... ``` 1. Positional-only argument (`q: str`): The parameter `q` is a positional-only argument because it is defined before the slash (`/`) in the argument list. It means that this argument can only be passed by its position and not by using a keyword. For example, you can call the function as `fn("hello", 2.5, 3)`. 2. Positional or keyword argument (`z: int`, `x: float`): The parameters `z` and `x` are defined after the slash (`/`), but they are not marked as keyword-only arguments. It means that these arguments can be passed either by their position or by using their corresponding keyword. For example, you can call the function as `fn("hello", 5, x=2.5)` or `fn("hello", z=5, x=2.5)`. 3. Default argument (`b: int = 1`): The parameter `b` has a default value of `1`. It means that if no argument is provided for `b` when calling the function, it will automatically be assigned the default value. For example, you can call the function as `fn("hello", 5, 2.5, c=3)` or `fn("hello", 5, 2.5, 2)`. 4. Keyword-only argument (`c: int = 1`): The parameter `c` is a keyword-only argument because it is defined after the asterisk (`*`). It means that this argument can only be passed by using its corresponding keyword and cannot be passed by position. For example, you can call the function as `fn("hello", 5, 2.5, c=3)`. 5. Return type (`-> None`): The `-> None` annotation specifies the return type of the function. In this case, the function is expected to return `None`. This can be ignored. N.B. Non-default positional arguments can not come after a default argument. That is, `def fn_bad(a: int = 1, / b: int, *, c: int = 1, d: str) -> None:...` is invalid due to `b`. `b` is a positional or keyword argument but it comes after a defaulted positional argument. `d` is valid however since this is a keyword only argument and their order does not matter. ### Valid method invocations There are 14 possible ways to call the function `fn` based on its function definition. Here are all the combinations: 1. `fn("hello", 2, 3.0)` 2. `fn("hello", 2, 3.0, 1)` 3. `fn("hello", 2, 3.0, c=1)` 4. `fn("hello", 2, x=3.0)` 5. `fn("hello", 2, x=3.0, b=1)` 6. `fn("hello", 2, x=3.0, c=1)` 7. `fn("hello", z=2, x=3.0)` 8. `fn("hello", z=2, x=3.0, b=1)` 9. `fn("hello", z=2, x=3.0, c=1)` 10. `fn("hello", 2, 3.0, b=1, c=1)` 11. `fn("hello", z=2, x=3.0, b=1, c=1)` 12. `fn("hello", z=2, x=3.0, b=1, c=1)` 13. `fn("hello", 2, x=3.0, b=1, c=1)` 14. `fn("hello", 2, 3.0, 1, c=1)` In the above examples, `"hello"` is passed as the value for the positional-only argument `q`, `2` is passed for the positional or keyword argument `z`, `3.0` is passed for the positional or keyword argument `x`, `1` is passed for the default argument `b`, and `1` is passed for the keyword-only argument `c`. The arguments can be passed either by position or by using their corresponding keywords, depending on the argument type. Keyword arguments are order independent, that is `fn("hello", b=1, c=1, x=3.0, z=2)` and `fn("hello", x=3.0, b=1, z=2, c=1)` are congruent. Invalid invocation examples include: `fn("hello", 2, x=3.0, 1)` since a positional argument comes after a keyword argument, and `fn("hello", z=2, b=1, c=1)` due to missing required argument `x` ## The Challenge Create a script which generates all possible python function invocation signatures, describing the function arguments as their argument name, if it is passed as a keyword argument, and the type of the argument. To make things fair across languages; let's say: the inputs are three lists; `positional_only`, `positional_or_keyword` and `keyword_only` where their elements describe the python function's arguments in the format of `[string name, string type, bool has_default]` Or some similar data structure. These inputs are not counted towards the character count. The output can be any intelligible format. (N.B. This challenge disregards any function which contains args or kwargs catch all variables (`*foo`, or `**bar`)) ## Test cases (need more) ``` # def fn(q: str, /, z: int, x: float, b: int = 1, *, c: int = 1) -> None: positional_only = [["q", "str", false]] positional_or_keyword = [["z", "int", false], ["x", "float", false], ["b", "int", true]] keyword_only =[["c", "int", true]] generate_signatures(positional_only, positional_or_keyword, keyword_only) # returns: [ [(None, 'str'), ('x', 'float'), ('z', 'int')], [(None, 'str'), ('c', 'int'), ('x', 'float'), ('z', 'int')], [(None, 'str'), ('b', 'int'), ('x', 'float'), ('z', 'int')], [(None, 'str'), ('b', 'int'), ('c', 'int'), ('x', 'float'), ('z', 'int')], [(None, 'str'), (None, 'int'), ('x', 'float')], [(None, 'str'), (None, 'int'), ('c', 'int'), ('x', 'float')], [(None, 'str'), (None, 'int'), ('b', 'int'), ('x', 'float')], [(None, 'str'), (None, 'int'), ('b', 'int'), ('c', 'int'), ('x', 'float')], [(None, 'str'), (None, 'int'), (None, 'float')], [(None, 'str'), (None, 'int'), (None, 'float'), ('c', 'int')], [(None, 'str'), (None, 'int'), (None, 'float'), ('b', 'int')], [(None, 'str'), (None, 'int'), (None, 'float'), ('b', 'int'), ('c', 'int')], [(None, 'str'), (None, 'int'), (None, 'float'), (None, 'int')], [(None, 'str'), (None, 'int'), (None, 'float'), (None, 'int'), ('c', 'int')], ] # def fn_2(a: int, b: int = 1, *, d: int, c:int = 1) -> None: ... positional_only = [] positional_or_keyword = [["a", "int", false], ["b", "int", true]] keyword_only =[["d", "int", false], ["c", "int", true]] generate_signatures(positional_only, positional_or_keyword, keyword_only) # returns [ [('a', int), ('d', int)], [('a', int), ('c', int), ('d', int)], [('a', int), ('b', int), ('d', int)], [('a', int), ('b', int), ('c', int), ('d', int)], [(None, int), ('d', int)], [(None, int), ('c', int), ('d', int)], [(None, int), ('b', int), ('d', int)], [(None, int), ('b', int), ('c', int), ('d', int)], [(None, int), (None, int), ('d', int)], [(None, int), (None, int), ('c', int), ('d', int)] ] # def fn_3(a: int, b:int = 1, /, q:int = 1, *, r: int): ... positional_only = [(None, 'int', False), (None, 'int', True)] positional_or_keyword = [('q', 'int', True)] keyword_only = [('r', 'int', False)] generate_signatures(positional_only, positional_or_keyword, keyword_only) # returns [ [(None, int), ('r', int)], [(None, int), ('q', int), ('r', int)], [(None, int), (None, int), ('r', int)], [(None, int), (None, int), ('q', int), ('r', int)] [(None, int), (None, int), (None, int), ('r', int)] ] ``` The way these outputs are structured is a tuple of argument name and type. If the argument name is `None` then the argument is a positional argument. That is `(None, int)` is a positional argument (e.g. `fn(1)`) whereas `("x", int)` is a keyword argument e.g. `fn(x=1)`. `[(None, int), (None, int), ('c', int), ('d', int)]` describes a function call of `fn(1, 1, c=1, d=1)` ### Testing your outputs A neat way to check is go to [vscode.dev](https://vscode.dev), install the python plugin, convert your list of lists to function invocations and paste it into a new document. The static analyser will tell you which are (in)valid. I think there is a way to run pyright in code, but this was quicker: ``` for i, sig in enumerate(sigs): print(f"# {i} - {sig}") s = 'fn(' for arg in sig: if arg[0] is not None: s += f"{arg[0]}=" typ = arg[1] val = None if typ == 'str': val = "\"str\"" elif typ == 'int': val = "1" elif typ == 'float': val = "1.0" else: val = "UNKNOWN" s += f"{val}," print(f"{s})\n") ``` ### Bonus challenge Given `fn_a(...)` and `fn_b(...)` determine any ambiguous valid signatures to these methods. e.g. `fn_a(x: str, y: int) -> None: ...` `fn_b(z: str, /, x: int) -> None: ...` are distinct for `fn(x="foo", y=1)` and `fn(x="foo", z=1)` but conflict for the signature `fn("foo", 1)` That is, both functions contain the valid signature of `[(None, "str"), (None, "int")]` [Answer] # Python3, 302 bytes ``` from itertools import* V=lambda v:not any(not v[i][0] and v[i-1][0]for i in range(len(v))if i) def f(a,b,c): P=product(*[*[[(None,t)]+[[]]*k for n,t,k in a],*[[(None,t),(n,t)]+[[]]*k for n,t,k in b],*[[(n,t)]+[[]]*k for n,t,k in c]]) return[*map(eval,{str(K)for i in P if V(K:=[j for j in i if j])})] ``` [Try it online!](https://tio.run/##vZLBS8MwGMXv/Ss@dmlSM5iIIINevQxkB9klhJG2qWZLky7NqlX822vjytxmNwTBU/I9fnl5L6Rs3LPRN3elbdvcmgKkE9YZoyqQRWmsi4JFrHiRZBzqqTYOuG6QX2sqGZ2wbs78fnztp9xYkCA1WK6fBFJCoxpjmYPEQSZyyBEnCUnxNIB5XFqTbVOHIhpRih6MFsRhdkUpY9EavJUmjqy9HWfkgCFInyWTHXkeSBnDAVjhtlbTqOAlEjVX5L1yFs3wvsAcutQLNJvGdPVlsPKq9OqK4Q/M2tJU0kmjuVoarRqIgdLRZkRg1Fl1yz1XlWAsOOTsci2aF2OzHf3maandniZAR69ezJXhx3LyzT7arTfurfrbO7v0B1LabkQ5OslKBjORQ0OM@8PhOIxuJzgYqHuxGx/q9osS2dC5/262@2kQdljY58AEjlUfBF94AhRuwlP4uK1nbHhyzd@qtZ8) For those interested, here is a larger solution which parses the function signature: ``` import ast from itertools import* A=lambda x:x.annotation.id H=lambda v:not any(not v[i][0] and v[i-1][0]for i in range(len(v))if i) def f(s): a=ast.parse(s).body[0].args V=['kw_defaults','defaults'] d=sum(len(getattr(a,i))for i in V) l=sum(len(i)for j in a._fields if(i:=getattr(a,j))and j not in V) K=0 P=product(*[*[[(None,A(i))]for i in a.posonlyargs if(K:=K+1)],*[[(None,A(i)),(i.arg,A(i))]+[[]]*(((K:=K+1))>l-d)for i in a.args],*[[(i.arg,A(i)),[]]for i in a.kwonlyargs]]) return[K for i in P if H(K:=[j for j in i if j])] ``` [Try it online!](https://tio.run/##ZZJNj9sgEIbv/IpRLgYvoUm3h8qSV9rbSpGqPe0FoYgEO8XrgAsku@mfT4d8OGnri5l5Zx7mBYZD@und4/chHI92O/iQQMdE2uC3YFMTkvd9hLNSkue619uV0fBZfQrtnE86We@ENeTlKu0rTIN2B5r/e2mVnCmMTV5P5zlqfQAL1kHQbtPQvnF0z5htwTJimhZaGllFQNc4ihh0iA0mxMqbAzYLHTaRwFsti/ePJZbrXZ9iwYtxqQiYOu62J/CmwRlToJpbxsaN3xiBfqyxJ6HLghbL1ja9Qc8ttVV9a@8YyyY6yLYuiEU9I/BaD8Gb3TrRUpZS0h/eNfwZoexmVIvBR@/6Qx4@oxdVvXiYM8X/7uDUZn@X9gcplSopvVazp35q2B00086IuzaOTXc17x/XfZXCkUOTdsHJBYwlrzgPvOQ9ZAfjQdic7RRTx1hPJpPzvTj6q4KYAocvHH5XWJc4vgVoe69xtTploIY5h5LDegwZTJ8gu8RbxU8IQTIzzlG8wZdfqb4w/yGZS3pd/QccYUNAjcoyPx40eg6LaVF@m7F7EQ@dHf8A) [Answer] # [Haskell](https://www.haskell.org/), 208 bytes ``` import Data.List y=elem '=' o(a:b)=[c++d|d<-o b,c<-[a]:[[]|y a]];o[]=[[]] s s=inits s`zip`tails s i(p,a,n)=nub[(map(\\"=")d,map((++"=").(\\"="))g)|(b,c)<-s$a,(d,e)<-s$p++b,all y e,f<-o$c++n,g<-permutations f] ``` [Try it online!](https://tio.run/##NY5LbsMgFEXnXgWyLAUEzgJSM8uwOyBIedgkfSq/GqLEkffukn5G95w7ufcD8qd1btvQpzgXcoQC@3fMpVmkddaTndw1kcLBMKlGzqd1GvpIjBiHXoE@KKXXhYDWb1FpWU03mWSJAUvN8xPTuQC6yg3SJEAEJsPNKOoh0dOplS2bxIsp5y/Z/5XsylZaV9jQ5w4EnYT9wcS5EeAcWYgVl3qlq6eCuA59srO/FSgYQyYXvXnAINOMoXRI73GecvvVil94kgcx8t/Gurd9Aw "Haskell – Try It Online") The idea here is to split the semipositionals into positional or named. The default-having positionals can be omitted when trailing all mere positionals. The named can be omitted when default-having. The named can be freely permuted, while the positionals cannot. [Answer] # [Charcoal](https://github.com/somebody1234/Charcoal), 68 bytes ``` ≔⁺θηυF…·LΦθ¬⊟ιLυ«≔⁻⁺ηζ…υιε≔Φε§κ²δEX²Lδ⭆¹⁺E…υι⟦ω§ξ¹⟧E⁺⁻εδΦδ﹪÷κX²π²…ξ² ``` [Try it online!](https://tio.run/##bVCxTsMwEJ3JV9wWRzqGZu1UFVWqRFEEbFGGKDaJVctOHTsNIL49nE1oUcUttt@9e@/5mq62janVPG@GQbaaFcoP7ITQZQg@WydvxgLb64ZgOYrnWreCPQrduo7tpHLCBvKTcawwPZMZFcLS9/SAz@RuUT5ITdJRv0P4IN72vVFi29GgR5BhUpDjL3@RFwgbt9dcTOyIkAcWD6zCSu3Yoe7J@Uy8/OLLA@fFUb8N7RVCNA33G0eE8nyVnxBWWUVgFI0jMbIIjghLHk59w70ytBX3IEfJRQh2CdEH9zzu4eo2/UBU6@RrnsuyTFOElH5Ax65Wg6goyx/s1XpRBaxMT/@i9na@qub7UX0D "Charcoal – Try It Online") Link is to verbose version of code. Explanation: ``` ≔⁺θηυ ``` Get all of the positional arguments. ``` ≔⁺θηυF…·↨¹Eθ¬⊟ιLυ« ``` Count the number of mandatory positional-only parameters and loop from there up to all positional parameters. ``` ≔⁻⁺ηζ…υιε ``` Get the remaining named arguments. ``` ≔Φε§κ²δ ``` Get those that are optional. ``` EX²Lδ⭆¹⁺E…υι⟦ω§ξ¹⟧E⁺⁻εδΦδ﹪÷κX²π²…ξ² ``` For each possible combination of optional named parameters, concatenate the positional parameters and the mandatory named parameters with them. ]
[Question] [ Given a universe of \$v\$ elements, a **Kirkman triple system** is a set of \$(v-1)/2\$ *classes* each having \$v/3\$ *blocks* each having three elements, so that * every pair of elements appears in exactly one block * all classes are partitions of the universe. [Kirkman's schoolgirl problem](https://en.wikipedia.org/wiki/Kirkman%27s_schoolgirl_problem) corresponds to the \$v=15\$ case. > > Fifteen young ladies in a school walk out three abreast for seven days in succession: it is required to arrange them daily so that no two shall walk twice abreast. > > > --- Below is a procedure to construct a Kirkman triple system for \$v=3q\$ where \$q\$ is a prime number\* of the form \$6t+1\$, from my MSE answer [here](https://math.stackexchange.com/a/4510645/357390): > > Label elements as \$(x,j)\$ where \$x\in\mathbb F\_q\$ and \$j\in\{0,1,2\}\$. Let \$g\$ be a primitive element of \$\mathbb F\_q\$. Define blocks > $$Z=\{(0,0),(0,1),(0,2)\}\\ > B\_{i,j}=\{(g^i,j),(g^{i+2t},j),(g^{i+4t},j)\},0\le i<t,0\le j<2\\ > A\_i=\{(g^i,0),(g^{i+2t},1),(g^{i+4t},2)\},0\le i<6t$$ > and the class > $$C=\{Z\}\cup\{B\_{i,j}:0\le i<t,0\le j<2\}\cup\{A\_i:0\le i<6t,\lfloor i/t\rfloor\in\{1,3,5\}\}$$ > Define shifting a block \$b\$ by \$s\in\mathbb F\_q\$ as > $$b+s=\{(x+s,j):(x,j)\in b\}$$ > and shifting a class similarly, then a Kirkman triple system of order \$3q\$ is > $$\{C+s:s\in\mathbb F\_q\}\cup\{\{A\_i+s:s\in\mathbb F\_q\}:0\le i<6t,\lfloor i/t\rfloor\in\{0,2,4\}\}$$ > > > ## Task Given a prime number \$q\$ of the form \$6t+1\$, output all classes and blocks of a Kirkman triple system on \$v=3q\$ elements. You may use any distinct values for the elements. Formatting is flexible, but the boundaries between elements, blocks and classes must be clear. This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"); fewest bytes wins. You must be able to run your code to completion for at least the smallest case \$q=7\$. ## Test cases This is a possible output for \$q=7\$: ``` [[[0, 7, 14],[1, 2, 4],[8, 9, 11],[15, 16, 18],[3, 13, 19],[6, 12, 17],[5, 10, 20]], [[1, 8, 15],[2, 3, 5],[9, 10, 12],[16, 17, 19],[4, 7, 20],[0, 13, 18],[6, 11, 14]], [[2, 9, 16],[3, 4, 6],[10, 11, 13],[17, 18, 20],[5, 8, 14],[1, 7, 19],[0, 12, 15]], [[3, 10, 17],[0, 4, 5],[7, 11, 12],[14, 18, 19],[6, 9, 15],[2, 8, 20],[1, 13, 16]], [[4, 11, 18],[1, 5, 6],[8, 12, 13],[15, 19, 20],[0, 10, 16],[3, 9, 14],[2, 7, 17]], [[5, 12, 19],[0, 2, 6],[7, 9, 13],[14, 16, 20],[1, 11, 17],[4, 10, 15],[3, 8, 18]], [[6, 13, 20],[0, 1, 3],[7, 8, 10],[14, 15, 17],[2, 12, 18],[5, 11, 16],[4, 9, 19]], [[1, 9, 18],[2, 10, 19],[3, 11, 20],[4, 12, 14],[5, 13, 15],[6, 7, 16],[0, 8, 17]], [[2, 11, 15],[3, 12, 16],[4, 13, 17],[5, 7, 18],[6, 8, 19],[0, 9, 20],[1, 10, 14]], [[4, 8, 16],[5, 9, 17],[6, 10, 18],[0, 11, 19],[1, 12, 20],[2, 13, 14],[3, 7, 15]]] ``` --- \*The construction also works for \$q\$ any prime **power** of the form \$6t+1\$, but I know some languages may be disadvantaged in implementing general finite field arithmetic. Cf. [here](https://codegolf.stackexchange.com/q/75786/110698). [Answer] # [Python](https://www.python.org) with numpy, 285 bytes ``` from numpy import* def k(q): t=q//6;a=array;r=range;R=a(r(q-1));X=R//t%2;h=a(r(3));g=1;p=lambda x:[(x+s)%q for s in r(q)] while 1in g**R[1:]%q:g+=1 A=a([g**(i+2*h*t)%q+h/5for i in R]);return[p(i)for i in A[X<1]]+p(a([h/5]+[(g**(i+2*h*t))%q+j/5for i in r(t)for j in h]+list(A[X>0]))) ``` [Attempt This Online!](https://ato.pxeger.com/run?1=TZFLbsIwFEXVYbKHSp4g7BiUhqofxXUltpBOkCIPTMnHJHGch1FhLZ0waffUrgYb-uHNfO67Z_D8_mn2tu714fCxteX08fvquoS-Q3rbmT1SnenBRuGqKFGDB5KGgeVDHN8zySWA3DPgIHVVsIxLDHiYJoSwBc_i2I5mrD7BW4cqnjDDW9ktVxLt0hzv6IaMBlT2gDZIaeS6RITBW63aAiUOVFGU5UkqRkNaUZ6EwdzJckexorOojqyr0zq-8wblDZkgDAq7BZ0brMgfn-eLp0QIarDru4KgOb7UeM_6wgPYnspr_6gFbdXGYid5vhGEkPOVvl78hpFg_VKDH9xlkBtPl23_2njs4zP2Y0Bpi0_hBBV6xccTNCbhf_Sj_v2IIw) [Answer] # [PARI/GP](https://pari.math.u-bordeaux.fr), 218 bytes ``` q->c=concat;c([c([[[[s+0*g=znprimroot(q),j]|j<-r=[0..2]]],c([[[[g^(i+2*t*k)+s,j]|k<-r]|i<-[1..t=q\6]]|j<-r]),[[[g^(i+2*t*j)+s,j]|j<-r]|i<-u=[1..6*t],i\t%2]])|s<-v=[1..q]],[[[[g^(i+2*t*j)+s,j]|j<-r]|s<-v]|i<-u,i\t%2<1]) ``` [Attempt This Online!](https://ato.pxeger.com/run?1=dY9NCsIwEIWv4kZI0qa0XVTBxIuko7SBlrTY39SF9CZuCiLuvY2extQouHEYGJj53jze-dYkndrnzXTJFvw66IyuH8-WbiWXdSUTvZFImDbVOz7J-alqOnXo6lqjFrsFjAWjHRe-54UA4Fo03yHlhESTEjv9DJUGglExKgLP07yNI7BKwO4vX3z44ssPfFZERIOrYr00HnjsGT2-160xFP_lM2efWC0LANuEd2FCVBqleEwZzdAKgz1Mk50v) ]
[Question] [ # Challenge ## Premise [Euler diagrams consist of simple closed shapes in a 2-D plane that each depict a set or category. How or whether these shapes overlap demonstrates the relationships between the sets.](https://en.wikipedia.org/wiki/Euler_diagram) I'm a spoilt brat who thinks Euler diagrams are hard to draw. For any Euler diagram, I want to know the minimum number of points where the perimeters of two shapes intersect. Here's an example: [![foo, bar outside foo, baz in foo, qux in baz, qux in fooNOTbaz, qux in bar](https://i.stack.imgur.com/Q7fBh.png)](https://i.stack.imgur.com/Q7fBh.png) The Euler diagram drawn above represents a relationship where: * `foo` and `bar` are disjoint. * All `baz` are `foo` but not vice versa. * Some `qux` are `baz`; some `qux` are `foo` but not `baz`; and some `qux` are `bar`. * Not all `baz` are `qux`; not all non-`baz` `foo` are `qux`; and not all `bar` are `qux`. In this particular example you can't do better than a whopping six crossings, but that's life. # Task Input: a sequence of multiple integers as follows. * An integer, say \$A\$, which designates a set. * An integer, say \$m\$. This means 'the set designated by \$A\$ is a proper subset of the following \$m\$ sets'.\* * \$m\$ integers (except if \$m=0\$), each designating a set. * An integer, say \$n\$. This means 'the set designated by \$A\$ is equivalent to the following \$n\$ sets'.\* * \$n\$ integers (except if \$n=0\$), each designating a set. * An integer, say \$p\$. This means 'the set designated by \$A\$ is a proper superset of the following \$p\$ sets'.\* * \$p\$ integers (except if \$p=0\$), each designating a set.\* * An integer, say \$q\$. This means 'the set designated by \$A\$ contains part but not all of each of the following \$q\$ sets'.\* * \$q\$ integers (except if \$q=0\$), each designating a set. * Repeat the above until the whole system is defined. The input format isn't fixed. The Python dict or [JS object](https://www.w3schools.com/js/js_objects.asp), for example, would be just as good - in such cases, the starred (\*) lines wouldn't be so necessary. Please note that the input is guaranteed *not* to produce 'exclaves' ([as in this image](https://upload.wikimedia.org/wikipedia/commons/f/fc/Euler_diagram_of_solar_system_bodies.svg), namely 'Centaurs'). Output: the minimum number of crossings, of the perimeters of two shapes, in the Euler diagram. ### Example 1 Input, with bracketed remarks for your benefit: ``` 1 (Consider the set designated by 1.) 0 (It's not a proper subset of anything.) 0 (It's equivalent to no other set.) 1 (It's a proper superset of:) 3 (the set designated by 3.) 1 (It; the set designated by 1; contains part but not all of:) 4 (the set designated by 4.) 2 (Consider the set designated by 2.) 0 (It's not a proper subset of anything.) 0 (It's equivalent to no other set.) 0 (It's not a proper superset of anything.) 1 (It contains part but not all of:) 4 (the set designated by 4.) 3 (Consider the set designated by 3.) 1 (It's a proper subset of:) 1 (the set designated by 1.) 0 (It; the set designated by 3; is equivalent to no other set.) 0 (It's not a proper superset of anything.) 1 (It contains part but not all of:) 4 (the set designated by 4.) 4 (Consider the set designated by 4.) 0 (It's not a proper subset of anything.) 0 (It's equivalent to no other set.) 0 (It's not a proper superset of anything.) 3 (It contains part but not all of:) 1 (the set designated by 1,) 2 (the set designated by 2 and) 3 (the set designated by 3.) ``` Output: `6` This example exactly matches the one in the section 'Premise' (set 1 would be foo, 2 bar, 3 baz, 4 qux). Suppose we want to have the input be like a JS object instead. A possibility is: ``` { 1:[[],[],[3],[4]], 2:[[],[],[],[4]], 3:[[1],[],[],[4]], 4:[[],[],[],[1,2,3]] } ``` ### Example 2 Input: `1 0 0 1 2 1 3 2 1 1 0 0 1 3 3 0 0 0 2 1 2` Output: `4` Please see [here](https://a8h2w5y7.rocketcdn.me/wp-content/uploads/2013/12/euler-diagram-2.jpg). Suppose we want to have the input be like a JS object instead. A possibility is: ``` { 1:[[],[],[2],[3]], 2:[[1],[],[],[3]], 3:[[],[],[],[1,2]] } ``` # Remarks * This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so fewest bytes wins. * [Standard rules](https://codegolf.meta.stackexchange.com/questions/2419/default-for-code-golf-program-function-or-snippet/), [I/O rules](https://codegolf.meta.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods) and [loophole rules](https://codegolf.meta.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default) apply. * If possible, link an online demo of your code. * Please explain your code. [Answer] # MATLAB - 109 Bytes [Try it online](https://tio.run/##lU/baoQwEH33K@Yx6eri5KKrIV9StrDY2AbcWKztQ3/eziTPCy1yJnPmXMB12m/f4TjmrzTtcU2Q/CTuskp@28JMm1v8Z/wJItUo3bxuED2OSxU8nu3pbJ9Eg/IljmpcXBKhHqUvz2kLH/fbLpKIxOolpLf9XQTJNSG9ZhyTeFZgoIOLgxYUwThAWiyYq6xIZqIdeSxYR8YHAkcbLMpfGvnAdX1BsWQUkwba6QBIBTSpTRnQCL3i2bWAA@fhwiIMNC30jqnJR0UODbr7T12bw9jRn5ACjRoeFiKZ@WsUx7DA5RMTdZXHLw) ``` function n=E(s) i=2;k=1;n=0;while i<numel(s) k=mod(k,4)+1;n=n+s(i)*((k==1)-(k==3)/2);i=i+s(i)+1+(k<2);end ``` ungolfed: ``` function n=E(s) % function def, input 2 and output n i=2; % sequence index k=1; % 1=sub,2=equivalent,3=super,4=part n=0; % initialized output while i<numel(s) % Loop through sequence k=mod(k,4)+1; % if k==4, then a new set has started, so back to 1. n=n+s(i)*((k==1)-(k==3)/2); % s(i) represents n,m,p,q % If k==1, then s(i)=q, so add s(i) to n. % If k==3, s(i)=m, so subtract s(i)/2 from n. i=i+s(i)+1+(k<2); % Advance index by (n,m,p,q) and 1 if k==1 (aka k<2) to skip set number definition. end % end ``` Explanation: This may be a naive approach, but from what I see, the only way to have a perimter intersection is when you have a set as a part of another. For super/subsets, there will be no perimeter intersections, since they will be concentric. For sets that match exactly, there will only be one shape that represents two sets, so there are no perimeter crossings between them. Therefore, the only time you can have an overlap is for parts. From there it is simple: every crossing includes two points, since by the nature of overlapping rectangles, there will be two and only two intersections of the perimeters. And since the sets that contain parts of another must reference each other (i.e. if set 1 and 2 overlap, set 1 will have 2 in its part input, and 2 will have 1), there will be 2\*(number of sets that are part of another). However, sets that are exactly equal only produce one shape, so any crossings between this shape and another must be reduced according to the number of sets that are equivalent. Thus, the sum of the number of elements that fall into the "parts" category across all sets equals the number intersections. Mathematically, For \$k\$ sets \$ n\_{crossings} = \displaystyle \sum\_{i=1}^k(q\_i - m\_i/2) \$ ]
[Question] [ [33](https://github.com/TheOnlyMrCat/33) is a simple esolang I created. You may have seen me use it in a few questions. You're not going to be writing a full interpreter. The interpreter you will be writing is for a simplified version of 33. This simplified 33 has two numeric registers: the accumulator and the counter. The accumulator holds all the post-arithmetic values, the counter is where numbers in the program come from. Both registers are initialized to 0. ``` 0-9 | Appends the digit to the counter a | Adds the counter to the accumulator m | Subtracts the counter from the accumulator x | Multiplies the accumulator by the counter d | Divides the accumulator by the counter r | Divides the accumulator by the counter, but stores the remainder in the accumulator z | Sets the counter to 0 c | Swaps the accumulator and counter ----- p | Outputs the current value of the accumulator as an ASCII character o | Outputs the current value of the accumulator as a formatted decimal number i | Outputs a newline character (0x0a) ----- P | Stores the ASCII value of the next character read in the accumulator O | Stores the next integer read into the accumulator ----- n | Skips the next instruction if the accumulator is not 0 N | Skips the next instruction if the accumulator is 0 g | Skips the next instruction if the accumulator is less than or equal to 0 G | Skips the next instruction if the accumulator is greater than 0 h | Skips the next instruction if the accumulator is greater than or equal to 0 H | Skips the next instruction if the accumulator is less than 0 ``` ## Test cases ``` Program / Input -> Output 2o -> 0 25co -> 25 1a0aoi -> 11 (trailing newline) Oo / 42 -> 42 Op / 42 -> * 1cNoo -> 11 no -> 0 Ogo / 2 -> 2 Ogoi / -4 -> (newline) 50a -> (no output) On12co / 12 -> 2 ``` ## Clarifications * The input to your interpreter will be a valid simplified 33 program. * The input may be given in any [acceptable format](https://codegolf.meta.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods). * The output may be given in any acceptable format. * When dividing, truncate any decimal places. * A trailing newline is acceptable, but it must be consistent; as in, if there's an `i` at the end of the program, it should have two trailing newlines. * The accumulator and counter must be able to hold at least a signed byte (-128 to 127) * You may assume that the `p` instruction will never be given when the accumulator has an invalid ASCII character in it. * You may assume the `O` instruction will never be given unless there is a valid integer string (such as `3`, `-54`, `+23`) left in the input. [Answer] # [JavaScript (Node.js)](https://nodejs.org), 264 bytes ``` S=>I=>[...S].map(s=>K?K=0:1/s?C=+(C+s):eval("A*=C;[A,C]=[C,A];K=!A;;K=A;K=A>0;A%=C;K=A<=0;A=A/C|0;I=I.replace(/-?\\d+/,n=>(A=+n,''));K=A>=0;O+=A;K=A<0;A+=C;C=0;;[A]=B(I[0]),I=I.slice(1);O+=`\n`;O+=B([A]);A-=C".split`;`[B(s)[0]*73%378%22]),A=C=K=0,O='',B=Buffer)&&O ``` [Try it online!](https://tio.run/##bZJfb5swFMXf@RRepNR2@U9bdQq9RATtgUUqD3kkSFgUMiZqI0wqTds@e2YT2B4WJMwxPr9zr8Hf2QeT1dD2o83FW31p4HKAKIUodxznUDjvrCcSov12D97Gd@U2AZMkpqSb@oN1ZBXfQxLmsZUUkCdWXIR7@BSHaoz1HXlhvFYGJV9AaYjd5JcXppA6Q913rKqJa2@PxzfTtThEJAaTWxhTOsGKyMxr0IuCTRWUqHeqXAE7kuZeQS0dJbtWBflUu8sjL/VzR5SLhrENycqRfdeOZVjmOyKpwu6fH9YPz5/XQaASYkhAbc7KAGNrB7tz09QDvbvLLmMtx4rJGgEqjUCg@TKCp2qeGD7zmGgnmQnkosdgkv1f6VevQhj8H5ydtC@YZau0/YiMJ48t69wPKm3xA2SUhrE04YxD@07odS8EHzmmTiOGL6z6RrqWqyYj9NNAqBJcjiiX4jxUtYVa3p9HtQGMCzVq45JgR1h/i2XqqrzpZ@sgOVej4ZwoutrpxImsDlPuZmWhr4fs1ZHKx09t84NcC94gUKpbuEFMrd0AsvN4G2iWIgv6H4ttrA9WzUYSeHr5Nw0vfwA "JavaScript (Node.js) – Try It Online") Saved ~20 bytes, thanks to Arnauld's magic integer modulus. [Answer] ### Lua 5.3, 342 bytes Code is provided as a cmdline argument, input is provided via stdin. ``` H=string.char R=io.read A=0 C=0 i=1 s=...while i<=#s do b=s:byte(i)d=H(b)i=i+(({H=A<0,G=A>0,N=A==0,g=A<=0,h=A>=0,n=A~=0})[d]and 2or 1)io.write(({i='\n',o=A|0,p=H(A%255)})[d]or'')A,C=d=='O'and R'n'or d=='P'and R(1):byte()or d=='d'and A//C or d=='r'and A%C or({a=A+C,c=C,m=A-C,x=A*C})[d]or A,b>=48 and b<58 and b-48+C*10or({c=A,z=0})[d]or C end ``` [Answer] # [Julia 1.0](http://julialang.org/), 355 bytes ``` p=print function f(s,a=0,c=0,i=1) for x=s z=findfirst(==(x),"amxdrzcpoiPOnNgGhH0123456789") y=z-9 i<1&&(i=1;continue) z<6 ? a=(+,-,*,÷,%)[z](a,c) : z<7 ? c=0 : z<8 ? ((a,c)=(c,a)) : z<9 ? p(Char(a)) : y<1 ? p(a) : y<2 ? p("\n") : y<3 ? a=0+read(stdin,UInt8) : y<4 ? a=parse(Int,readline()) : y<10 ? (!=,==,<=,>,>=,<)[y-3](a,0)&&(i=0) : c=10c+y-10 end end ``` Program provided as an argument, eg `f("2o")`, input taken from `stdin`. [Try it online!](https://tio.run/##RVDLTsMwELz7K0IkqjV1JDtNXzQLBw7ApeXCqXCwnEeNihMlqZTkx/gAPiw4jwrJq52dWY/X@3U5aynqrssxL7SpSHIxqtKZcRIomUTOlA2NgpIkK5waS9Jiok2U6KKsABFqylz5XUdFq/JMvx3MPn0@vXDhL4Llar3ZupQ02HpbokMxm4G12qnMVNpcYkracOU8OhJhzjx2x35/2C09tp8gmaLOvZXXVrYTDHhjMQwSgmKSjh1by@bwdJIFjFQTioGSY@EPhfth3LFeDA/yeRHLCMoq0oa9v5pqM6rBoOayKGOwLOu7ztrEcLXm/RA3yBBZiOyBPdhMj4236IfmdPgh73sVCq7mjSc4iU3UR5dCSR10wK6W7oZ1n401Jim4fuaOeakmJCSXmR7xYeIO@aSpfTZR5iql/2C6teRyoozwe9su8Ik9PvECIvw/ "Julia 1.0 – Try It Online") ]
[Question] [ **This question already has answers here**: [Find number of ones to get a number using + and \*](/questions/154236/find-number-of-ones-to-get-a-number-using-and) (8 answers) Closed 5 years ago. ### Background Challenge is inspired by [this question](//puzzling.stackexchange.com/questions/73925/the-1-expression). The 1-expression is a formula that in which you add and multiply the number 1 any number of times. Parenthesis is allowed, but concatenating 1's (e.g. 11) is not allowed. Here is an example to get the 1-expression for \$19\$: ``` (1+1)*(1+1)*(1+1+1+1)+1+1+1 = 19 ``` Total number of \$1\$'s is \$11\$ but there is shorter than this: ``` (1+1)*(1+1+1)*(1+1+1)+1 = 19 ``` Total number of \$1\$'s is \$9\$. ### Program Given a positive integer `n` output the minimum 1's to get the 1-expression for `n`. **Notes:** * For reference, the sequence is [A005245](//oeis.org/A005245). * This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so shortest answer in each language wins! ### Test cases ``` Input -> Output | 1-Expression 1 -> 1 | 1 6 -> 5 | (1+1+1)*(1+1) 22 -> 10 | (1+1)*((1+1+1+1+1)*(1+1)+1) 77 -> 14 | (1+1)*(1+1)*((1+1+1)*(1+1+1)*(1+1)+1)+1 214 -> 18 | ((((1+1+1)*(1+1)*(1+1)+1)*(1+1)*(1+1)+1)*(1+1)+1)*(1+1) 2018 -> 23 | (((1+1+1)*(1+1)+1)*(1+1+1)*(1+1+1)*(1+1)*(1+1)*(1+1)*(1+1)+1)*(1+1) ``` [Answer] # [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), ~~76~~ 71 bytes ``` If[#<2,1,Min[#+Reverse@#&/@{#0/@Range[#-1],#0/@Most@Rest@Divisors@#}]]& ``` [Try it online!](https://tio.run/##y00syUjNTSzJTE78H1CUmVcS/d8zLVrZxkjHUMc3My9aWTsotSy1qDjVQVlN36Fa2UDfISgxLz01WlnXMFYHxPXNLy5xCEoFEi6ZZZnF@UXFDsq1sbFq//UdFCBKDQ1iY/8DAA "Wolfram Language (Mathematica) – Try It Online") The recursive approach: define `f[n]` to be the minimum of `f[k]+f[n-k]`over all `k` less than `n`, and `f[d] + f[n/d]`over all divisors of `n` (other than `1` and `n` itself). ]
[Question] [ # Problem Description Given: * a function \$f(a, b, c, d, e) = \frac{a \times b}c + \frac de\$ * an array \$x = [x\_1, x\_2, x\_3, x\_4, ..., x\_n]\$ of non-distinct integers * a target value \$k\$ What is the most efficient way, in terms of worst-case \$n\$, to find 5 distinct indices \$x\_a, x\_b, x\_c, x\_d, x\_e\$ from \$x\$ such that \$f(x[x\_a], x[x\_b], x[x\_c], x[x\_d], x[x\_e]) = k\$? # Example solutions ## Example 1 (single solution): \$x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], k = 5\$ ## Solution 1: \$[1, 4, 2, 9, 3]\$ as \$f(x[1], x[4], x[2], x[9], x[3])\$ evaluates to \$5\$. ## Example 2 (multiple solutions): \$x = [0, -1, 1, -1, 0, -1, 0, 1], k = 0\$ ## Solution 2 (of many solutions): \$[1, 2, 3, 5, 7]\$ OR \$[0, 1, 2, 4, 7]\$ ## Example 3 (no solution): \$x = [0, -1, 1, -1, 0, -1, 0, 1], k = 8\$ ## Solution 3: \$-1\$ (no solution) ## Example 4 (intermediary floats): \$x = [2, 3, 5, 4, 5, 1], k = 2\$ ## Solution 4: \$[2, 3, 5, 4, 5]\$ [Answer] # Python3, O(n^3 log n) ``` from math import gcd from functools import reduce def lcm(x,y): return x//gcd(x,y)*y def label(l): res=[(v,i) for i,v in enumerate(l)] res.sort() return res def sortcombine(l): l.sort() res=[] oldval=None for val,how in l: if val==oldval: res[-1][1].append(how) else: oldval=val res.append((val,[how])) return res def getabc(L,xl): N=len(xl) res=[] lasta=None for ai in range(N): a,al=xl[ai] if a==lasta: continue lasta=a lastb=None for bi in range(ai+1,N): b,bl=xl[bi] if b==lastb: continue lastb=b lastc=None for c,cl in xl: if c in [0,lastc] or cl in [al,bl]: continue lastc=c res.append((L//c*a*b,(al,bl,cl))) return sortcombine(res) def getde(L,xl): res=[] xl.reverse() lastd=None for d,dl in xl: if lastd==d: continue lastd=d laste=None for e,el in xl: if e in [0,laste] or el==dl: continue laste=e res.append((L//e*d,(dl,el))) return sortcombine(res) def solve(l,k): xl=label(l) L=reduce(lcm,[v for v in l if v!=0],1) k*=L abc=getabc(L,xl) de=getde(L,xl) i=0 j=len(de)-1 while i<len(abc) and j>=0: v1,ls1=abc[i] v2,ls2=de[j] s=v1+v2 if s==k: for l1 in ls1: s=set(l1) for l2 in ls2: if s.isdisjoint(l2): return list(l1+l2) i+=1 j-=1 elif s<k: i+=1 else: j-=1 return None ``` [Try it online!](https://tio.run/##lVTbcpswEH33V9A3ZMsXkaZNM1G/wJMfYHgQaB3LkcGDMCFf764EGGHcTsqMwdrbObva3dNntS/yh8tlVxbH4CiqfaCOp6KsgrdMzpxwd86zqii06TUlyHMGs5mEXaCzY9jQT/I8C/ApoTqXedCs1@jt5PPPzk6koEN9tTM8DmuqSLArykDROlB5APn5CKWoAO2S3m5lEDIkfniUtkGtKiuOqcrhGlqPHRCnDVVoWQvNX4sc3NniooDuiw@LrVtv@6idVXDeegzyLmC8ZEnMkpU4nSCXIfqTqwloA2OHDhZ/t3H6AKFlEWOYhNzP8g0qkWbhljZ9jq9cQx7i8TZJLUwlxjkKZdMrRf4G4SsZyAmKtBodC5X4mQvOXZBxFlmRVyo/w1XYAonROR2Ae/DUAxdqwajPwD4pTR2L1GPRMUlbJunY4S6bgUE6kWVjVj2zjGbacmv0ND6CZ1YXb6iLkATWwZnHeFepTqY@f@U18Mgmcr8Ltut1NhfzlIYOAumRcT/4zY6O5NocEvze8Lqh0asSaigNdONgechxe0gqJ3VQu86Syy@0geRydIZpGwCFu8VGIPAKDa7QgKMn9X/cOnCY/aOqMJc0lBopfKmgptA1bhP63tWz0bzfXe685e36C3Hz0bhu94jbIG5xfOObhLLW9H3Ot@4Pji/3p9gJJXDv8pxI8Y37Htx8SyBL5s4fe6WxUC9WikFIIHIZHH7zzVClmlFtGEdt7I1SHaE04hLiwyA0vGaLOvKv23D@/jyZEc1cXoZNL8NwA1WoGZlonGPUOkb358QCrpSRyhwKlWOYiNw39C5LK2PxFmg7bqEFZyPBYekJQFusl5vcRj7TlX2N0EG7dr6cSku17Q7sV0Yj@kC/00f6g/6kT/RXQh@xvW6slgwN8bVpXyyhm68YPd0aWaxHh4baiJDLHw "Python 3 – Try It Online") Multiply the equation by the LCM of the x values to avoid floating point or fractions. Find all possible values of `ab/c` (using `ab=ba` but that's only for a factor of 1/2) and `d/e`, sort them and try to add them to the wanted result. The sorting means we don't have to try all combinations. There are O(n^3) possible values for `ab/c`, sorting them gives the `log`. The other steps are faster than that. The `while` loop may be repeated O(n^3) times, but the case `s==k` can only occur O(n^2) times. If we don't find a solution and stop in this case, then the sizes of `ls1` and `ls2` (number of ways to obtain the corresponding value) must be in O(n) resp. O(1) (except in the case when the value is 0, but luckily that doesn't happen O(n) times). ]
[Question] [ **This question already has answers here**: [Shortest Game of Life](/questions/3434/shortest-game-of-life) (45 answers) Closed 5 years ago. # Description : Given an array of strings representing a grid of cells With the key : `0 = 'dead cell' 1 = 'live cell'` write a function that returns the next iteration following the rules of **Conway's Game of Life** . # Rules 1. Any live cell with fewer than two live neighbours dies, as if caused by underpopulation. - Any live cell with two or three live neighbours lives on to the next generation. - Any live cell with more than three live neighbours dies, as if by overpopulation. - Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction. ### Examples : ``` ["111" , "110" , "100"] //input ["101" , "001" , "110"] // output /** * There will be other tests so no hardcoding. **/ ``` This is code golf shortest code wins. Good luck and have fun [Answer] # [Jelly](https://github.com/DennisMitchell/jelly), ~~40~~ 38 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page) ``` z0j@€0,0µ⁺ṡ3Z€ṡ€3S€€⁺Ḥ L€ḣ@"Ç+e€€7,9,6 ``` A monadic link accepting and returning lists of lists of ones and zeros **[Try it online!](https://tio.run/##y0rNyan8/7/KIMvhUdMaAx2DQ1sfNe56uHOhcRSQD6SBpHEwkAAhoMSOJVw@IIkdix2UDrdrp0JkzHUsdcz@P9y9JQzCP9we@d/A0IDLwMCQy8DQEIgMDYAAxDeAMAyhwkDyvyFUJUgRSBSqE8KACEIAAA "Jelly – Try It Online")** ### How? Cells will be alive in the next generation if: 1. it was alive in a neighbourhood (including itself) of three or four 2. it was dead in a neighbourhood of exactly three Therefore if double the neighbourhood plus "was alive" is seven or nine (case 1) or six (case 2) then it will be alive next generation. (For all other possible cases the sum of double the neighbourhood and "was alive" are *other* integers in the range [0,19]) ``` z0j@€0,0µ⁺ṡ3Z€ṡ€3S€€⁺Ḥ - Link 1, neighbourhood counts * 2: board µ⁺ - perform this monadic link twice: z0 - transpose with filler zero 0,0 - list [0,0] j@€ - join €ach with swapped arguments (surround each with zeros) ṡ3 - all overlapping sub-lists of length three (i.e. lists of rows) Z€ - transpose €ach ṡ€3 - all overlapping sub-lists of €ach of length three (i.e. 3x3 neighbourhoods) S€€⁺ - repeated sum for €ach for €ach (neighbourhood sum) Ḥ - double - Note: the result includes counts of off-board areas filling right L€ḣ@"Ç+e€€7,9,6 - Main link: board Ç - call the last link (1) as a monad (get 2 * neighbourhood counts) L€ - length of each row of the input board ḣ@" - zip with head to index with swapped arguments - (i.e trim the neighbourhood counts to the shape of the input board) + - add (vectorises) (i.e. 2 * neighbourhood count + was alive) 7,9,6 - list = [7,9,6] e€€ - exists in? for €ach for €ach ``` ]
[Question] [ Bobby's booby-trapped safe requires an n-digit code to unlock it. Alex has a probe which can test combinations without typing them onto the safe. The probe responds *Fail* if no individual digit is the same as that in its corresponding position in Bobby's code. Otherwise it responds *Close*, including when all digits are correct. For example, when n=3, if the correct code is 014, then the responses to 099 and 014 are both Close, but the response to 140 is Fail. Your task is to create a program/function that takes n (a positive integer) as input and returns the answer to the following question: *If Alex is following an optimal strategy, in the worst-case scenario, what is the smallest number of attempts needed to guarantee that he knows the correct code, whatever it is?* This is a codegolf challenge, so make your code short. ### Test Cases ``` > 1 9 > 2 11 > 3 13 > 4 16 > 5 19 > 6 21 ``` This is a modified version of a problem from [BMO2 2017](https://bmos.ukmt.org.uk/home/bmo2-2017.pdf). # Explanation of the Test Cases Where n=1, in the worst case, Alex will try eight numbers that all fail. The ninth number he tries will determine what the code is. Therefore, the answer is nine. Where n=2, there are a hundred possible codes. In the worst case, he will fail the first test and narrow it down to eighty-one possible codes. Failing will be the worst case (and so he'll keep failing) until Alex has narrowed it down to nine possible codes (after seven tries). If he fails the next one (on his eighth try), he'll have narrowed it down to four possible codes, so if he gets 'Close', then he'll have five possible codes. We can then deduce that Alex will need at least three more tries to guess the code because five distinct numbers cannot be represented with distinct two-digit binary codes. Thus, Alex needs at least eleven guesses. Now, observe that Alex can find the code in eleven guesses. He can try 00, 11, ..., 99. If he failed nine of those tests, the one he didn't fail is the answer. If he failed eight of them (suppose he didn't fail xx and yy), he can try xy. If xy fails, the code is yx. Otherwise, the code is xy. Therefore, the answer is eleven. Where n=3, Alex will fail every try (like in the n=2 case). He will start with a thousand possible codes, then after his seventh guess he will have narrowed it down to sixty-four possibilities (in the worst case, when Alex has failed all the tests). Then, if Alex doesn't fail the next test, he will have narrowed it down to thirty-seven possibilities. Alex will then need at least six more guesses to find the code. Therefore, Alex needs at least thirteen guesses. In fact, finding the code within thirteen guesses is possible. A possible strategy is to try 000, 111, ..., 999. If nine of these fail, then the code that didn't fail is right. If eight of them failed, then (if xxx and yyy worked and zzz failed) Alex can do xzz, zxz and zzx to check if each digit is x or y. If seven codes failed, then (if xxx, yyy and zzz worked and www failed) Alex can do xww and yww (to find the first digit) and then there is just one more code (could be xyz, xzy, yxz, yzx, zxy or zyx) Alex can try to see what order the last two digits are in (since the code has to be made of three different digits). A similar argument is used for n=4, n=5 and n=6. Note that a different strategy would have to be found for n>10. [Answer] # Mathematica, 125 bytes (121 chars) ``` (f@{_}=0;f@l_:=1+Min[Max[{g=GatherBy[l,vFreeQ[#-v,0]]}~With~If[Length@g<2,∞,f/@g]]&/@R~T~#];f@(T=Tuples)[R=Range@10,#])& ``` [Try it online!](https://tio.run/##y00syUjNTSzJTE78/18jzaE6vtbWwDrNISfeytZQ2zczL9o3sSK6Ot3WHaSwyKkyOken7P2khW5FqamB0cq6ZToGsbG1deGZJRl1nmnRPql56SUZDuk2RjqPOubppOk7pMfGquk7BNWF1CnHAs3VCLENKS3ISS3WjA6yDUrMS091MDTQUY7VVPv/HwA "Wolfram Language (Mathematica) – Try It Online") (it actually does not run the code, just the function pasted into TIO. So because the function is not invoked, it does nothing) This cannot be run even with input `n=1` because it has no memoization or whatever optimization. The ungolfed code below, however, does return `9` for `n=1`. Ungolfed code: ``` n = Input[]; base = 10; Clear@f; f@{_} = 0; f@l_ := f@l = 1 + Min[ Max[ With[{groups = GatherBy[l, v \[Function] FreeQ[# - v, 0]]}, If[Length@groups == 1, Infinity, f /@ groups] ] ] & /@ Tuples[Range@base, n] ] f@Tuples[Range@base, n] ``` This code run in upper bound time `O(2^(10^n poly(n)))`, which is impractical for all `n ≥ 2`. Explanation: Let a number be represented as a list of `n` numbers from 1 to 10. There are `10^n` numbers. Then, the function `f` receive a list of "numbers" `l` (so a 2D list of digits), and return the information "assuming all the possible candidate numbers are in the list `l`, at least how many question are necessary to reduce it to `1` candidate in the worst case?" So the function `f` is defined as: ``` f@{_} = 0; ``` When there is only 1 candidate, we only need to ask 0 more questions. ``` f@l_ := f@l = ``` Memoization (in ungolfed code) to slightly improve performance. ``` 1 + ``` Ask one question. ``` /@ Tuples[Range@base, n] ``` For each possible number (numbers are represent as `n`-tuple of digits, each digit is in the range from `1` to `base` (10)) to be asked, ``` Min[] ``` find the minimum (best strategy) ``` groups = GatherBy[l, v \[Function] FreeQ[# - v, 0]] ``` partition the candidates to 2 groups: one gives the value "Close" when ask this number, and the other gives the value "Fail" when ask this number. ``` If[Length@groups == 1, ``` If all the numbers in the list `l` get to the same answer when test, ``` Infinity ``` return `Infinity` (avoid asking this question, avoid loop forever) ``` , f /@ groups ``` otherwise recursively apply the function `f` to the resulting group ``` Max[] ``` and get the maximum (worst case). ]
[Question] [ # Challenge Given a user's ID, determine how many times they have hit the repcap. # Specs On a given day, let's a user has hit the repcap if they had reputation that wasn't gained due to the repcap. Essentially, on any given day, if the user's net reputation change as calculated without any cap was different from their actual observed reputation change, then they hit the repcap. # Input/Output Input will be a single integer, the user's ID. Output will be a single integer, indicating the number of days for which they had reputation that was "lost". I/O can be in any reasonable format. # Test Cases Feel free to add your own ID and stats here. The brackets indicate which user it is, but that isn't part of the output. Don't include it. ``` input -> output (username) 42649 -> 0 (HyperNeutrino) 41723 -> 7 (Fatalize) 46271 -> 0 (Riker) (This user has obtained 200 rep twice, but never over) ``` [Answer] # JS ES6, 360 bytes ``` f=(i,p=1,d=[])=>fetch(`https://api.stackexchange.com/2.2/users/${i}/reputation?site=codegolf&pagesize=100&page=${p}`).then(x=>x.json()).then(j=>(q=d.concat(j.items),j.has_more?f(i,p+1,q):(r=[],q.map(s=>(r[d=new Date(s.on_date*1000),i=d.getDate()+d.getMonth()*32+d.getYear()*365]?r[i]+=s.reputation_change:r[i]=s.reputation_change)),r.filter(x=>x>200).length))) ``` Call it like `f(user id)`. Returns a promise that resolves with the number of days that rep was lost. Ungolfed: ``` f=(i,p=1,d=[])=>fetch(`https://api.stackexchange.com/2.2/users/${i}/reputation?site=codegolf&pagesize=100&page=${p}&key=kAc8QIHB*IqJDUFcjEF1KA((`).then(x=>x.json()).then(j=>{ return (q=d.concat(j.items), j.has_more? f(i,p+1,q) :(r=[], q.map(s=>(r[d=new Date(s.on_date*1000), i=d.getDate()+d.getMonth()*32+d.getYear()*365]? r[i]+=s.reputation_change :r[i]=s.reputation_change)), r.filter(x=>x>200).length ) ) }); ``` ]
[Question] [ # Backstory I've always found it quite annoying how some numbers in English don't have the same number of syllables even though they have the same number of digits. Example: `seven` has 2 syllables whereas all of the other digits have one (other than `zero`). So, when I'm counting in time to something (like a drill cadence in cadets or in the military), it doesn't sound as nice because you have a random extra syllable. But I appear to have found a solution to this! Instead of counting the regular way, we omit the number `eight`. That way, the second syllable of `seven` carries into where `eight` would have been. So, we get the following: ``` 1 2 3 4 5 6 7 8 9 10 one two three four five six se - ven nine ten ``` But, it's hard to count this way for higher numbers, so I need your help to make a program to help me figure out which numbers to count! # Challenge Details ### Input Input will be given as a single positive integer. For the purposes of this challenge, you may assume that all numbers are less than or equal to `999 999 999 999 999` (`1 quadrillion - 1`) This is because "quadrillion" has a different number of syllables than "million", "billion", and "trillion", and I needed to specify an upper bound somewhere. Since as @HelkaHomba pointed out most languages have a cap at `2^32` which is somewhere around 4 billion, you can use your language's integer bound as the limit (this must be at least 1 million to be considered valid). ### Output Output will be given as a list of integers (to be specified below). The exact formatting will not be specified, but as long as it is easy to see what the list is and it does not contain arbitrary numbers everywhere, it is pretty flexible. ### What's in the list Pretty much, starting from `i = 1`, append `i` to the list. Then, take the number of syllables in `i` (let this be `s`) and omit the next `s - 1` numbers. Keep doing this until `i > n` where `n` is the input. For the purposes of this challenge, assume that the word `and` is never present (so `101` is `one hundred one`). # Test Cases ``` Input -> Output 10 -> 1 2 3 4 5 6 7 9 10 7 -> 1 2 3 4 5 6 7 8 -> 1 2 3 4 5 6 7 25 -> 1 2 3 4 5 6 7 9 10 11 14 16 18 20 22 25 ``` Additionally, since I need to be able to carry this around on a cue card when counting things in time, your program needs to be as short as possible (in bytes)! [Answer] # Mathematica, 117 bytes ``` For[t=1,t<=#,t+=Length[Join@@(#~WordData~"Hyphenation"&/@StringSplit[Echo@t~IntegerName~"Words",{"‐",", "," "}])]]& ``` Pure function taking a nonnegative integer as input; it echoes the appropriate integers to the standard output one at a time. There might well be a shorter implementation in Mathematica, but this is the lazy one :) `t~IntegerName~"Words"` gives the English name of the integer `t`; then `StringSplit[...,{"‐",", "," "}]` divides this name into a list of individual words. (Mathematically annoyingly uses the 3-byte character `‐` (U+2010) for the hyphen in names of integers.) `#~WordData~"Hyphenation"&/@` splits each of those words into a list of its syllables, and `Length[Join@@(...)]` counts these syllables. Thus the function, after initializing `t=1`, loops as long as `t` doesn't exceed the input; each time, it prints `t` and then augments it by the number of syllables in the English name of `t`. In principle, this algorithm works up to 1036–1, at which point the hyphenation dictionary doesn't have an entry for "undecillion". ]
[Question] [ **This question already has answers here**: [Encode a program with the fewest distinct characters possible](/questions/11690/encode-a-program-with-the-fewest-distinct-characters-possible) (10 answers) Closed 7 years ago. We often get [restricted-source](/questions/tagged/restricted-source "show questions tagged 'restricted-source'") questions here on PPCG that favour submitting solutions using only a subset of characters (sufficiently so that there's a tag [printable-ascii](/questions/tagged/printable-ascii "show questions tagged 'printable-ascii'") that identifies a particular subset of those challenges). Wouldn't it be nice if we could automatically cut languages down to a subset of their normal character set? As an example, JavaScript is sometimes translated into a subset known as [JSFuck](http://www.jsfuck.com/) which contains only the characters `[]()!+`. In this challenge, you're aiming to write the equivalent of a JavaScript to JSFuck translator, but without the language restriction: you're compiling a language of your choice down to a subset of its characters (well, bytes, in order to avoid dubious corner cases). ## Clarifications and detailed specification * Call the program you submit program *A*. The input to program *A* will be a string representing a program (program *B*). Its output must also be a string representing a program (program *C*). Program *B* will be in the same language as program *A* (there are no restrictions on how your program reacts to invalid input). Program *C* must also be a program in that language, and have the same behaviour in all cases as program *B* (i.e. if program *C* is given input *X*, it will produce the same probability distribution of outputs as program *A* does). * You may assume that in the case where programs *A* and *B* are distinct, program *B* does not access any files from disk. (In particular, you may assume it does not attempt to read its own source code from disk.). * Although part of the scoring is based on a single test case (program *A* itself), your program must *work* for any input (in the sense of complying with the specification above; that is, any valid program *B* must lead to a corresponding output for program *C*). Optimizing specifically for the test case given is allowed (and might or might not be helpful). * A `cat` implementation is technically speaking a valid answer to this question (as the subsetting of characters is part of the scoring criterion, not the validity criterion), but the scoring is designed so that such a program is unlikely to win. Just as solutions to [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") competitions should make at least an attempt to minimize the number of bytes, solutions to this competition should make at least an attempt to minimize score. (Note that in some languages, `cat` may genuinely work best because the character sets are already small or impossible to shave down further. These solutions are valid, but ideally wouldn't be upvoted.) * You can accept the strings used for your input and output via any reasonable method. * Because languages with no computational ability might potentially lead to trivial solutions due to there being few possible programs to consider, this competition is open only to entries written in [programming languages](http://meta.codegolf.stackexchange.com/a/2073/62131). ## Victory condition Let *S* be the set of bytes that can appear in the outputs *C* of your program (that is: for any valid input *B*, if the corresponding output *C* can potentially contain a byte, then that byte must be an element of *S*). Let *c* be the number of elements in *S*. Now, let *Q* be the result of running your program on itself (i.e. the output *C* produced when *A* and *B* are the same program). Let *b* be the number of bytes in *Q*. (In order to minimize *b* and thus your score, you'll want to keep your program short, as in [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), but also the size of your program's output short, as in [metagolf](/questions/tagged/metagolf "show questions tagged 'metagolf'").) Your score for this [code-challenge](/questions/tagged/code-challenge "show questions tagged 'code-challenge'") is: (*b*+1000)×loge(*c*+1) The winner is the entry with the lowest score. (If there's a tie for first place, the lowest *c* among the tied entries will win; if there's still a tie for first place, the earliest entry among the entries tied for first will win.) Even if you can't win, though, you're encouraged to show off interesting answers (perhaps answers with a particularly low *c*, or in a language other people haven't attempted yet). [Answer] # Brainfuck, (1000 + 133) \* loge(8+1) ~= 2489 Requires an interpreter that has wrapping 8-byte unsigned cells and produces 0 or doesn't change the cell on EOF. ``` ,[>>>--[>-<++++++]>>->->->-------------->-->>>-[++[>]<<->+]--[<]<<<[->+>>+<<<]+>>>>[<[->+<]+>[<-]<[->>[[-]>]-[+<-]+>.>]>>>]-[[+]<-],] ``` A proper brainfuck interpreter ignores any character except `[]<>+-,.`, so we minify the character set by keeping only those characters. For example, giving this as input to the above program produces the above program: ``` ,[>>> prepare array --[>-<++++++]>>->->->-------------->-->>>-[++[>]<<->+]-- [<]<<<[->+>>+<<<]+>>> while number to the right of i >[ <[->+<] move sum of both to the right +>[<-]<[ if sum == 0 clear everything to the right ->>[[-]>] move to the left until we hit 1 -[+<-] output i and move past to stop loop +>.> ] >>> ] -[[+]<-] ,] ``` ]
[Question] [ What tips do you have for golfing in [Wierd](http://catseye.tc/node/Wierd)? Tips for golfing other languages don't seem to help one golf Wierd programs so I'm looking for ideas that can be applied to code golf problems that are specific to Weird - especially if it helps me reduce the size of this answer at ["Hello, World!"](https://codegolf.stackexchange.com/questions/55422/hello-world/69199#69199) [Answer] **Don't forget about self modifying code** As Dennis showed in <https://codegolf.stackexchange.com/a/142785/24812> a loop can be much shorter than a linear program and that there are clever ways to exit the loop. The spec makes it clear that a 90 degree angle allows you to choose one of two different directions at runtime. Dennis showed that you could modify the program at runtime - with amazing results. ]
[Question] [ **[Related](https://codegolf.stackexchange.com/questions/71618/help-recalculate-your-rep)** ## Introduction As it happens, someone put forward the idea that, since PPCG has graduated, up votes on questions should be worth 10 rep. As a result, I started wondering how much rep I would have if it had always been 10 rep. ## Challenge Given **a PPCG user's id as input**, output how much total rep the user would have if question up votes were worth +10. ## Example Calculation I, Beta Decay (user id [30525](https://codegolf.stackexchange.com/users/30525/%CE%B2%CE%B5%CF%84%D1%A7-%CE%9B%D1%94%D2%AB%CE%B1%CE%B3)), have **6744** rep. **3488** of that was earned by posting questions (calculated by subtracting the total rep lost from downvotes from the total rep gained from upvotes). Firstly, we subtract 3488 from 6744, giving us 3256 rep, the amount earned from posting answers. Next, we find out how much I would have earned from 10 rep questions by simply multiplying 3488 by 2, giving us 6976. Finally, we add 3256 and 6976 together to get a final answer of 10232 rep. A simplified method is to take the total, 6744 and add the rep from questions, 3488, giving is 10232 rep. ***For continuity, you must use the method described above*** ## Examples Note that these examples are subject to change and are unlikely to stay current. ### Helka Homba (UID [26997](https://codegolf.stackexchange.com/users/26997/helka-homba)) ``` 71398 ``` ### Martin Ender (UID [8478](https://codegolf.stackexchange.com/users/8478/martin-ender)) ``` 121077 ``` ### Downgoat (UID [40695](https://codegolf.stackexchange.com/users/40695/downgoat)) ``` 21894 ``` ## Rules Internet access is allowed. Similarly, access to the Stack Exchange API is allowed. However, URL shorteners are disallowed. T-SQL entrants using the Stack Exchange Data Explorer are allowed. You also **do not** have to take into account the daily rep cap of 200. ## Winning Shortest code in bytes wins. [Answer] # Python, 336 Bytes Anonymous lambda function, takes a string. Should work, but couldn't test it, because I drained my api quota. (**Warning! Will drain your api quota!)** ``` import requests,re lambda x,u="http://api.stackexchange.com/2.2/users/%s%s?site=codegolf&page=%d":int(re.search('n":\d+',requests.get(u%(x,"",1)).text).group()[3:])+sum([5*len(re.findall(':5,',requests.get(u%(x,"/reputation-history",i)).text))-2*len(re.findall('-2',requests.get(u%(x,"/reputation-history",i)).text))for i in range(99)]) ``` a bit quota-friendlier: ``` import requests,re f=lambda x,u="https://api.stackexchange.com/2.2/users/%s%s?site=codegolf&pagesize=100&page=%d":int(re.search('n":\d+',requests.get(u%(x,"",1)).text).group()[3:])+sum([5*len(re.findall(':5,',requests.get(u%(x,"/reputation-history",i)).text))-2*len(re.findall('-2',requests.get(u%(x,"/reputation-history",i)).text))for i in range(30)]) ``` ]
[Question] [ I wanted to ask this question: [Convert to and from the factorial number system](https://codegolf.stackexchange.com/questions/11735/convert-to-and-from-the-factorial-number-system) but I'm a couple of years too late! So, instead you must convert to and from the ~~lairotcaf~~ backwards-factorial number base! The way it works is that the first digit is always `0`, the maximum value of the next digit is `1`, then `2` and so on. If a number has *n* digits, then each place value is given by *n*!/*i*! where *i* is the digit position starting at `1` on the **left**. The highest digit position is on the **right**. This means that each length uses different place values! There is a unique shortest way to represent each number, which is what you must output for a decimal number input. If an input number starts with a `0`, convert it to decimal. If it starts with any other digit, convert it to the backwards-factorial number base. `0` is both valid and the same number in both bases. In the test data no input value will use, or produce a number with a digit higher than `9`. Note that the shortest representation of some numbers starts with multiple `0`s. ``` Digit position: 1 2 3 4 5 6 Place value: 720 360 120 30 6 1 0 0 2 2 3 3 0 0 240+ 60+ 18+ 3=321 ``` This is the shortest way to represent `321` because removing a digit makes the highest number possible only `119` (5! - 1). Test data: ``` Input: Output: 0 0 1 01 002 2 3 010 011 4 5 012 0012 6 21 0121 0130 24 01000 60 01234 119 001000 120 321 002233 011235 563 0010330 987 4321 0120252 54321 000325536 654321 0010135621 0112351713 2838883 7654321 00102603574 ``` This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so the fewest bytes wins! [Answer] ## ES6, ~~135~~ 108 bytes ``` s=>s<"1"?[...s].reduce((t,d,i)=>+d+t*++i):eval("for(i=j=k=1;i<=s;i*=++j);for(r='';k<=j;k++)r+=s%i/(i/=k)|0") ``` Converting from backwards-factorial is nice and easy. Converting to it... not so nice. I found a 119-byte version that doesn't use `eval`: ``` s=>s<"1"?[...s].reduce((t,d,i)=>+d+t*++i):(i=j=k=1,g=_=>s<i||g(i*=++j),g(),[...Array(j)].map(_=>s%i/(i/=k++)|0).join``) ``` [Answer] # [Perl 6](https://github.com/nxadm/rakudo-pkg), 71 bytes ``` {{/^0/??.comb.reduce(* *-+^++$+*)!![R~] .polymod(+.polymod(1..*)...2)}} ``` [Try it online!](https://tio.run/##PYrLbsIwEEX3fMVFIEhiMDM2j00Lm27YwrIqVUgcqSrBKI9FxOPXUzuRurlz59xzM8Vl3eYNJhne2/t9caLFbicTm59lYdI6MUGEaC5OQoxFFA6Hn4fXF@TNXprcpoH4byxlFEopVfh8tiN82Ou0Ql0a7K/VsSqQ2QKEs0liD22GQ/xbpxY/ZVkbjBQxDcq4QRaMv8PenuHxxiBS0CBmrFxnBeUYa3JB5FPppR/8o7vNkU4l7aylZ6su1/3pBd6wxqZH2/YP "Perl 6 – Try It Online") [Answer] # [Jelly](https://github.com/DennisMitchell/jelly), 36 bytes ``` ⁵R!>³¬TUŻ‘PƤµ³%Ḋ:ṖUŻṾ€ Jṙ1PÐƤḋV€µÇ¬? ``` [Try it online!](https://tio.run/##AVAAr/9qZWxsef//4oG1UiE@wrPCrFRVxbvigJhQxqTCtcKzJeG4ijrhuZZVxbvhub7igqwKSuG5mTFQw5DGpOG4i1bigqzCtcOHwqw/////NDMyMQ "Jelly – Try It Online") ### How it works ``` ⁵R!>³¬TUŻ‘PƤµ³%Ḋ:ṖUŻṾ€ Aux. link (monad). Integer -> string ⁵R! [1..10]! >³¬T All indices of above <= input UŻ‘ Reverse, prepend 0, increment PƤ Product of each prefix µ Re-focus on the above ³%Ḋ:Ṗ Input % (next base value) // (own base value) UŻṾ€ Reverse, prepend zero, map each digit to string Jṙ1PÐƤḋV€µÇ¬? Main link (monad). String -> integer || Integer -> string µÇ¬? If input is string, apply the link on the left; otherwise, apply the aux. link Jṙ1 List of indices rotated once to the left PÐƤ Product of each suffix ḋV€ Convert each input char to digit, and dot product with above ``` Uses some tricks from [my own Jelly answer for factorial base challenge](https://codegolf.stackexchange.com/a/175834/78410). ]
[Question] [ The [PGP Word List](https://en.wikipedia.org/wiki/PGP_word_list) is a set of 512 English words for verbally communicating strings of bytes, such as authentication codes or hashes. It is used in secure VoIP software as well as in some other important applications, such as the [DNSSEC Root KSK Ceremonies](https://www.iana.org/dnssec/ceremonies) held four times a year. It consists of 256 two-syllable words and 256 three-syllable words. Bytes at even offsets become two-syllable words, while bytes at odd offsets become three-syllable words. This protects against transposition of adjacent words, repetition of a word, or omission of a word. The two subsets are kept as alphabetical lists and numbered accordingly, so a null byte (hex 00) becomes "aardvark" at an even offset and "adroitness" at an odd offset. Likewise, the words for hex FF are "Zulu" and "Yucatan" respectively. --- Write a complete program to encode a sequence of bytes (represented as pairs of hex digits) as a sequence of words from the PGP Word List. Because the program is to be run on a secure, air-gapped computer, and USB drives are a security risk, the program should be as short as possible to facilitate manual entry. (The length of each program is measured in bytes, because if I were to use the complicated keystroke formula I came up with, this specification would be twice as long as it is now.) ## Input format The program must accept a string of hex digits as either a single line of input or a command-line argument. You may assume the following: * There are no spaces or other separators between hex digits. * The number of hex digits is between 2 and 128 inclusive. * The number of hex digits is even. * Digits A-F are either all lowercase or all uppercase (if the required letter case is documented). Example input: `9030e74b` ## Output format The program must print a corresponding line of words from the PGP Word List. Adjacent words must be separated by a single space. However, case of the letters within the words may differ from that shown in the PGP Word List. Example output: `peachy commando transit disable` ## Restrictions The program must not rely on any external copy of the PGP Word List, including any data known to be largely derived from the list that may be present in a system file or library. ## Test cases A [TSV file](https://gist.github.com/plstand/56b7f2dea977d83b1f93) is provided. In each line, column 1 contains the input (as lowercase hex digits), and column 2 contains the corresponding output. More test cases may be added if necessary. [Answer] # PHP – 3302 bytes This solution uses a `gzcompress`ed string of uppercase space-delimited PGP words, e.g. `AARDVARK ABSURD ACCRUE...WOODLARK ZULU`. ``` <?php $f='explode';$g='gzuncompress';$h='base64_decode';$a[]=$f(' ',$g($h('eNollVli5CAMRK/CVWSMbWJAhKU9zv0PMk/0R6jqsGgrySJt/0i7nWx9tt2J920GILPsLR4DmIn1OFL04BWEYzGn0LuTdGpiTfqwauFSzuqk+BgKh2tN/KuN2PnR+7RXxxUKN0cS1r8RvNtkUy2Av48Y0r7Yg2eQ8qNuC5JjOcE9Sa5guOInGPZH/oFHwx7HQzoEU1toPRDUFlOK653YzUDi3R/+YOpv2YORZ2jzF2yGLdpZzdt6RPXuFy+6rXEnds40gk+RMI3dE1da9Pe7TODC4aWzNxt+Y2SOYVbn358d8CFbTvwlsSVLLGyM0MDg7S1/xR4SoLdFC9a6thvpy2TLE715lIz1Hv0Xm2qGBSn2iEX2KMF7xW/WjFkfIKwNq/ps6wkLatenGCv3C+hzqHKiTR/FTsxM/XYj3ZLl54bNXfq1qUW0k41NEcdOAJdQgF3Pbjf2JmcJwzAWOQOEs8dMbmmKqPb2jW7HCPW1o7Pcobh9ViVN+4OTlgb2FuymvnCeS38hntfY0J2j7EqxFz6syaQWmtUhdC8V+OcDLoU3nJYtI4MwL3fICvMw+c7hjiRnVfQKGSsRR3pHk+oOUjVmC0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zz2Kq//tUhh5ougnLEeEOfgvd3Gb7v0nfpsuyOGjWQfJstQFoQQQD0UV1LGhOEdAMiVJuZd4l+tagZL3fBazZYVNZwRTK82x3CHPKBCPX9j7WtDwo1+7yN83S1IfY2J4QzhEqeGnWuP/Rw35/Q0Q0b1SWtM8Bm+UInr3K6IzgoMRqWITUrjeT7qLgBFZ6whCjpDBnkEsallfHFW/2CyjQh0CX050x3nQ3r02dWk1EvUI/V4RGuxuAd5Z2wWCYnf8lj861+ew7jZP65ll8Sp7SQQ8HZEi6XHLTn0rqhvAKAWhTy8p8SHsxljyc83N6BhUCnFNJa4d71aPAgh1uZy0yzmxH490Phfl6PT/JfOE+SGp7Bo6T8BwHcnAI=')));$f=1;foreach(str_split($argv[1],2)as$b)echo$a[$f^=1][hexdec($b)].' ';echo"\n"; ``` Save as `decode.php` and run with argument in the command line, e.g. ``` $ php decode.php 9030e74b PEACHY COMMANDO TRANSIT DISABLE ``` Because the specification mentioned ease of text entry, I guessed full 8-bit was a no-no and restricted to regular ASCII and base 64 for the encoding. The PGP word lists on their own, no spaces, with one word running into the next, is 3919 characters long, so this solution represents a savings of 15.74%. Another solution formatting the strings with mixed case `AardvarkAbsurdAccrue...WoodlarkZulu` and splitting based on the case, while retaining the delimiter, turns out to be longer at 3433 bytes, even though I'm removing 510 spaces from the PGP word list source! ``` <?php $f='preg_split';$g='/([A-Z])/';$h='gzuncompress';$i='base64_decode';foreach([$f($g,$h($i('eNodVdF246oO/TY7STNzejvNmLRd67zJWDGMAXFA1ON+/d30IUixQWhvbckDleWTyjbMtZVlsLY0HmzkYSn+ocPSgg6PR/BWB8e0DD4GrnUIq4QhBNmHIImHGGVI1nPSIefAQ1Ffdai1IZA6TnXQQHX4UrYjzSJpJLs9PIelOztyGCn9kZEp+rSOvASKeWR2/pNh6k5/R34UXLCMHB5UdeRSuWyjD8H3474iaECwP/iNQexGC8PuKsW6MTSePbZJnPthka06BBoLdvvqxgJswSfuztbyWLzdjh4Xdz4sVR5bm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gMy/eA9/spc91Qk33EiMAELi0FyNMm73k5Hzda6ScOcNilmBdE7ARzEKkvWaQo+grGVIB9FcGbnrlR44Lzle1Bw+YGW+gM+C+jaJvKWLswJ9xYSpvFl2jb7VchSOG0IFcPOGAVbRpsVDcgWbGXT5AD5gag6bFGM2jOxNUiA1gTeDAgdESYz4gd8j3wAnUQq0PbEvT7u79tCbwYSQ4oR1GDAdMVtiiPxejKIzbNNy4XGs8gBxoFuhxgPSXa9TVeDANWFSDc0efQRJ4X5A0QtalSzBRMhh3aAAr/Z/qwivtSH43ghwZuvUuHDELZsavT5Ijzz6eU4Hjr8PRSdDXgP28yBoWMy0DytFTXEaBe8J3iu7gkcCAOEJ0qeKbuyzrd4XK7ITSUnyo9idXCAR6olINoj5hLKOO7RTAE6/oCXNwmQYnRXoYNCet2BE74XrkCzDuofmFT4XL+MO1U6kzJxffqc6zi/7Op2X0otGnmmcJ4psN4ipjO0PEWg0KPOMlmL0hZ9SMZlx/1guFoGcw0bxtZ518BD/OmMjc6xlzQRwgHB8g7Wx4B5ATThomNHD15zbzw1xM7xjm3p13FADE4f7dAV1Vy3taXiaYa8MPqpTxld8Z3+egGHXDBwXX+AcNhAD9hwt/0A+xATOOPgTUUPvwlxbBP7R5JT9dIam0T58/4P/nKFNGQ+OnhBET6BMvyM9T+tmWIH/ZH/zGZH8rwFP6Dz6ZaRE=')),-1,3)]as$p){$t=[];for($i=0;$i<count($p);$i+=2)$t[]=$p[$i].$p[$i+1];$a[]=$t;}$f=1;foreach(str_split($argv[1],2)as$b)echo$a[$f^=1][hexdec($b)].' ';echo"\n"; ``` Save as `decode.php` and run the same way: ``` $ php decode.php 9030e74b Peachy Commando Transit Disable ``` As well, using `aARDVARKaBSURDaCCRUE...wOODLARKzULU` as the source text, the solution still comes out at 3433 bytes: ``` <?php $f='preg_split';$g='/([a-z])/';$h='gzuncompress';$i='base64_decode';foreach([$f($g,$h($i('eNodVdt227oO/DaIhEVWIMHNS1TlTbIdtycnjSs5yVr76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$b)echo$a[$f^=1][hexdec($b)].' ';echo"\n"; ``` Sample: ``` $ php decode.php 9030e74b pEACHY cOMMANDO tRANSIT dISABLE ``` What's likely going on here are inefficiencies in the compression algorithm arising from using mixed case. Good to know - you learn something every day... ]
[Question] [ We all already crossed the look and say sequence, and where asked to guess the next element. As its name tells it very well, you just have to say what you see : ``` 1 1 1 2 1 1 2 1 1 1 1 1 2 2 1 3 1 2 2 1 1 ... ``` But, what if we had to use a different base to describe it? You could count it in base 3 as this [OEIS squence](https://oeis.org/A001388) do. You could even do it in whatever base you want! That will be your job in this challenge. ## Goal Your have to write a program or a function that will accept two integers as input, either by STDIN or as function arguments. The first one will be the base `b` you have to work in, the second one will be the number `n` of elements to output. As this sequence never changes for `b>=4`, you will assume `0<b<5`. The only restriction you have is to NOT use any base-converison built-in :). The original sequence (in base 10) is the sequence [A005150](https://oeis.org/A005150). It cannot be constructed simply by using a formula, so you can help yourself with the different implementations present on the sequence's page. ## Sample output Here are the first 10 elements for each b ``` for b=1: 1 11 111 1111 11111 111111 1111111 11111111 111111111 1111111111 for b=2: 1 11 101 111011 11110101 100110111011 111001011011110101 111100111010110100110111011 100110011110111010110111001011011110101 1110010110010011011110111010110111100111010110100110111011 for b=3: 1 11 21 1211 111221 1012211 1110112221 101102110211 111021101221101221 1011012211011222110112211 for b=4: 1 11 21 1211 111221 312211 13112211 1113212221 311312113211 132113111221131221 ``` You can use whatever formating you want as long it is readable (so you could output it in Python-like lists, separated by commas/newline...). This is code-golf, so the shortest code in byte wins. Have fun ! [Answer] # Pyth, 34 bytes ``` L?gbQ+y/bQ%bQ]bjms`Md.usyMsrN8tE]1 ``` [Try it online!](http://pyth.herokuapp.com/?code=L%3FgbQ%2By%2FbQ%25bQ]bjms%60Md.usyMsrN8tE]1&input=3%0A10&debug=0) ]
[Question] [ **This question already has answers here**: [Zigzagify a String](/questions/55593/zigzagify-a-string) (10 answers) Closed 8 years ago. Write a program that generates a sequence of numbers starting with zero and then 100 random integers between -9 and 9. That sequence will be displayed like a roller coaster. Any increasing number in the sequence will go up and any decreasing number will go down Sample sequence: ``` 0 1 8 5 -1 -5 7 1 3 3 4 6 9 -2 ... ``` Sample output ``` 9 8 6 -2... 1 5 4 0 -1 7 3 3 -5 1 ``` This is code golf. Shortest code in bytes by November 5th wins. [Answer] # Ruby, 167 bytes ``` l={} y=p=n=0 101.times{|i| d/=d.abs if(d=n-p)!=0 l[y-=d]||=Array.new 101," "*4 l[y][i]=n.to_s.ljust 4 p,n=n,rand(18)-9} puts l.sort_by(&:first).map(&:last).map(&:join) ``` First time golfing Ruby, so I'm sure I'm missing something. ]
[Question] [ The goal of this challenge is to implement a storage and retrieval pattern that will most quickly determine if a set of recurrence definitions fall within a date range. Consider the schema: `Event -|--has one or many--<- Schedules` Schedule is a record defining a recurrence, e.g. (these are just samples) * Monthly, every month * Monthly, first Wednesday of every month * Monthly, Monday and Tuesday of every 3rd month from start date * Monthly, Monday and Tuesday of every May, June and July * Weekly, every Tuesday through Saturday * Weekly, Monday every 3rd week from start date The types of supported schedules should be (definitive list): **Pattern** 1. Daily 2. Weekly, every [X] weeks on [set of 1-7 days] 3. Monthly, every [Xth] day of every [Y] months 4. Monthly, every [1st-4th-last] [weekday] of every [Y] months 5. Yearly, on [month] [day of month] every [X] years 6. Yearly, on [1st-4th-last] [weekday] of [month] 7. Monthly, every [Xth] day of [set of months] 8. Monthly, every [1st-4th-last] [weekday] of [set of months] **End date** (Start is always a single date) 1. No end date (for simplicity, you could omit this since we can use year 2999) 2. A single date 3. A number of [X] occurences To win, the answer must define: 1. Table schema 2. SQL query or function (any RBDMS) to test a date range against the entire table Determination of winner: 1. test data: 10,000 events will be created randomly; 20 special test cases will be added as well 2. test case: 100 random date ranges (min:1 max:32 days), 5 fixed date ranges (min:1 max:32 days) 3. test execution: Test will be repeated 3 times 4. proof of correctness: All answers must be correct 6: speed: Quickest execution wins Example test case: ``` --------- Schedules --------- Event A: Weekly, Every Monday starting 1 Jan 2015 Event A: Monthly, Every [31st] day of every [1] month starting 1 Jan 2015 (e.g. Event A is a backup schedule) Event B: Monthly, Every [1st] day of every [1] month starting 1 Jan 2015 Event C: Yearly, Every [10th] day of every [3] months starting 1 Jan 2015 (e.g. quarterly summary report) Event D: Weekly, Every [Tue,Wed,Fri] starting 1 Jan 2015 Event E: Weekly, Every [Tue,Wed,Fri] starting 1 Jan 2015 ending 3 July 2015 (assume no end dates unless stated) ----- Query ----- What events occur between 1 July 2015 and 31 July 2015 (inclusive) --------------- Expected Result --------------- (shown in date order) 01 July: Event B 01 July: Event E 03 July: Event E << last occurrence due to end date 06 July: Event A 10 July: Event C 13 July: Event A 20 July: Event A 27 July: Event A 31 July: Event A (a lot of event D's every Tue/Wed/Fri in July) ``` [Answer] # T-SQL Given that the speed of the query is the most important part of the challenge, I have created a table that is an expansion of the events so that each event has all of it's occurrence dates stored. The query is then just a simple `WHERE DATE BETWEEN` query and will perform extremely quickly. This of course is built towards the query speed and not for the maintenance of the data. Building and populating the table will take a fair amount of time depending on the amount of dates that the events cover. The parsing of the records assume the the Days and Months are all abbreviated ## View A simple view to give a list of numbers up to 1e8 ``` CREATE View [dbo].[Tally] as WITH E1(N) AS (select 1 from (values (1),(1),(1),(1),(1),(1),(1),(1),(1),(1))dt(n)), E2(N) AS (SELECT 1 FROM E1 a, E1 b), --10E+2 or 100 rows E4(N) AS (SELECT 1 FROM E2 a, E2 b), --10E+4 or 10,000 rows max E8(N) AS (SELECT 1 FROM E4 a, E4 b), --10E+4 or 100,000,000 rows max cteTally(N) AS ( SELECT ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) FROM E4 ) SELECT N FROM cteTally; GO ``` ## Functions A couple of inline table functions to parse and expand the Event input records. ``` CREATE FUNCTION ParseEvent (@InputString VARCHAR(1000)) RETURNS TABLE AS RETURN -- Parse rest of the components SELECT EventName, ScheduleType, StartDate, EndDate, CASE WHEN ScheduleType = 'Weekly' THEN SUBSTRING(Remainder,7,CHARINDEX(' weeks ',Remainder)-7) END WeeklyX, CASE WHEN ScheduleType = 'Weekly' THEN SUBSTRING(Remainder,CHARINDEX(' on ',Remainder)+4,999) END WeeklyDays, CASE WHEN ScheduleType = 'Monthly' and Remainder like '% day of %' THEN SUBSTRING(Remainder,7,CHARINDEX(' day ',Remainder)-7) END MonthlyDayOfMonth, CASE WHEN ScheduleType = 'Monthly' and Remainder like '% of every %' THEN REPLACE(SUBSTRING(Remainder,CHARINDEX(' of every',Remainder)+10,999),' months','') END MonthlyX, -- Y CASE WHEN ScheduleType = 'Monthly' and Remainder not like '% of every %' THEN SUBSTRING(Remainder,CHARINDEX(' of ',Remainder)+4,999) END MonthlyMonths, CASE WHEN ScheduleType = 'Yearly' THEN CASE WHEN Remainder like '% every %' THEN SUBSTRING(Remainder,4,CHARINDEX(' ',Remainder,4)-4) -- length 3 ? ELSE SUBSTRING(Remainder,CHARINDEX(' of ',Remainder)+4,999) -- Right(Remainder,3) ? END END YearlyMonth, CASE WHEN ScheduleType = 'Yearly' and Remainder like '% every %' THEN SUBSTRING(Remainder,CHARINDEX(' ',Remainder,4)+1,CHARINDEX(' ',Remainder,CHARINDEX(' ',Remainder,4)+1)-CHARINDEX(' ',Remainder,4)-1) -- Can we assume 3 ?? END YearlyDayOfMonth, CASE WHEN ScheduleType = 'Yearly' and Remainder like '% every %' THEN REPLACE(SUBSTRING(Remainder,CHARINDEX(' every ',Remainder)+7,9999),' years','') END YearlyX, CASE WHEN (ScheduleType = 'Yearly' and Remainder like '% of %') OR (ScheduleType = 'Monthly' and remainder not like '% day %') THEN SUBSTRING(Remainder,CHARINDEX(' ',Remainder)+1,CHARINDEX(' of ',Remainder)-CHARINDEX(' ',Remainder)-1) END WeekDayOccurance FROM -- Get the start and end dates (SELECT EventName, ScheduleType, CAST(SUBSTRING(Remainder, CHARINDEX('Starting',Remainder)+9, IIF(CHARINDEX('Ending',Remainder)=0,999,CHARINDEX('Ending',Remainder) - (CHARINDEX('Starting',Remainder) + 9))) AS DATE) StartDate, CAST(IIF(CHARINDEX('Ending',Remainder)=0,'31 Dec 2999',SUBSTRING(Remainder, CHARINDEX('Ending',Remainder) + 7, 999)) AS DATE) EndDate, RTRIM(STUFF(Remainder,CHARINDEX('Starting',Remainder),999,'')) Remainder FROM -- Get the schedule type (SELECT EventName, LTRIM(LEFT(Remainder, CHARINDEX(',',Remainder)-1)) ScheduleType, LTRIM(STUFF(Remainder, 1, CHARINDEX(',',Remainder), '')) Remainder FROM -- Get the event name ( SELECT LEFT(@InputString, CHARINDEX(':',@InputString)-1) EventName, STUFF(@InputString, 1, CHARINDEX(':',REPLACE(@InputString,'Daily ','Daily, ')), '') Remainder ) EventName ) ScheduleType ) StartEndDate ; GO CREATE FUNCTION ExpandEvent ( @EventName VARCHAR(100), @ScheduleType VARCHAR(20), @StartDate DATE, @EndDate DATE, @WeeklyX VARCHAR(10), @WeeklyDays VARCHAR(50), @MonthlyDayOfMonth VARCHAR(10), @MonthlyX VARCHAR(10), @MonthlyMonths VARCHAR(50), @YearlyMonth VARCHAR(50), @YearlyDayOfMonth VARCHAR(10), @YearlyX VARCHAR(10), @WeekDayOccurance VARCHAR(50) ) RETURNS TABLE RETURN WITH AllDays AS ( SELECT * FROM ( SELECT DENSE_RANK() OVER (ORDER BY DATEPART(year,D)) - 1 YearCount ,DENSE_RANK() OVER (ORDER BY DATEPART(year,D), DATEPART(month,D)) - 1 MonthCount ,DENSE_RANK() OVER (ORDER BY DATEPART(year,D), DATEPART(week,D)) - 1 WeekCount ,CASE DATEPART(month,D) WHEN 1 THEN 'Jan' WHEN 2 THEN 'Feb' WHEN 3 THEN 'Mar' WHEN 4 THEN 'Apr' WHEN 5 THEN 'May' WHEN 6 THEN 'Jun' WHEN 7 THEN 'Jul' WHEN 8 THEN 'Aug' WHEN 9 THEN 'Sep' WHEN 10 THEN 'Oct' WHEN 11 THEN 'Nov' WHEN 12 THEN 'Dec' END MonthAbrev ,DATEPART(day,D) MonthDay ,CASE DATEPART(weekday,D) WHEN 1 THEN 'Sun' WHEN 2 THEN 'Mon' WHEN 3 THEN 'Tue' WHEN 4 THEN 'Wed' WHEN 5 THEN 'Thu' WHEN 6 THEN 'Fri' ELSE 'Sat' END DayOfWeek ,DENSE_RANK() OVER (PARTITION BY DATEPART(year,D),DATEPART(month,D),DATEPART(weekday,D) ORDER BY D) DayWeekMonthOccurance ,COUNT(*) OVER (PARTITION BY DATEPART(year,D),DATEPART(month,D),DATEPART(weekday,D)) DayWeekMonthMax ,D FROM ( SELECT DATEADD(day,t.N,@StartDate) D FROM (SELECT TOP(DATEDIFF(day,@StartDate,@EndDate) + 1) N - 1 N FROM Tally) T ) Days ) AllDays ) SELECT @EventName E, D FROM AllDays WHERE (@ScheduleType = 'Daily') OR (WeekCount % @WeeklyX = 0 and @weeklyDays like '%'+DayofWeek+'%' and @ScheduleType = 'Weekly') OR (MonthDay = SUBSTRING(@MonthlyDayOfMonth,1,LEN(@MonthlyDayOfMonth)-2) and MonthCount % @MonthlyX = 0 and @ScheduleType = 'Monthly' and @MonthlyDayOfMonth IS NOT NULL and @MonthlyX IS NOT NULL) OR (MonthDay = SUBSTRING(@MonthlyDayOfMonth,1,LEN(@MonthlyDayOfMonth)-2) and @MonthlyMonths like '%'+MonthAbrev+'%' and @ScheduleType = 'Monthly' and @MonthlyDayOfMonth IS NOT NULL and @MonthlyMonths IS NOT NULL OR (DayWeekMonthOccurance = CASE WHEN @WeekDayOccurance like 'last %' THEN DayWeekMonthMax ELSE LEFT(@WeekDayOccurance,1) END and DayOfWeek = RIGHT(@WeekDayOccurance,3) and MonthCount % @MonthlyX = 0 and @ScheduleType = 'Monthly' and @WeekDayOccurance IS NOT NULL and @MonthlyX IS NOT NULL) OR (DayWeekMonthOccurance = CASE WHEN @WeekDayOccurance like 'last %' THEN DayWeekMonthMax ELSE LEFT(@WeekDayOccurance,1) END and DayOfWeek = RIGHT(@WeekDayOccurance,3) and @MonthlyMonths like '%'+MonthAbrev+'%' and @ScheduleType = 'Monthly' and @WeekDayOccurance IS NOT NULL and @MonthlyMonths IS NOT NULL) OR (@YearlyMonth like '%'+MonthAbrev+'%' and MonthDay = @YearlyDayOfMonth and YearCount % @YearlyX = 0 and @ScheduleType = 'Yearly' and @YearlyMonth IS NOT NULL and @YearlyDayOfMonth IS NOT NULL and @YearlyX IS NOT NULL) OR (DayWeekMonthOccurance = CASE WHEN @WeekDayOccurance like 'last %' THEN DayWeekMonthMax ELSE LEFT(@WeekDayOccurance,1) END and DayOfWeek = RIGHT(@WeekDayOccurance,3) and @YearlyMonth like '%'+MonthAbrev+'%' and @ScheduleType = 'Yearly' and @WeekDayOccurance IS NOT NULL and @YearlyMonth IS NOT NULL) ; GO ``` ## Table The search table for the event dates ``` CREATE TABLE SearchEvents ( ID BIGINT IDENTITY (1,1) NOT NULL PRIMARY KEY, EventName VARCHAR(100) NOT NULL, EventDate DATE NOT NULL ); ``` ## Table Population An example of populating the SearchEvents table. This example shows each of the Event patterns that are acceptable and will likely error if that format is deviated from. Note the Months and Days are abbreviated. The ending date is not required and will default to 31 Dec 2999. But I would suggest that it is set. ``` INSERT INTO SearchEvents SELECT Ex.E, Ex.D FROM (VALUES ('Event A: Daily, Starting 3 Jun 2010 Ending 5 Dec 2020') ,('Event B: Weekly, every 2 weeks on Mon,Tue Starting 3 Jun 2010 Ending 5 Dec 2020') ,('Event C: Monthly, every 2nd day of every 2 months Starting 3 Jun 2010 Ending 5 Dec 2020') ,('Event D: Monthly, every 3rd day of Jun,Jul,Dec,Jan Starting 3 Jun 2010 Ending 5 Dec 2020') ,('Event E: Monthly, every 2nd Tue of every 3 months Starting 3 Jun 2010 Ending 5 Dec 2020') ,('Event F: Monthly, every last Wed of Jun,Nov Starting 3 Jun 2010 Ending 5 Dec 2020') ,('Event B: Yearly, on Jun 10 every 1 years Starting 3 Jun 2010 Ending 5 Dec 2020') ,('Event H: Yearly, on 3rd Wed of Jun Starting 3 Jun 2010 Ending 5 Dec 2020') )A(S) CROSS APPLY (SELECT * FROM parseEvent(S)) P CROSS APPLY (SELECT * FROM ExpandEvent( EventName, ScheduleType, StartDate, EndDate, WeeklyX, WeeklyDays, MonthlyDayOfMonth, MonthlyX, MonthlyMonths, YearlyMonth, YearlyDayOfMonth, YearlyX, WeekDayOccurance )) Ex ``` ## Indexing The important part, indexing of the date field ``` CREATE INDEX SE_EventDate_IDX ON SearchEvents(EventDate) INCLUDE (EventName); GO ``` ## Query An example query ``` SELECT EventName, EventDate FROM SearchEvents WHERE EventDate BETWEEN CAST('1 Jan 2015' AS DATE) AND CAST('31 Dec 2015' AS DATE) ORDER BY EventDate ``` This executed with the following stats on my machine. 1 years worth of events from ten years of data. ``` SQL Server parse and compile time: CPU time = 0 ms, elapsed time = 1 ms. (435 row(s) affected) Table 'SearchEvents'. Scan count 1, logical reads 5, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. SQL Server Execution Times: CPU time = 0 ms, elapsed time = 98 ms. SQL Server parse and compile time: CPU time = 0 ms, elapsed time = 0 ms. SQL Server Execution Times: CPU time = 0 ms, elapsed time = 0 ms. ``` ]