Example – spin the wheel

This example simulates a game in which the user spins a wheel with random speed. The wheel rotates slower and slower until it stops. Then the user can spin it again, from the previous stop position, as shown in the following diagram:

Let's proceed to the first part of code of the Main method in the Program class:

CircularLinkedList<string> categories = new CircularLinkedList<string>(); categories.AddLast("Sport"); categories.AddLast("Culture"); categories.AddLast("History"); categories.AddLast("Geography"); categories.AddLast("People"); categories.AddLast("Technology"); categories.AddLast("Nature"); categories.AddLast("Science"); ...

Get C# Data Structures and Algorithms now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.