Code Monkey home page Code Monkey logo

elm-bounded-number's Introduction

jschomay_a_computer_grid_world_where_ai_narrative_and_games_intersect_cropped

Hi, I'm Jeff. I like to explore that special place where games, narrative, and AI intersect. I made the Elm Narrative Engine for making non-linear story games and lately I've been experimenting with generative AI in games.

Play Deadline
Escape the subway before it is too late
Adding Inworld AI Characters to an Existing Game, Part 3: Reflections, Trust, and Pigeons
What I learned from my players and my characters
Adding Inworld AI Characters to an Existing Game, Part 4: Going Deeper
Getting the most out of AI chat bots
Getting Lost in the Forest
Postmortem on Using AI Generative Tools to Create a Forest Maze Game

Follow on LinkedIn

Follow on Twitter

elm-bounded-number's People

Contributors

aquacash5 avatar hugooliveirad avatar jschomay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

elm-bounded-number's Issues

Remove dependecy on regex package

It seems as if this code puts a dependency on the regex package, but I cannot figure out for what. If there is no reason for it to be a dependency then it should probably be removed so the package is unaffected by changed in said package.

Add `update` or `map` function to ease bounded number manipulation

Hey! First of all, great work on elm-bounded-number using it, loving it.

It is very common for having a way to map a value of a data structure. Most data structures allow it, such as Maybe, Result, Dict, and so on. It would be great to have an update or map function so that you can more easily chain bounded number operations.

I have added a function similar to this one to one of the projects I'm working on:

mapBounded fn bounded =
    let
        value = Number.Bounded.value bounded
    in
    Number.Bounded.set (fn value) bounded

This let's me refactor things like this:

-operation : Int -> Int
+operation : Bounded Int -> Int
 operation =
-    (*) 20 >> (+) 10
+    Number.Bounded.update <| (*) 20 >> (+) 10

It also makes it easier to refactor from Number.Bounded.inc. Such as: https://github.com/hugobessaa/nanotimers/pull/11/commits/696171908045a3d369a25dd0855ec8eccf474e0e

I'm not sure if the proper name should be either map or update.

What do you think about adding this function? I could send a PR.

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.