Giter VIP home page Giter VIP logo

code-of-copper's People

Contributors

gearsdatapacks avatar moxvallix avatar revolvingmadness avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

code-of-copper's Issues

Add scoped variables

For now this is just an interpreter thing, but later we might want to add the option to declare global variables, which would require changes to the parser

Additional Stdlib Functions

New additions since we divvied up the stdlib:

  • shuffle()
  • arr()
  • ascii()
  • char()
  • prefix?()
  • suffix?()
  • index() (edit to work with strings)
  • repeat()
  • replace()
  • split()
  • lower()
  • upper()
  • trim()
  • rtrim()
  • ltrim()
  • squeeze()
  • lpad()
  • rpad()

  • All documentation written
  • All tests written

Gears's Stdlib Functions

  • every()
  • any()
  • find()
  • filter()
  • contains?()
  • index()
  • reduce()
  • set()
  • abs()
  • int()
  • min()
  • max()
  • sign()
  • call()

Loops only work once

I've run into an issue where if a script has multiple loops, the first loop while execute, but execution will stop at any subsequent loops. However while loops continue to work

Script using the loop keyword (broken)

# Area Miner
# direction controls
let x = 0
let z = -1
let size = 5

# opposite directions
# using * -1 as using -x or -z resulted in 0 instead of 1 or -1
let ix = x * -1
let iz = z * -1

loop size
  place 0, [x, 0, z]
  move [x, 0, z]
end

print "Finished first loop"

place 0, [z, 0, x]
move [z, 0, x]

print "Final line executed"

loop size 
  place 0, [ix, 0, iz]
  move [ix, 0, iz]
end
print "This doesn't execute"

Script using the while keyword (works)

# Area Miner
# direction controls
let x = 0
let z = -1
let size = 5

# opposite directions
# using * -1 as using -x or -z resulted in 0 instead of 1 or -1
let ix = x * -1
let iz = z * -1

let i = 0
while i < size
  place 0, [x, 0, z]
  move [x, 0, z]
  let i = i + 1
end

print "Finished first loop"

place 0, [z, 0, x]
move [z, 0, x]

print "Final line executed"

let i = 0
while i < size
  place 0, [ix, 0, iz]
  move [ix, 0, iz]
  let i = i + 1
end
print "This executes"

Add literal parameters

Literals should have optional parameters, in square brackets, that contain an expression.

$var[2 + 3]
[1,2,3][0]

Switch Copper Golem to use an item_display entity

For performance, and customisability reasons, we should replace the armour stand riding in the minecart with an item_display entity.

We could also use this to provide a basic animation using interpolation, for when the bot is running.

We might want to consider using a text_display entity as well for the Golem's text output.

Print doesn't work on 1.20.3+

Because Mojang changed JSON formatting in 1.20.3, the output of print doesn't work properly any more.
At this point we should just rewrite it with macros

Add object type literal

Add a literal which is a collection of key/value pairs.

Keys should follow the same rules as an un-bracketed variable, namely be alpha-numeric, but allow a dash.

Values should be an expression.

Syntax:
{key: "value", key2: 3+5}

Data Structure:

[
	{
		key: ["k","e","y"],
		value: {
			type: "expression",
			operator: "add",
			value: {
				type: "literal",
				variant: "string",
				value: ["v","a","l","u","e"]
			}
		}
	},
	{
		key: ["k","e","y","2"],
		value: {
			type: "expression",
			operator: "add",
			value: {
				type: "literal",
				variant: "integer",
				value: 3
			},
			expression: {
				type: "expression",
				operator: "add",
				value: {
					type: "literal",
					variant: "integer",
					value: 5
				}
			}
		}
	}
]

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.