April 15, 2014 A possible future usage of user-defined slicing | ||||
---|---|---|---|---|
| ||||
This is an useless post. Sometimes it's good to look at code in other languages, and see their idioms, or to have an idea where to go. This is a simple problem, it just asks to simulate some rotations of a Rubik's Cube: http://www.reddit.com/r/dailyprogrammer/comments/22k8hu/492014_challenge_157_intermediate_puzzle_cube/ This is a correct Python solution: http://www.reddit.com/r/dailyprogrammer/comments/22k8hu/492014_challenge_157_intermediate_puzzle_cube/cgod926 I presume that with Kenji patch (https://github.com/D-Programming-Language/dmd/pull/443 ) we can define multiple $ and slices in user-defined code, to implement a good Matrix, D code like this could be used: http://dpaste.dzfl.pl/970ca3b204c8 Bye, bearophile |
Copyright © 1999-2021 by the D Language Foundation