This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Watch this video to see how I crafted this sorting algorithm: | |
| // https://youtu.be/Mh_1V95n0j0 | |
| function bDQnoAh__3IqiQ6w(MbK$rQXzgSJSupW) { | |
| return Math.floor(Math.random() * MbK$rQXzgSJSupW); | |
| } | |
| function E68sk_VA6aM3y9ts1DO4S(xAAyxUzJedDW4t_) { | |
| for (let SUiFIpIVdvQFCy = 1; SUiFIpIVdvQFCy < xAAyxUzJedDW4t_.length; SUiFIpIVdvQFCy++) { | |
| if (xAAyxUzJedDW4t_[SUiFIpIVdvQFCy-1] > xAAyxUzJedDW4t_[SUiFIpIVdvQFCy]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Made in 37 seconds | |
| # Watch this video to see how: | |
| # https://youtu.be/uvKG7uki_N8 | |
| # Play the extended HTML port on Itch: | |
| # https://nns2009.itch.io/guess-with-lies | |
| from random import randrange | |
| n = randrange(10000) | |
| while True: | |
| v = int(input()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Watch https://youtu.be/KvYzGsz5vHA to see how I coded this with some commentary | |
| let add = (n, v) => !n ? { v } : { ...n, [v < n.v]: add(n[v < n.v], v) } | |
| let flat = n => !n ? [] : [...flat(n[!0]), n.v, ...flat(n[!1])] | |
| let bsort = vs => flat(vs.reduce(add, null)) | |
| // 182 characters with nice formatting | |
| let add=(n,v)=>!n?{v}:{...n,[v<n.v]:add(n[v<n.v],v)} | |
| let flat=n=>!n?[]:[...flat(n[!0]),n.v,...flat(n[!1])] | |
| let bsort=vs=>flat(vs.reduce(add,null)) |
NewerOlder