Arc Forumnew | comments | leaders | submit | mwijns's commentslogin
1 point by mwijns 4958 days ago | link | parent | on: Small cardgame I created in Arc

I created this small cardgame some time ago. To run it make sure the static content is available, then: (load "families.arc") (fsv)

http://localhost:8080/new

The goal is to clear away all cards. You can only put black cards on red cards in descending order. If you get stuck, click on the stack on the left to get an extra layer of cards. Enjoy!

-----

1 point by akkartik 4958 days ago | link

Nice!

Weird first question but: How many spaces does a tab correspond to in your editor? (Edit: ok I deduced it's 4 spaces.)

Are you aware of with and withs? Is there a reason you prefer nested lets?

http://files.arcfn.com/doc/variables.html#with

-----

2 points by mwijns 4958 days ago | link

I created the game on a holiday without internet access, so I had to find out from the Arc sources how to do things and missed arcfn. Thanks for the hint about with and withs, I'll look into it!

The description above is a bit incomplete by the way: you can also put red cards on black cards and aces in empty spots. It's possible to move multiple cards at once (only if they are ordered) by clicking on the topmost card.

-----

3 points by akkartik 4957 days ago | link

"I created the game on a holiday without internet access, so I had to find out from the Arc sources how to do things and missed arcfn."

That's a great story. Can you elaborate on your experiences with arc? What languages have you programmed in before? What led you to arc? Compared to previous languages what did you like and dislike about arc?

-----

5 points by mwijns 4955 days ago | link

Sure, at my day job I code in C++ and some C#. Paul Grahams essays got me interested in arc, so when it came out I just had to try it. I never got around really creating something with it was still on my laptop that I took with me on a holiday. The card game was taught me by my in-laws and it seemed a nicely sized project to create an arc version of it. At the beginning it felt a bit weird and I was writing very clunky functions, but after a while some patterns seemed to emerge and I could reduce the code size. At the end I was impressed that the whole thing only took around 600 lines of code including test code. I did some functional programming in the past: Erlang, LISP and a bit of Haskell, all just for fun. What I like about arc is that it feels like the only limit is your own brain and not the language. I also like that the implementation of the language is at the same level as the program you're writing. If you feel like changing the language, you can, and quickly try what happens. It takes some time to get used to the form and syntax, though. An additional downside is that C++ and C# start to feel limiting.. You can do a lot with templates and delegates but it feels ugly.

-----

2 points by akkartik 4955 days ago | link

Oh yes, learning lisp has made me more unhappy when working on non-lisps.

"it feels like the only limit is your own brain and not the language."

That's a great way to put it.

Of course, you do eventually run into limits in any language. But arc's gotten several people working on pushing them back. All the implementations at the bottom of https://sites.google.com/site/arclanguagewiki/home are about breaking some limitation or other.

-----

4 points by mwijns 6144 days ago | link | parent | on: Arc's templates: documentation

Thanks a lot for this documentation! I was just trying to figure out how arc templates work the other night (without succes..), this helps to stay motivated using Arc :)

-----

3 points by mwijns 6171 days ago | link | parent | on: Access REPL while serving web pages

You could run the server in a seperate thread with (= mythread (thread asv)). And stop it later on with (break-thread mythread) I guess.

-----