Hal9000
As you may know, I am slowly/painfully writing an Elixir book.
There is a code example that I’ve written in Ruby – a simple
robot-type “capture the flag” game. (Not a real game, just a
coding exercise.)
I’m about to port the Ruby code to Elixir. If anyone wants to
look/comment/help, please feel free. (Those who contribute
will be mentioned in the acknowledgements fwiw.)
This repo will be public for at least two days:
https://github.com/Hal9000/vexil
Thanks,
Hal
Trending in Discussions
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
New
The obligatory hello world thread!
Who are you and where are you from? :stuck_out_tongue:
New
I want to open this thread for you all to discuss and help those who really like Ash but are still hesitant to use it in a real project. ...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using.
We’re particularly inte...
New
I’m posting this in response to Jose’s recent tweet (Cr. link) :
People are sleeping on Elixir for a coding harness:
Hot-code swappi...
New
AcmeScript — Writing JS hooks as if I were still using Elixir
I’ve been having fun building a little something over the last few days: Ac...
New
Other Trending Topics
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
There are three potential reasons for members of this forum to have a look at https://vutuv.de
You are tired or annoyed of LinkedIn.
Yo...
New
Aludel - LLM Evaluation Workbench
Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixir-ls
- #ai
- #elixirconf-us
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Most Liked- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
minhajuddin
*.beamin your.gitignoredefstruct team: nil, kind: nil, move: nil, see: nil, ...could be written asdefstruct [:team, :kind, :move, :see...]def get(grid, [:red, x, y])johnkelly
I think you can refactor the show_cell function to remove the conditional and assignments.
Eiji
Heh, finally my PR is accepted.
Before I begin work on AI I want to be sure:
Do you understand all from my code?
Whether the code is clear and intuitive for you?
I’m not sure how much implement AI could take for me, but I think I finish it by the end of next week.
Last Post!
Eiji
It’s not a problem for me, but If it’s possible wrote about when you will have a time for this project, so I do not need wait and I can better manage my time.
My English is not good, but I will try answer your questions:
escript- read this tutorialrest is generated by
mix new vexilcommandIt’s predefined color name. See bunt dependency github project.
No, when I wrote this code I had
Gridstruct (so I found another name for this module), but after some changes this struct was not needed. But now I think it’s much more cleaner, becauseBattlegroundgenerategridand have methods for read and write to it. Of course I can send PR with changed module name if you wwant.AI as a separated Erlang process will decide what to do.
It will ask
Battlegroundmodule if it can do something and depends on results it will callBattlegroundto apply AI decision (for example because AI - here bot - see only cells in specific range, think aboutBattlegroundas game engine).Note: color should be unique for all teams.
Database naming convention for example in simple blog we have:
Postwithtitle,bodyandidCommentwithuser_name,bodyand post_id.So
Teamhascolor(likeid) andBothasteam_color(liketeam_id).I use
Agentto store game data. In previous (not pushed) version I don’t haveAgentand I was need to pass more arguments. For example see where I readmap_last_index. In previous version I need to pass it in lots of functions. I think it’s much more easier to read when we read game data fromAgent.What do you exactly mean?
I added code to make it configurable, so you can easily setup game rules, for example
Bottypes and their count.I think it’s much more easier to modify this code without completely rewrite “game engine”.
Do you know
M.U.G.E.N? It was really configurable. Anybody could add new characters, backgrounds, music and lots more. Lots of fans from lots of communities used this to create own games with for example: characters from other game.I think project like it (but much more simpler - your vexil) should be configurable too. You can add some exercises to implement new features without need to write new game.
Also I read your code in
Rubyand my configuration and it’s implementation is based onsetupmethod inRefereeclass.This method have statically selected data and I split it to configuration (config.exs) and implementation (Battlegroundand it’s utils). See how I place bots based on their number.Do you agree with me?
start_edgefromconfig.exsis based on yoursetupmethod.corneris fromTeamstruct and it’s randomly selected - see&Vexil.Battleground.TeamUtils.random_corner/1method.Note: in configuration I use “human” numbers (people count from 1) and translate it to
Listindex (computers count from 0). So whenstart_edgeis 5 I place bots on 4th index random cell (half on X edge and half on Y edge).Do you have any more questions?