Git Product home page Git Product logo

walke-'s Introduction

Walke-

julia script that turns a set of instructions into a playable celeste map

Requirements

  • a modded version of the celeste client
  • EmHelper
  • Julia on your fav. code editor (while installing julia, check add path!)
  • Maple
  • JSON

What's Walke-

Walke- is an esoteric programming language made to simplify the process of "coding" in celeste, using the entities in my helper. I wrote this script to eventually code Conway's game of life in the game, to prove that this language is turing complete. This script compiles the code into a celeste map, that should be able to do simple logic operations.

How does Walke- work?

  • Walke- uses 6-digits hex codes (#FFFFFF) as bool variables (the only supported type!), each color can assume a "on/off" state in-game

    for example, if #FF0000 is on, and #00FF00 is off, #FF0000 AND #00FF00 = #0000FF sets #0000FF off

    #FF0000 and #00FF00 = #0000FF

  • each instruction is always active, contrasting instructions create weird bugs

  • the language is not CaSe SeNsItIvE

  • walke- supports multiple outputs per instruction, separated by a ,

  • each line can only contain one instruction, or be left empty

  • comments as always are ignored

  • the map won't be compiled if the script encounters an error

How to compile a Walke- script

  • write your code in a text file, save it with the .wlk- extension (or check the examples in Programs/Examples)
  • move the file in the Programs folder
  • open the walke- folder in a code editor, run wlmain.jl (or open the folder in a terminal and run julia wlmain.jl
  • please don't edit/delete the folders, checking the integrity of each path might be added in the future
  • before putting your map in celeste, PLEASE open it in a map editor!

Syntax

  • comments start with -, everything after it will be ignored
  • everything before = is part of the instruction, everything after is an output, that will store the results
  • to use the opposite of a variable, add ! or ~ before it. for example, if #00000A is true, !#00000A is false

the default instructions are:

  • #00000A AND #00000B = #00000C - logical and operator
  • #00000A OR #00000B = #00000C - logical or operator
  • #00000A XOR #00000B = #00000C - logical xor operator
  • #00000A IMPLIES #00000B = #00000C - logical implication, it's a pseudoinstruction!
  • #00000A EQUIV #00000B = #00000C - if and only if, it's a pseudoinstruction!
  • BUTTON = #00000C - spawns an in-game button that changes state when pressed, reverts when not
  • SWITCH = #00000C - spawns an in-game switch that changes state when touched
  • OUTPUT = #00000C - spawns an in-game block, useful to see the value of a variable
  • PIXEL = #00000C - similar to OUTPUT, but spawns a grid of outputs in the same column, looks better with multiple outputs!
  • CLOCK = #00000C - spawns an in-game clock that generates a periodic pulse
  • TRUE = #00000C - triggers the color when starting the room (it's like setting it "true")
  • FALSE = #00000C - just like TRUE, but sets true the opposite, it's a pseudoinstruction!

expansion n.1: legacy gates! legacy gates simulate the very first gates made for walke-. They don't set the color to TRUE or FALSE, but simply change state when triggered. Those "weaker" logic gates let you create circuit that can coexist even with some contraddictions

  • #00000A WAND #00000B = #00000C - weak AND
  • #00000A WOR #00000B = #00000C - weak OR
  • #00000A WXOR #00000B = #00000C - weak XOR
  • #00000A WIMPLIES #00000B = #00000C - weak IMPLIES
  • #00000A WEQUIV #00000B = #00000C - weak EQUIV

expansion n.2: flags! flags change the behaviour of each gate. After calling a flag in the code, the next instructions will be influenced

  • > OPTIMIZED - removes all the extra entities that make the gates more readable, useful for larger projects
  • > NOPTIMIZED - reverts to default
  • > STOP - adds a "stop" that freezes the gate, using the reserved color #FFFFFF
  • > NSTOP - reverts to default

Credits

  • Aletris, for compressing the logic gates as much as possible
  • the Maple team, the module that made all of this possible

Isn't it Spass but worse?

No, because Walke- can't detect contraddictions. If a contraddiction happens, then the code behaves in an unpredictable way

Hacking the gate

i tried to code Walke- to make it as modular as possible. I'm not actively working on it, but in theory it should be possible to add more instructions, following those rules:

  • every instruction has a name containing a single UPPERCASE word with no spaces
  • every instruction has to have exactly one = in it, at least 1 token (its name) and 1 output
  • right now walke- supports instructions with 3 or 1 tokens, other types can be implemented

to implement a custom instruction:

  • add a .txt file in the ListOfInstructions folder, write a new "NAME = SIZE" in it (check default.txt for more infos)
  • if SIZE is different than 3 or 1, add a new module in JuliaModules, with a custom checkstructure function (open wlstructurecheck.jl to see how it works)
  • create a .jl file in JuliaModules/WlInstructions, fill it with custom NAME() functions that return 0 (no errors) or an integer (an error)
  • depending on the number of tokens, your function should accept an (optional) array of inputs and a (NOT optional) array of outputs. Each element is made from a custom struct (ColorStruct) that has a hex code (.name) without # and a value to check if you should generate the color or its opposite (.opposite)
  • if you wish to create a different kind of in-game structure, you can code a custom BuildInstruction

walke-'s People

Contributors

emanuelebrotti avatar

Stargazers

Dillon Barnes avatar

Watchers

 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.