Git Product home page Git Product logo

vindinium-swi's Introduction

This is a simple bot for http://vindinium.org/ implemented in SWI-Prolog.

This works with SWI-Prolog 7 or later, with HTTP support installed. For most Linux distributions, this means it is easiest to build SWI-Prolog from source. See http://www.swi-prolog.org/build/ for details.

The main program is contained in a single file, vindinium.pl. Currently, there is a single, "random" bot implemented in randbot.pl. The user key is read from a plain text file containing nothing but the key, called by default userkey (you can change this: see the first line of vindinium.pl).

To run the bot, start SWI-Prolog in the directory with the three files, and load the program:

$ swipl
Welcome to SWI-Prolog (Multi-threaded, 64 bits, Version 7.1.23)
Copyright (c) 1990-2014 University of Amsterdam, VU Amsterdam
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions.
Please visit http://www.swi-prolog.org for details.

For help, use ?- help(Topic). or ?- apropos(Word).

?- [vindinium].
true.

At that point, you can either fight at the arena:

?- fight.

... or train:

?- train([turns=50]).

You can leave the list of options empty, or supply number of turns and a map (see the Vindinium documentation).

The bot implemented in randbot.pl just walks around without direction. He might take possession of a mine or have a drink, if he happens to see one right next to him. He completely ignores other heroes.

If everything goes well, both fight/0 and train/1 should succeed once the game has finished. Failure most probably indicates an error (a bug in the program) that I haven't noticed yet.

After making any changes to your code, use make/0 to re-load everything:

?- make.
% Updating index for library /home/boris/lib/swipl-7.1.23/library/
% /home/boris/code/vindinium/greedy compiled into bot 0.01 sec, 27 clauses
true.

Enjoy!

vindinium-swi's People

Contributors

borisvassilev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.