SWI-PROLOG IS often used to make quick little applications for personal use, but what if you want to share your application with someone who is not familiar with running Prolog? How about we take advantage of Python's rich eco-system to create a GUI app in 10 minutes? Start the clock, let's go!
VIM IS a cruel learning curve, it's a long way from modern text editors, and yet it is still a popular choice for programmers. Why?! Because it's worth it. There are many things Vim does well, many things that I could use to show it off. But for this post, I had to choose only one thing, which is evaluating commands.
ANOTHER LITTLE known Python feature that deserves more love. This time we're looking at the send function that lets you input values into your generator as it's running. It works through yield and is awesome!
USE THE internet as a database. Across the internet, some generous providers make their data available not only as RDF/OWL, but via a SPARQL endpoint that you can send queries to. It's like an API, but instead of getting a response with all the data the developer thought you might like, you get the results of the query you want. It's even possible to query across multiple endpoints in a single query. SPARQL is similar enough to SQL to be easy to learn. In this post, we start out looking at SELECT queries against DBpedia.
PYWEEK CHALLENGE 25: Two Worlds, Complete. My entry is submitted, it works, now my real work begins. I intended to create a game similar to the original Rogue, but divided into normal and magical realms. I feel I have achieved this. Now it's time to make it better.
DAY 4 of PyWeek. If it looks like a game, and plays like a game, it's a game! Rogue: Through The Veil is starting to look and play like a game now. It's got monsters, combat, potions, scrolls, weapons and armour. Plus we can now go "through the veil" and pass between magic and normal worlds.
DAY 3 of the PyWeek 25, Two Worlds challenge, and progress is being made. Today we've got more monsters, weapons, armour, scrolls, menus and an improved melee combat system. Lots done, some incomplete and lots still to do. Feeling rushed, worrying about code getting messy.
DAY 2 of the PyWeek Challenge. Combat and creativity was harder than anticipated, but we've got monster generation, they move and melee combat is implemented. Plus there's a nicer GUI with basic HUD. We can also go down the dungeon through the normal world, and to make testing easy, you can never die!
BEGINNING A PyWeek25 entry. The theme is "Two Worlds" and I'm loving Rogue at the moment, so I decided to make a roguelike with a distinction between normal dungeons and magic dungeons. On day 1 I've made a dungeon generator and can explore it with a player. Making use of the tcod Python library.
PYTHON HAS support for lambda functions, Haskell is built upon lambda calculus. The two are not the same and this is the reason why lambda should have been removed in Python3. This post examines the differences, reviews the use in Python, and offers a more pythonic, honest syntax.
OF ALL the functional programming inspired features in Python, partial application must be the best kept secret that you really need to know. Partial application lets you create highly abstract functions and make them more specific for use, pass a function arguments without calling it yet, and so much more.
MAKE USE of functional programming techniques to improve your iteration in Python. By abstracting the function from the iteration you'll have greater code reuse, easier parallelisation, and lower memory usage.