Who will be the first to create a Go AI in Go?
Edit: The name should be a no-brainer.
Developed at the nightclub Go Go A Go Go.
And to start it you say "Go-Go Go Go"?
I know about at least one implementation:
This is a decent resource btw:
This depends on your criteria. If you want one that doesn't win I can create it for you today. Making one that can beat a reasonably competent player will take a while longer.
I think I've laid out a way to serialize a Go game's moves into a 'chromosome' to use in a genetic algorithm. I think that by calculating your average density throughout certain sectors in comparison to enemy density should be good enough throughout time to determine which moves result in more chances of winning.
This'll let you run it a million times to get better I'll get to learning Go tonight.
:= is not assignment, it's one of the declaration syntaxes. And as a C programmer, don't you like Go's error handling, which is basically a much more elegant version of C-style error handling?
What is Go's error handling like? Ideally I'd like to see languages move towards Haskell style Maybe a.
foo := 3 is equivalent to var foo int = 3; it lets the compiler infer the type. Later on, if you want to modify the value of foo you would use foo = 7 like you are used to.
foo := 3
var foo int = 3
foo = 7
I understand the inference working will in other cases, but in your particular case what does Go actually do? 3 can reprent a slew of different types.
It will infer the type based on how it is used later.
I'm guessing the downvotes are because the := operator is not assignment, and not like Pascal's := operator. In Go, := can not be used to assign a new value to a variable. It is a way of declaring a variable without having to type ''var''. So in Java/C++ you may have
BigClassName a = new BigClassName();
whereas in Go this could be done with
a := new(BigClassName);
or if you want to be verbose
var a BigClassName*
a = new(BigClassName)
I prefer to differentiate assignment and equality tests in some syntactic way that prevents accidental assignment when a comparison is in order...
It wouldn't help, the comparison operator is still == and the assignment operator is still =.
What it prevents is typos. If write in Python the following line:
answer = 42
Python infers that the variable holds an int. If I later type:
anwser = 6 * 9
I will create a new variable. This is not what I meant. In go, I will do:
answer := 42
And go will create the variable and initialize it as I wish. I can never use := on that variable since it already exists. And if I do:
The compiler will refuse it because it doesn't know the variable anwser.
Python doesn't infer anything, answer is just a void pointer to an object that has a field that declares what it is. Inference implies that it can know this type at compile time.
And Python variable don't hold anything, they just reference. I just wrote it that way for simplicity's sake.
The point is infers has a very well defined meaning in CS and especially when talking about types. What Python does is very different from inference.
In the case of:
parrot = "dead"
Python can infer the type at compile time. If it does or not is an implementation detail.
It can't because parrot might be assigned to something else latter. Inference implies static typing. It is meaningless unless you can say parrot will always be a string.
It can certainly infer that at this point in time parrot will be bound to a string. Bet let just say I said "RPython" which would not let you assign a differently typed value later.
What happens if you have:
parrot = 1 if random.randrange(2) else "dead"
I've seen recommendations before to change the order of equality tests in C to prevent these errors, like: if(3 == num) instead of if(num == 3). Honestly though I've never seen an error in code because someone accidentally used '=' instead of '==' and doing something like if(num = 3) will generate a warning anyways.
And this is not at all what the := operator is about.
There were time when warnings weren't generated. I did such a typo a couple of times. And it was PITA to find out...
Doesn't work for if(a == b).
I miss decent error handling too; Until there are no exceptions, I won't consider it. I do not share the present excuses exceptions would clutter interfaces etc.
If exceptions do happen, they won't be for error handling. At least not things like "file does not exist". Down that path lies madness. More for things like out of memory or divide by zero or the kind of thing you'd use setjmp/longjmp for in C.
I'm really glad to hear that.
I am certain it will be different, if kind-of will ever be part of the language spec. Exception handling without hierarchical types (which go hasn't; types just "are") would be really limiting.
If they haven't fixed it by now...I don't think they are inclined to. It doesn't look like he trademarked the language either, so Google has little incentive to make the change.
Google has little incentive to make the change
Don't be evil? I guess it's unlikely to be fixed now, but it's a stain on their record.
(Yes, I hold them to a high standard)
C, C++, C#, ooc, BitC, Objective-C. I think we can manage with Go and Go!
Good point, I guess. Though explicitly handling the situation somehow would be good.
To me the best compromise would be a link on Go's page saying "Looking for Go!?"
Ask the Google legal department.
Maybe someone needs to start an issue9 subreddit.
i don't understand the downvotes.
would it be miscrosoft or apple ...
Issue 9 From Outer Space! ...er, From Francis McCabe.
That's wiki page ain't Go. It's Go Bang (Go!).
Ah. Found some sample code to mess around with: http://99-bottles-of-beer.net/language-go!-289.html
Works for me.
I'm confused about why you think a misconfigured web server is so funny?