DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
command="git clone github.com/cheddar-lang/Cheddar.git; cd Cheddar; eval npm install;echo 'alias cheddarrepl=\"node $DIR/Cheddar/dist/interpreter/tests/t_repl.js\"' >> ~/.bash_profile"
if [ -f ~/.bash_profile ];
then
if grep -q 'cheddarrepl' ~/.bash_profile
then
echo "Script already ran, or remove the any mentions of `cheddarrepl` from your .bash_profile."
else
if [ ! -d ~/Cheddar ];
then
eval $command
else
echo "Please delete the Cheddar directory before retrying."
> "avocad" print
Traceback (most recent call last):
File "./conacaten", line 345, in <module>
parse(tokenize(source_func()), [], [GLOBALS])
File "./conacaten", line 242, in parse
raise Exception("Could not find a word called {!r}".format(token))
Exception: Could not find a word called 'print'
docs say print is a thing though?
oh ok
> 2 2 + "avocad" + puts
Traceback (most recent call last):
File "./conacaten", line 345, in <module>
parse(tokenize(source_func()), [], [GLOBALS])
File "./conacaten", line 224, in parse
raise Exception("Could not find a word called `{}` with good types".format(token))
Exception: Could not find a word called `+` with good types
Javascript, 98 bytes
My first code golf, so I post anyway!
f=n=>{for(o=1/0,i=1;i<=n;i++)for(j=n;i*j>=n;j--)t=i*j-n+Math.abs(i-j),o>t&&(o=t,a=[i,j]);return a}
Initially my o was an empty object and I checked if o.a was empty, so it was a special case at the first round. But I found the 1/0 tri...
Uh, neither good nor bad? It's why I feel like there's a luck aspect. If the other players are doing the same, then it just comes down to whoever happens to notice the match first.
Let's play code golf... by playing golf.
Input
Your input will be a string consisting of #'s, an o, an @, and .'s. For example:
......@..
.....##..
.........
......o..
. - playable golf course (all shots must end on one of these)
# - a barrier (shots cannot go through this)
o - the starting ...
@Quill nah I'm gonna allow that, and just let the guys friends deal with him being an asshole. This philosophy and a bot being so easy to code has the additional benefit that I don't have to follow good security in terms of writing things client side.
function g(){f=e=>Array.from(e.children);A=f(card0).filter(e=>f(card1).map(e=>e.innerHTML).indexOf(e.innerHTML)>=0).shift()A.click();}setInterval(g,5);
Your code is good, but you have one massive oversight:
It's hackable.
Your code shouldn't be accessable from the Console. I would recommend using getters and setters to limit incorrect addition:
var protectedScore = 0; //abstracted away where it cannot publicly be reached
GameClass.__define...