Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Anusha Singh
Courses Plus Student 22,106 Points[SOLVED] Please help!!!!
Here's the question - Let's get in some practice creating enums with raw values. Declare an enum named Compass with a raw value of type Int.
Give the enum 4 members: north, south, east and west and assign them default raw values.
Assign the enum value Compass.south to a constant named direction, by using a raw value with Compass' initializer method.
I typed out the code, well, whatever it asked me to do but it still says that I have missed something out
enum Compass : Int {
case north
case south
case east
case west
}
let direction = Compass.south.rawValue
3 Answers

Anusha Singh
Courses Plus Student 22,106 PointsHey Akshay, As the challenge says o create an enum of a raw value of type Int, its default raw values are also going to be Ints. Here's the code I used to pass the challenge:
enum Compass : Int {
case north = 1
case south = 2
case east = 3
case west = 4
}
let value = 2
let direction = Compass(rawValue: value)

Anusha Singh
Courses Plus Student 22,106 PointsI figured it out!! Thanks for helping!
akshaythakur
31,777 PointsHi Anusha,
I am stuck @ same problem.....please help
akshaythakur
31,777 Pointsakshaythakur
31,777 PointsThanks a lot (dhyana vaad aapka)
Anusha Singh
Courses Plus Student 22,106 PointsAnusha Singh
Courses Plus Student 22,106 PointsWelcome : ) Treehouse par Hindi dekh kar kushi hui....