Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

Activity for Moshi‭

Type On... Excerpt Status Date
Edit Post #286288 Initial revision about 2 years ago
Answer A: Looping counter
[JavaScript (Node.js)], 31 bytes ```javascript for(i='';;console.log(i+='')); ``` Try it online!
(more)
about 2 years ago
Edit Post #286162 Initial revision about 2 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)
about 2 years ago
Edit Post #285880 Post edited:
Added scoring tag (for the leaderboard)
about 2 years ago
Suggested Edit Post #285880 Suggested edit:
Added scoring tag (for the leaderboard)
(more)
helpful about 2 years ago
Edit Post #285511 Initial revision over 2 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)
over 2 years ago
Comment Post #285479 39 bytes with ```python lambda n:all(n%i**2for i in range(2,n)) ```
(more)
over 2 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)
over 2 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)
over 2 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
over 2 years ago
Edit Post #284903 Post undeleted over 2 years ago
Edit Post #284903 Post edited:
(Pasted a previous wrong version)
over 2 years ago
Edit Post #284903 Post deleted over 2 years ago
Edit Post #284903 Initial revision over 2 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)
over 2 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)
over 2 years ago
Comment Post #283791 ```python from numpy.linalg import det ```
(more)
over 2 years ago
Comment Post #284611 https://tio.run/##XY1PS8QwEMXP6acYFlxS2w0i7MVuVvAgePC0R/UQ@4@JbVqS6dIg/ew1tYvCHuY93syPeVqd1U4XXzO2fWcJdMhiIGxENZicsDPiNov64bPBHPJGOQevCg18R@yydKQo2LnDAtpw4ieyaOq3D1C2dvFCsid8vnw7vBgq69KmV36ECiTMfEx9vDuOUvrt1kt5/7h/GBM/M5aFN1VngaMhwMDeZcEOsA@WJGvNP6BXQK@A/gPYyTsqW9ENJALcKuKbmwISCCKDvJtNCpiCTqESqu8bz5c...
(more)
over 2 years ago
Edit Post #284516 Post edited:
over 2 years ago
Edit Post #284572 Post edited:
over 2 years ago
Comment Post #284572 @#8056 This is why I should look things up more often orz
(more)
over 2 years ago
Edit Post #284572 Initial revision over 2 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 2 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 2 years ago
Edit Post #284516 Initial revision over 2 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 2 years ago
Edit Post #284496 Initial revision over 2 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 2 years ago
Edit Post #284461 Post edited:
Added explanation
over 2 years ago
Edit Post #284461 Initial revision over 2 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 2 years ago
Edit Post #284427 Post edited:
over 2 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 2 years ago
Edit Post #284427 Initial revision over 2 years ago
Answer A: Convert integer to English
[Sclipting], (UTF-16) 454 406 bytes Yes. ``` 塊匱❸곴김分倘標⓶❹演긆륩닆롩닶밎併鈉不終⓷곴김剩❶갾밈分倘⓷標⓷❺演긇끨닷녳눖멤併鈉⓶不終갾밈剩❶뉀分倘⓷標⓷❺演긆둵닦끲뉖밄併鈉⓶不終뉀剩⓶글會⓶倘❷長是긆굮뉂밀⓶終긇끨늗긠뉦뭵댢걦늖눠댶땸긇꽥덦녮긆녩뉶될닦땮뉐❷굀瀰是❶銅긂건덶녮融壹坼❸겠分掘덇밉⓸겠剩倘껐⓶⓹逆⓸終終긆뭮뉒건덶묠덆둲뉖넠뉦뭵댢걦늗뉥긇꽩뎂걳뉗뉥닢걥늖덨덂걮늖멥긇끥닢걥닆녶뉖먠덇덥닇뉥融壹坼❷掘⓶곀大是덆녥닠終不梴沒뎦녲닰終終終演 ``` Explanation ```text 塊 Function ...
(more)
over 2 years ago
Edit Post #284391 Post edited:
Removed irrelevant struck-through text, corrected LaTeX, fixed typo
over 2 years ago
Comment Post #284396 https://tio.run/##XZJfb4MgFMWf209xQ9JEtNvQdn9qh19k8aGxOEkcNnDb4ZZ99u4C68t4gMMv5xxRPM04TGZzvR5VD33meb1cOMnY/iDZl7ITTEYBfk6Ag1UK@ulsodcXBU57cOqiDCj9PiAYHYxhO0aKn2okGw7aoqJ9SCah@7hSQVqDPapYFEToioJKDM6pZKaKOFN@jun5Lzun5JxyM7t3p1FjxvcoSyHEvpOY43Khe/CN7Gon6T0fHjpeMPjQ46gnw/Z@JbubBWtXSAYsz1zDGC@iHYOdvtXZHcw...
(more)
over 2 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 2 years ago
Comment Post #284396 https://tio.run/##RZLRTsMgFIav16c4kpiUdirtdGad7EVML7aOWpKOLnCqrcZnnwfYIhecw5///6CU84zdYFaXy1G10KYTr5KFk4xt95J9KzvAYBTg1wDYWaWgHUYLrf5U4PQETn0qA0p/dAhGe6Nf9kHFL9WTDTttUdHaJ2Oj21AJEKu3hy6AfONZvmGP7txrTPn2IBkBDc4ROBMuzMSaA2m@cuZImSNj/ic0shBZtt4iVSGShW5h2smmcpK@@ump4TmDk@57PRi2ne5lc7Ng5XLJgGWpu6OL4Xnwo/f...
(more)
over 2 years ago
Suggested Edit Post #284391 Suggested edit:
Removed irrelevant struck-through text, corrected LaTeX, fixed typo
(more)
helpful over 2 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 2 years ago
Edit Post #283428 Post edited:
Fixed a bug
over 2 years ago
Edit Post #284335 Initial revision over 2 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 2 years ago
Comment Post #284334 Use `[*range(2,n+1)]` instead of `list(range(2,n+1))`
(more)
over 2 years ago
Edit Post #284317 Post edited:
over 2 years ago
Edit Post #284317 Initial revision over 2 years ago
Answer A: The Ludic Numbers
[Sclipting], (UTF-16) 58 52 bytes ```text 가匱❸增平갠下氫終要鈮貶⓶梴감⓶上❸乘殲終終并鈮掘增 ``` Gives the nth ludic number, 0-indexed. ```text 가 Start list of Ludics with 0 匱❹增平갠下氫終 Create a list of numbers from 2 to n+1 squared 要 While the list is truthy 鈮 Retrieve the Ludic number x (the first elem...
(more)
over 2 years ago