User:EvyLah/ideas
hi, this page is for ideas for new stuff (kinda like the sandbox from the code golf stack exchange)
you can edit freely or use the talk page for feedback
this page exists so if I decide to abandon an idea I don't have to blank a page and ask for it to be deleted or something
Train Schedule
started on 2024/7/19, may or may not rename
overview: it's like a railway network, but the program is written to look like a Minecraft Create mod Train Schedule.
some ideas
- you can have only one train and one schedule for said train
- you can have infinite number of stations
- no, you don't build the track, the train, nor the station(s)
- you can choose to loop infinitely or halt upon reaching the end of the schedule (just like in the mod)
- you can choose which instruction to start at (also like in the mod)
- the train has an item vault (from the mod) that can store any Minecraft item of any amount (including fluids)
- the last line of the program is used to say where the program starts and if it loops (
[0]
for starting at instruction 0,[H]
for halt in the sample program below) - items are specified as, uh, anything I guess (but no spaces)
- fluids are just a hardcoded list I made (see below)
- travel to station command can go skip the next instruction based on a condition (see instructions)
program writing
all instructions of a program are separated by a single newline character. parameters are denoted and separated with a ;
.
the first instruction is 0, second is 1, and so on
if you go to a station but don't do a valid command, nothing happens (no-op I guess?)
loading/unloading
loading and unloading is how you interact with stations. unloading removes the item(s) you unloaded from the item vault.
stations
instructions, basically. you don't have to go to a different station; you can travel to the same station twice. non-reserved stations can hold one item/fluid, which can be loaded/unloaded from/to. you can specify
RESERVED STATIONS
you cannot name your station these (CASE SENSITIVE):
output
- unload values to be printedinput
- input values, load values to train from herehalt
- halts upon reaching. program can also halt upon reaching the end if loop is not enabledchalt
- conditionally halt, unload value here, if value is zero then halt, otherwise do nothing
I/O types
there are 2 I/O types:
- fluids - number
- not fluid - unicode character
if you input nothing, the train gets loaded with a 0 of the requested type. if the value entered is invalid, the user will be prompted again.
fluid list
water
lava
milk
honey
chocolate
builders_tea
potions don't count
you can also have negative values on the item vault, but, uhhh, let's ignore that
sample program
a+b problem
Travel to input; load water Travel to input; load water Travel to outputN; unload water [0];[H]
instructions
<angle brackets> are required, [square brackets] are optional.
Travel to <station>; <action>; [condition] | Go to a station, and do that action. allowed actions are different per station. Skip next stop | Skip the next instruction unconditionally
station actions
- reserved stations: scroll up
- non-reserved stations
load cargo onto train
- loads whatever cargo is at the stationunload <#> <item>
- moves number of item to the station. unloading an itemconvert <#> <item>
- converts number of items to the type of the station's cargo. if it doesn't have anything than this does nothing
operations
stuff you can do with items on the train and
since it loads [user input] amount of dirt both times, the amount will be combined
python implementation if ever done by me
don't judge me pls
reading instruction: 1. split line by ; 2. trim whitespace from both sides of each element 3. process
StringCell
like brainfuck, but the memory is an array of strings or numbers (name can be changed later)
memory
- 30,000 cells
- circular (going left from the first cell takes you to the last)
- one holding cell (like an accumulator)
- all cells initialize with a
0
- number cells wrap based on bit size (unsigned)
commands
- x - copy cell to hold and set cell to 0 or "" (empty string) depending on its current type
- c - copy cell to hold
- v - paste hold to cell
- r - reset cell to 0 or ""
- R - reset cell to 0 no matter the type
- u
- if string: set every cell starting from the current one to its unicode value in the string (convert string to array)
- if number: convert to string of length 1 based on unicode
- +- increment/decrement cell if it's a number
- b - cell size bits = cell (if cell holds 16 then the max number will be 65536)
add more