Advertisement

Embedding lisp into c++

Started by July 31, 2002 07:44 AM
4 comments, last by Fonz 22 years, 6 months ago
Hey, Just finishing off a little strategy game i''ve been makeing. I''m up to implementing the ai. (for those who dont know strategy is like tic-tac-toe but you have to get 5 ins a row and the board is very large). I want to implement a mini-max search tree with alpha-beta pruning. The only problem is that I think this would be a better idea in lisp. (Im planning on reducing the search space of the mini-max tree by only allowing the ai to account for moves made in squares adjacent to previously made moves.) does anyone know how i can embed lisp into c++?? cheers, Fonz
You can''t.
Advertisement
hmm are you absolutely positively sure about that???

I''ve heard from good sources that you could..

cheers,
Fonz
You can, the other poster was just being annoying. It''s just a case of how you approach it.

You might want to look into other embedded languages to give you an idea of how they interact with the main C++ codebase.


Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
Check out XLisp and Bob, both by Dave Betz. They''re both interpreters designed to be embedded into C code. XLisp is standard Lisp, and Bob is Lisp with a much more Javaish syntax.

http://www.mv.com/ipusers/xlisper/

If you''re planning to simply embed Lisp into your C++ code, like you can embed assembly with the #asm directive, it''s not gonna be that easy. You''re basically gonna be linking a Lisp interpreter into your code and executing Lisp code externally. If all you''re planning is to add an alpha-beta search tree into your code, you''ll have a much easier time just rewriting the search in C++.

---
John Hattan
The Code Zone
Sweet software for a saturnine world

(my byline from the Gamedev Collection series, which I co-edited) John Hattan has been working steadily in the casual game-space since the TRS-80 days and professionally since 1990. After seeing his small-format games turned down for what turned out to be Tandy's last PC release, he took them independent, eventually releasing them as several discount game-packs through a couple of publishers. The packs are actually still available on store-shelves, although you'll need a keen eye to find them nowadays. He continues to work in the casual game-space as an independent developer, largely working on games in Flash for his website, The Code Zone (www.thecodezone.com). His current scheme is to distribute his games virally on various web-portals and widget platforms. In addition, John writes weekly product reviews and blogs (over ten years old) for www.gamedev.net from his home office where he lives with his wife and daughter in their home in the woods near Lake Grapevine in Texas.

hey thanks,

I''ll probably just do it in c++.

cheers,

This topic is closed to new replies.

Advertisement