Activity for Moshi
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Comment | Post #286354 |
By default, [yes](https://codegolf.codidact.com/posts/282784/282787#answer-282787) (more) |
— | almost 3 years ago |
Comment | Post #286301 |
If your function never runs, then clearly it won't have a runtime error :) (more) |
— | almost 3 years ago |
Edit | Post #286288 | Initial revision | — | almost 3 years ago |
Answer | — |
A: Looping counter [JavaScript (Node.js)], 31 bytes ```javascript for(i='';;console.log(i+='')); ``` Try it online! (more) |
— | almost 3 years ago |
Edit | Post #286162 | Initial revision | — | almost 3 years ago |
Answer | — |
A: Can you give me half? [Python 3], 5 unique bytes, 28 total ```python (()==())/((()==())+(()==())) ``` `(`, `)`, `=`, `/`, `+` Uses `(()==())` to get `True` with only 3 unique characters, as well as making the later grouping of `(...+...)` free. Try it online! (more) |
— | almost 3 years ago |
Edit | Post #285880 |
Post edited: Added scoring tag (for the leaderboard) |
— | almost 3 years ago |
Suggested Edit | Post #285880 |
Suggested edit: Added scoring tag (for the leaderboard) (more) |
helpful | almost 3 years ago |
Edit | Post #285511 | Initial revision | — | about 3 years ago |
Answer | — |
A: Determine whether an integer is square-free Japt, 6 bytes -1 byte thanks to Shaggy! k ä¦ e Try it First time doing Japt so this is probably pretty bad. Just factorizes and checks that there are no duplicate factors. (more) |
— | about 3 years ago |
Comment | Post #285479 |
39 bytes with
```python
lambda n:all(n%i**2for i in range(2,n))
``` (more) |
— | about 3 years ago |
Comment | Post #284994 |
```ruby
->p,s{s<2?"Hole in one":%w[Albatross Eagle Birdie Par Bogey Double Triple][s-p+3]+(s-p>1?" bogey":'')}
``` (more) |
— | about 3 years ago |
Comment | Post #284952 |
```C
f(p,s){return(char*[8]){"Hole in one","Albatross","Eagle","Birdie","Par","Bogey","Double bogey","Triple bogey"}[--s?s+5-p:0];}
``` (more) |
— | about 3 years ago |
Edit | Post #284903 |
Post edited: I'm stupid and missed the part where it said I could use a list instead of string. Cut out the converter function |
— | about 3 years ago |
Edit | Post #284903 | Post undeleted | — | about 3 years ago |
Edit | Post #284903 |
Post edited: (Pasted a previous wrong version) |
— | about 3 years ago |
Edit | Post #284903 | Post deleted | — | about 3 years ago |
Edit | Post #284903 | Initial revision | — | about 3 years ago |
Answer | — |
A: Implement Rule 110 [JavaScript (Node.js)], 160 bytes (r,d,n,l=r.length,s=d.length,p=(n,i)=>n?"01110110"[4p(--n,i-1)+2p(n,i)+1p(n,i+1)]:i>=0&i[...Array(4l+s+2n)].map((,i)=>p(n,i-2l-n)) Try it online! (more) |
— | about 3 years ago |
Comment | Post #284852 |
> Par can be a value between 3 to 5
You won't ever get `6 2` if I'm reading it right. (more) |
— | about 3 years ago |
Comment | Post #283791 |
```python
from numpy.linalg import det
``` (more) |
— | about 3 years ago |
Comment | Post #284611 |
https://tio.run/##XY1PS8QwEMXP6acYFlxS2w0i7MVuVvAgePC0R/UQ@4@JbVqS6dIg/ew1tYvCHuY93syPeVqd1U4XXzO2fWcJdMhiIGxENZicsDPiNov64bPBHPJGOQevCg18R@yydKQo2LnDAtpw4ieyaOq3D1C2dvFCsid8vnw7vBgq69KmV36ECiTMfEx9vDuOUvrt1kt5/7h/GBM/M5aFN1VngaMhwMDeZcEOsA@WJGvNP6BXQK@A/gPYyTsqW9ENJALcKuKbmwISCCKDvJtNCpiCTqESqu8bz5c... (more) |
— | over 3 years ago |
Edit | Post #284516 |
Post edited: |
— | over 3 years ago |
Edit | Post #284572 |
Post edited: |
— | over 3 years ago |
Comment | Post #284572 |
@#8056 This is why I should look things up more often orz (more) |
— | over 3 years ago |
Edit | Post #284572 | Initial revision | — | over 3 years ago |
Article | — |
Solve a Word Search! Challenge Given a two-dimensional array of characters and a list of words, output the location of the words. Words can go either vertically top to bottom, horizontally left to right, or diagonally top-left to bottom-right. Output can be given as either the start and endpoint of the array or the... (more) |
— | over 3 years ago |
Comment | Post #284522 |
```python
lambda a,b,c:[p for p in"+ - * // % **".split()if(p in'+-**'or b)and eval(f"{a}{p}{b}")==c]
``` (more) |
— | over 3 years ago |
Edit | Post #284516 | Initial revision | — | over 3 years ago |
Answer | — |
A: Run-length encode a byte sequence [JavaScript (Node.js)], 101 82 bytes -19 bytes thanks to Shaggy! ```javascript x=>x.replace(/(..)\1{0,62}/g,(c,g)=>c>'c'||c[5]?(192+c.length/2).toString(16)+g:c) ``` Try it online! Everything can be solved with regexes. Takes input and outputs as hex strings. (more) |
— | over 3 years ago |
Edit | Post #284496 | Initial revision | — | over 3 years ago |
Answer | — |
A: Convert integer to English [Python 3], 399 bytes ``` def f(n): if n'') if n>19:s+=b[n//10+17]+'ty'+'-'((n:=n%10)>0) return s+b[n-1]+'teen'(n>12) ``` Try it online! (more) |
— | over 3 years ago |
Edit | Post #284461 |
Post edited: Added explanation |
— | over 3 years ago |
Edit | Post #284461 | Initial revision | — | over 3 years ago |
Answer | — |
A: Find good coalitions [Python 3], 191 bytes ```python lambda p:[c for c in chain([C(p,r)for r in range(len(p)+1)])if all(all(i==(sum(p.values())/2>=sum(p[n]for n in d))for d in C(c,len(c)-i))for i in[0,1])] from itertools import;C=combinations ``` Try it online! Yay for quadruple nested list compressions... ... (more) |
— | over 3 years ago |
Edit | Post #284427 |
Post edited: |
— | over 3 years ago |
Comment | Post #284391 |
I'm curious why you reverted the LaTeX correction. Did you really mean to not put commas in the number? (more) |
— | over 3 years ago |
Edit | Post #284427 | Initial revision | — | over 3 years ago |
Answer | — |
A: Convert integer to English [Sclipting], (UTF-16) 454 406 bytes Yes. ``` 塊匱❸곴김分倘標⓶❹演긆륩닆롩닶밎併鈉不終⓷곴김剩❶갾밈分倘⓷標⓷❺演긇끨닷녳눖멤併鈉⓶不終갾밈剩❶뉀分倘⓷標⓷❺演긆둵닦끲뉖밄併鈉⓶不終뉀剩⓶글會⓶倘❷長是긆굮뉂밀⓶終긇끨늗긠뉦뭵댢걦늖눠댶땸긇꽥덦녮긆녩뉶될닦땮뉐❷굀瀰是❶銅긂건덶녮融壹坼❸겠分掘덇밉⓸겠剩倘껐⓶⓹逆⓸終終긆뭮뉒건덶묠덆둲뉖넠뉦뭵댢걦늗뉥긇꽩뎂걳뉗뉥닢걥늖덨덂걮늖멥긇끥닢걥닆녶뉖먠덇덥닇뉥融壹坼❷掘⓶곀大是덆녥닠終不梴沒뎦녲닰終終終演 ``` Explanation ```text 塊 Function ... (more) |
— | over 3 years ago |
Edit | Post #284391 |
Post edited: Removed irrelevant struck-through text, corrected LaTeX, fixed typo |
— | over 3 years ago |
Comment | Post #284396 |
https://tio.run/##XZJfb4MgFMWf209xQ9JEtNvQdn9qh19k8aGxOEkcNnDb4ZZ99u4C68t4gMMv5xxRPM04TGZzvR5VD33meb1cOMnY/iDZl7ITTEYBfk6Ag1UK@ulsodcXBU57cOqiDCj9PiAYHYxhO0aKn2okGw7aoqJ9SCah@7hSQVqDPapYFEToioJKDM6pZKaKOFN@jun5Lzun5JxyM7t3p1FjxvcoSyHEvpOY43Khe/CN7Gon6T0fHjpeMPjQ46gnw/Z@JbubBWtXSAYsz1zDGC@iHYOdvtXZHcw... (more) |
— | over 3 years ago |
Comment | Post #284104 |
62 bytes:
```
for i in range(1,101):print("Fizz"*(i%3<1)+"Buzz"*(i%5<1)or i)
``` (more) |
— | over 3 years ago |
Comment | Post #284396 |
https://tio.run/##RZLRTsMgFIav16c4kpiUdirtdGad7EVML7aOWpKOLnCqrcZnnwfYIhecw5///6CU84zdYFaXy1G10KYTr5KFk4xt95J9KzvAYBTg1wDYWaWgHUYLrf5U4PQETn0qA0p/dAhGe6Nf9kHFL9WTDTttUdHaJ2Oj21AJEKu3hy6AfONZvmGP7txrTPn2IBkBDc4ROBMuzMSaA2m@cuZImSNj/ic0shBZtt4iVSGShW5h2smmcpK@@ump4TmDk@57PRi2ne5lc7Ng5XLJgGWpu6OL4Xnwo/f... (more) |
— | over 3 years ago |
Suggested Edit | Post #284391 |
Suggested edit: Removed irrelevant struck-through text, corrected LaTeX, fixed typo (more) |
helpful | over 3 years ago |
Comment | Post #284397 |
```
{"vi": 20, "Emacs": 20}
→ []
```
If I read the specification correctly, then shouldn't the correct coalition be `[["vi": 20, "Emacs": 20]]`? (more) |
— | over 3 years ago |
Edit | Post #283428 |
Post edited: Fixed a bug |
— | over 3 years ago |
Edit | Post #284335 | Initial revision | — | over 3 years ago |
Answer | — |
A: Tips for golfing in Python Use the unpacking `` instead of `list` If you want to convert an iterator/generator into a list, use the `` operator instead of using the `list` function, e.g. Instead of ```python list(iterable) ``` Use ```python [iterable] ``` (more) |
— | over 3 years ago |
Comment | Post #284334 |
Use `[*range(2,n+1)]` instead of `list(range(2,n+1))` (more) |
— | over 3 years ago |
Edit | Post #284317 |
Post edited: |
— | over 3 years ago |