24 ms·
TicTacToe in SQL (Postgres)
- garyclarke27 8y agoCool, I’m curious, does anyone know - which langauge would use fewest number of characters, to create TicTacToe?
- anonu 8y agok
- deleted 8y ago[deleted]
- arghwhat 8y agoThe special purpose language, TicTacToe-inator, where an input of zero length compiles to TicTacToe.
- hnarn 8y agoI love how cynical this comment is. You're absolutely right though, every language solves a specific problem, so it's kind of arbitrary what language does something in the shortest amount of letters.
- wild_preference 8y agoWell, this is trivia about our craft that we enjoy talking about and comparing. Consider that nobody is impressed by the TicTacToe DSL if it appeared among C, JS, and other languages we use. Not very cynical. It’d be a “heh” and move on. If you want to be critical, it’s the stupid statements and interpretations people make from the comparisons. Like the Perl guy coming out of the woodwork to point out how we’re a bunch of idiots for not seeing the beauty of the Perl oneliner. Or how it demostates that Go doesn’t need generics and how JS web coders aren’t real developers.
- barbecue_sauce 8y agor/programmingcirclejerk?
- darekkay 8y agoThere are code golfs for at least checking the game states: - https://codegolf.stackexchange.com/questions/32383/determine-win-in-tictactoe https://codegolf.stackexchange.com/questions/32383/determine... - https://stackoverflow.com/questions/2245801/code-golf-tic-tac-toe https://stackoverflow.com/questions/2245801/code-golf-tic-ta...
- jedimastert 8y agoYou could probably add an extension to HQ9+[0] that'll get the job done pretty quick [0]: https://esolangs.org/wiki/HQ9%2B https://esolangs.org/wiki/HQ9%2B
- segmondy 8y agoAPL/J
- qubax 8y agoThe "higher" the language and more declarative. "Higher" because all the lower level work of data structures/etc are taken care of or even embedded into the language itself. "Declarative" because in declarative languages you just express what you want, not how to get it ( which imperative languages have to do ). Compare "SELECT * FROM TBL1" with what you would need to do in an imperative language. You would have to open data connection, set up data structures and have to specify step by step what you want. Even if you had libraries doing most of the work, you would still need to specify step by step what you want to be done. Whereas with SQL, you specify what you want and let the language/interpreter/optimizer/engine figure out the rest. That's only considering "number of characters". Now if you measured "executable size" or memory size or any other impact, it might be different.
- akerro 8y agoThis Single SQL Query Solved My Sudoku In Seconds http://oraclemine.com/sql-query-solved-sudoku-seconds/ http://oraclemine.com/sql-query-solved-sudoku-seconds/
- dominotw 8y agooriginal link: https://technology.amis.nl/2009/10/13/oracle-rdbms-11gr2-solving-a-sudoku-using-recursive-subquery-factoring/ https://technology.amis.nl/2009/10/13/oracle-rdbms-11gr2-sol... Why are you linking it to a third party site.
- sgarman 8y agoNot OP but my guess; OP remembered they read an article about this, googled it, found the first result and linked it. Third party site is winning the SEO game.
- testbox001 8y agoYes true, even this third-party site has given credit to the original link.
- netcraft 8y agoHere is a version you can play with online: https://dbfiddle.uk/?rdbms=postgres_11&fiddle=71940aadda50f55bfede87606cd1dc2c https://dbfiddle.uk/?rdbms=postgres_11&fiddle=71940aadda50f5...
- teej 8y agoTaking it to the next level - Injecting a Chess Engine into Amazon Redshift http://www.michaelburge.us/2017/09/10/injecting-shellcode-to-speed-up-amazon-redshift.html http://www.michaelburge.us/2017/09/10/injecting-shellcode-to...
- deleted 8y ago[deleted]
- truth_seeker 8y agoYep. Recursive CTE are most bad ass feature of SQL which makes it do stuff that LISP and Haskell does but more declaratively