On Saturday, 24 February 2018 at 09:48:13 UTC, Joel wrote:
I'm trying some code for practice, but it isn't working
properly - it prints just one number when printing in reverse.
[snip]
Thanks guys. And I got it working with 'if (head is tail)' etc.
On 02/24/2018 11:26 AM, TheFlyingFiddle wrote:
On Saturday, 24 February 2018 at 09:48:13 UTC, Joel wrote:
[...]
void popFront() { head = head.next; if (head !is null) head.prev =
null; }
void popBack() { tail = tail.prev; if (tail !is null) tail.next = null; }
Head and tail will point to th
On Saturday, 24 February 2018 at 09:48:13 UTC, Joel wrote:
I'm trying some code for practice, but it isn't working
properly - it prints just one number when printing in reverse.
[...]
the first writeln destroys the range via popFront, I think. As if
you comment it out, the writeln with retro
On Saturday, 24 February 2018 at 09:48:13 UTC, Joel wrote:
I'm trying some code for practice, but it isn't working
properly - it prints just one number when printing in reverse.
I think the problem is here:
void popFront() { head = head.next; if (head !is null)
head.prev = null; }
void pop
I'm trying some code for practice, but it isn't working properly
- it prints just one number when printing in reverse.
'''
void main() {
import std.stdio, std.algorithm, std.range, std.conv;
struct List(T) {
class Node {
T value;