Fun Stuff > CLIKC

A programming thread!

<< < (10/37) > >>

Pilchard123:
I'm sure I've seen that before, but I don't remember the content.

hedgie:

--- Quote from: snalin on 23 Apr 2014, 13:45 ---
Seriously, if I was hiring a Java developer, and asked them "what's your IDE of choice", and got a text editor as a reply, I'd show them the door. The amount of speed and utility you get from any IDE is just incredible when compared to plain text, and I'd know I would be getting a lot more and better work from somebody who knew how to use proper tools. Maybe I'd accepts a pretty heavily pimped Vim, but that's a stretch.

--- End quote ---
There's probably an emacs command for that.

Masterpiece:
I'm still struggling with Haskell. We're supposed to write a recursive function called "proceed", which should increment the amount of days you specified on the day you gave the function. The code I wrote so far looks like this:


--- Code: ---data Day = Mon | Tue | Wed | Thu | Fri | Sat | Sun
deriving (Enum, Eq, Show)

next :: Day -> Day
next Sun = Mon
next d = succ d


proceed :: Day -> Int -> Day
proceed x y | y == 1     = next x
            | otherwise  = proceed x (y-1)
--- End code ---

The problem I'm having is that no matter what Int I give the proceed function, it will still give the 'next' value of the day entered. So, what I'm expecting to happen is this:

--- Code: ---*Main> proceed Mon 9
Wed

--- End code ---
and what's happening is this:

--- Code: ---*Main> proceed Mon 9
Tue

--- End code ---

This frustrates me.

Masterpiece:
Fixed it. It made no sense to only call 'next' once. That was my mistake.


--- Code: ---proceed :: Day -> Int -> Day
proceed x y | y > 0 = proceed (next x) (y-1)
            | y <= 0 = x
--- End code ---

dr. nervioso:
The only code i have extensive experience with is Python. I really like using it to do graphic design like stuff. It's a lot more fun than Photoshop.

Also, can anyone suggest a good way to learn Java? I have to learn at least some of the language in the next month so I will know what's going on in my next CS class

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version