0

I am extremely new to lisp. I have the following piece of code that I obtained online:

http://goo.gl/tXReiS

I essentially need to run a sample game using this code. I installed Steel Bank Common Lisp and did (load "file.lisp") and I was able to compile the code. However, I am unable to run a sample game. I don't really understand what is going on. Can someone please help me with this.

gran_profaci
  • 8,087
  • 15
  • 66
  • 99
  • It looks like you can use `#'iso-random-player` for other arguments, but I haven't tried it. A side note: if you are trying to learn from this game, it doesn't look like a really good coding example. If you aren't after a specific game, but just an example game to learn, I'd recommend this: http://reversi.b9.com/ as a good start. –  Oct 30 '13 at 05:56
  • 1
    @gran_profaci: Ignore Havenarg,common lisp is an fantastic language and worth your time if you want to learn. The access you have to the language internals is pretty much unparalleled and the techniques you will learn can have direct benefits to all of your programming life. This is obviously my own opinion but in 2 years I have gone from knowing nothing about lisp to having learnt loads more architecture and written my first glsl compiler, this in turn got me a job at a startup working in my dream field. I have found no language that I felt as at home or as productive in. So do what YOU want! – Baggers Oct 30 '13 at 08:42

2 Answers2

2

There are testing functions down the bottom

; (iso3-test-me 3 #'player-xxx 100000 iso-map3)
; (iso3-test-me 3 #'player-xxx 10000 iso-map3)
; (iso3-test-me 3 #'player-xxx 10000 iso-board-small)

What happens if you compile the rest of the code and then run one of these?

[EDIT] Ok scratch that, this code does not appear to be complete. I changed the definitions of the following so that the first part of the file will compile.

(defparameter first-round? t)
(defparameter verbose t)

But then you will find that on compiling that the (get-time-ms) function is missing. Is this something you have been asked to get working or are you just interested in lisp games?

If it is a uni assignment then perhaps the missing function is in an earlier piece of code you have been given?

If you are just interested in lisp games then welcome! There are a few of us and we are often around the #lispgames channel on freenode. Also I would recommend having a look at xelf (used to be called blocky) check out the video here, the graphics in the example are very basic but the techniques he uses are very cool.

I'm also working on cepl, but it is in a very alpha state right now so probably not a good place to start unless you are quite proficient with common lisp already.

Hope this helps!

Baggers
  • 3,183
  • 20
  • 31
  • I've been asked to get this working. Actually... I have to get it working for a hobby project of my friends. – gran_profaci Oct 30 '13 at 10:14
  • Ok so you need to work out how the time should be collected. Id probably set a parameter with the current system time and then each call to get-time-ms should get the difference between the param and now and then set the param to the current time. have a look at http://www.lispworks.com/documentation/HyperSpec/Body/f_get_in.htm for ideas. – Baggers Oct 30 '13 at 10:45
  • Hmmm... let me get this right : So once you do the load, does that compile the code as well? – gran_profaci Oct 30 '13 at 13:28
  • The answer to that is slightly implementation dependent http://www.lispworks.com/documentation/HyperSpec/Body/f_load.htm For your purposes, yes. My general workflow is to make a quicklisp project for my code and then recompile functions as I develop them. Here are a couple of videos on quicklisp (and emacs), and setting up projects http://www.youtube.com/playlist?list=PL2VAYZE_4wRIoHsU5cEBIxCYcbHzy4Ypj – Baggers Oct 30 '13 at 13:35
0

Check the function isogame - this seems to be the entry point to the game in question. You need to provide correct arguments to it though.

Alexander L. Belikoff
  • 5,698
  • 1
  • 25
  • 31
  • What might the inputs be? I know the first one is time. The second one seems to require a list for some reason. How does that work? – gran_profaci Oct 30 '13 at 04:41