Doge++ Documentation

About us:

We are two developers that had a cool Idea and we saw it through to the end. Doge++ is a simple programming language and we hope that it might make more kids get into CS. Below every function that we coded (Exept the secret ones) is documeted with a description. We hope that you like our language!

doge.bark(text)

This method outputs. Enter text or variable for output within the parenthesis. [e.g. doge.bark("Hello World")]

doge.sniff(string)

This method takes input. Within the parenthesis enter the string you want as your input question/statement. [e.g. doge.sniff("What is your name?")]

doge.digHole(varName, data)

This method creates a variable. For the first parameter, enter the name of your variable as a string and for the second parameter, put the value that you want to be stored in that variable. [e.g. doge.digHole(“test”, 1) or if you wanted to create a list, doge.digHole(“test”, [1,2,3,4]) or doge.digHole(“test”, [“one”, “two”, “three”, “four”]) ] You can output your variable by simply typing, doge.bark(varName), of course the name of your variable would go where varName is.

doge.buryBone(variable, newData)

This method changes a variable. For the first parameter, enter the name of the variables that you want to change and for the second parameter, put the new value that you want to be stored in that variable. [e.g. doge.buryBone(“test”, 2)] If you want to test this you can output the variable before and after the change occurs.

doge.eat(variable)

This method deletes a variable. For the parameter, put the name of the variable that you want to change. [e.g. doge.eat(“test”)] If you output the variable it will output null. If you try to manipulate the variable, as shown above, it will result in an error.

doge.poopAgain(varName, items)

This method adds to the end of a list. For the first parameter, put the name of the list that you want to add to and for the second parameter, put the item(s) that you want to add to the end of the list. [e.g. doge.poopAgain(“test”, 5,”six”)] This language currently only supports one dimensional lists, we hope to fix this issue in the near future.

doge.eatPoop(list, index)

This method removes an item at a specific index of a list. For the first parameter, put the name of the list that you want to delete from and for the second parameter, put what index you want to delete from. [e.g. doge.eatPoop(“test”, 0)] If you wanted to delete the 1st element from a list you would want to delete at index 0 because the indices start counting at 0.

doge.countPoops(list)

This method gets the length of a list. For the parameter, put the list that you want to get the length of. [e.g. doge.countPoops(“test”)] If you want to output the length just put that example code inside of an output statement, and replace “test” with the name of your list.

doge.buttScootch(maxRange,minRange, list (if applicable)

This method generates a random number or a random value in a list. If you are just generating a random number and are not generating a random value in a list, put the maximum number as the first parameter and the minimum number as the second parameter and don’t enter anything in the third parameter. [e.g. doge.buttScootch(1, 10)] To output the number, put it into an output statement. If you are wanting to generate a random value in a list, put 0 for the first two parameters, and for the third parameter put your list. [e.g. doge.buttScootch(0, 0, test)] To output the value, put it into an output statement.

doge.internalClock()

This method gets the current time in 24 hour time. If you want to output the time just put doge.internalClock() inside of an output statement.

doge.command(name,numPerams,perams,actions)

This method creates a function. For the first parameter, put the name of the function that you want to create. For the second parameter put the number of parameters that you want your function to have. For the third parameter, put the name(s) of your parameter(s). For the fourth parameter put the code that you want your function to evaluate. [e.g. doge.command(“add”, 2, “num1”, “num2”, doge.bark(num1 + '+' + num2 + '='), doge.bark(num1 + num2))]

doge.do(functionName, parameters)

This method calls a function. For the first parameter, put the name of the function that you want to call and for the second parameter, put the value(s) that you want for your parameter(s). [e.g. doge.do(“add”, 3, 4)] This would call the add function with the value for num1 as 3 and the value for num2 as 4.

Commenting

Doge++ only supports single line comments. You comment by typing //. [e.g. //this is a comment] Comments are skipped when you run your code.

doge.chaseTail(condition, actions)

This method creates a while loop. For the first parameter, put the conditional statement that you want determining if your loop will run or not and for the second parameter put the code that you want to evaluate when the loop is running. Say we already have a counter variable called count created [e.g. doge.chaseTail(“count<5”, doge.bark(count),”count++”)]

doge.fetch(varName, value, equation, varAdd, addBy, actions)

This method creates a for loop. For the first parameter put the name of the local for loop variable. For the second parameter, put the value that will be stored in that variable. For the third parameter put the conditional statement that you want determining if your loop will run or not. For the fourth parameter, put true/false if you want to add to your variable or not. If your put true for the fourth parameter then in the fith parameter put what you want your variable to add by each time and in the sixth parameter what actions you want your loop to perform, but if you put false for the fourth parameter in the fith parameter you put the actions you want your loop to perform. [e.g. doge.fetch(“i”,0,”i < 5”,true,1,doge.bark(i))]

doge.choose(ifCond,ifCode,numElif,elifCond,elifCode,isElse,elseCode)

This method creates an if statement. For the first parameter you put the conditional statement for your if statement, for the second parameter put the code that you want to go in your if statement, if you are not planning on having elifs or elses leave the rest blank. For the third parameter, put the number of else ifs that you want. For the fourth parameter put the condition(s) that you want your else if(s) to check. For the fith parameter put the code you want to go inside of your else if(s) to separate the different else if code put a blank quotation mark when you want to move to the code for your next else if(s) Leave the rest blank if you are not planning on creating any else’s. For the sixth parameter put true/false for if you are going to have an else. For the seventh parameter put the code that you want to go inside of your else. [e.g. doge.choose(“1>2”, doge.bark(‘1>2’), 2, “5<4”,"6<7”,doge.bark(‘5<4’), “”, doge.bark(‘6<7’)) or doge.choose(“1>2”, doge.bark(‘1>2’), 2, “5<4”,"6<5”,doge.bark(‘5<4’), “”, doge.bark(‘6<5’),true,doge.bark(’none were true!’))]

doge.howl(errorType, attemptedVal)

This method outputs an error. The error detection in doge++ is in simple terms, not very good, for the more experienced programmers you can look in the console by inspecting the page and an error will show up there. The error types are !list, and !var. In the first parameter you put the error type and in the second parameter you put the value that was attempted. [e.g. doge.howl(“!var”, “test”) will result in ERROR: Bone not found in hole test]

Helpful Tips:

Click Me!