Skip to content

Conversation

@truell20
Copy link
Contributor

No description provided.

jparoz and others added 8 commits November 12, 2016 21:20
@Kesanov
Copy link

Kesanov commented Nov 13, 2016

Could you take a look at Haskell Alternative pull request? I would like to merge my implementation with current implementation, without replacing all of @jparoz work, but I am not sure I have used the right way to do that ( I am new to git ).

@truell20
Copy link
Contributor Author

Sure, @Josef-Vonasek. I'll close this for now.

@truell20 truell20 closed this Nov 14, 2016
@truell20
Copy link
Contributor Author

Nevermind, I see that you are sending a PR for this branch.

@truell20 truell20 reopened this Nov 14, 2016
truell20 and others added 7 commits November 14, 2016 14:33
[Haskell] New interface for Starter Package
Also renamed variables in parseMapContents to aid readability
A list comprehension generates almost the right list, but in the wrong
order. The way the list was used, the order must correspond to the order
of Bools in the second list, or else you end up with nonsense moves,
sending requests for unowned sites to move.

I changed it to use the more precise method used in the library
function, but probably a neater way to do things would be to simply
filter the list of sites based on owner, then map `siteLocation` over
the resulting list.
@jparoz
Copy link

jparoz commented Nov 15, 2016

Can we include #223?

@Kesanov
Copy link

Kesanov commented Nov 15, 2016

It's a bit off topic, but wasn't the infamous record problem solved in GHC 8.0 ? E.G. Do we need different names for location getters (currently siteLocation and moveLocation)?

@jparoz
Copy link

jparoz commented Nov 15, 2016

Yeah, with the DuplicateRecordFields extension. I personally never felt it was that big of a deal, and am still in the habit of prefixing.

I think the extension would work in the code. It would be only a few lines changed to implement, if we want to.

@Kesanov
Copy link

Kesanov commented Nov 15, 2016

Also, other starter packages provide some helper functions like inBounds, getDistance, getAngle, getLocation, getSite. Should we also provide them (e.g. in Halite.Logic) ?
Also all of those methods take Map as parameter. Therefore I was playing with the idea of making Map a state monad, but I guess it probably wouldn't be worth the effort (maybe even contra productive). What is your opinion?

@jparoz
Copy link

jparoz commented Nov 15, 2016

From what I can tell, inBounds is nonsense, as the game map loops around at the edges.

The helper functions seem like nice additions. Perhaps we could name them as such: distanceTo, angleTo, intended to be called like: loc1 angleTo loc2? Not a huge deal.

If a user wants monadic composition for Map, they could just use the implementation in Control.Monad.State. This should be enough firepower for any use case I can think of.

@Kesanov
Copy link

Kesanov commented Nov 16, 2016

I have sent a PR #233. After that I think we are ready to go, unless there is some bug I didn't see.
( Maybe we could post a link on Haskell reddit when it is finished, I think this game can be a nice starting point for haskell intermediates, who are looking for project.)

@truell20
Copy link
Contributor Author

@jparoz Does this look good to you as well?

@jparoz
Copy link

jparoz commented Nov 16, 2016

Great work from @Josef-Vonasek! Looks good to ship.

Just curious, why the change to rand?

@Kesanov
Copy link

Kesanov commented Nov 16, 2016

Thanks.

Because our Test instance uses modulo and as you know
0 <= mod x i < i
but
0 <= randomR (0, i) <= i.

@truell20 truell20 added this to the Sprint 2 milestone Nov 16, 2016
@jparoz
Copy link

jparoz commented Nov 17, 2016

That makes sense. 👍

@AnthonyJacob
Copy link

What do you need cabal for?

@truell20
Copy link
Contributor Author

@AnthonyJacob Having a bit of trouble installing stack in a docker container.

@wizzup
Copy link
Contributor

wizzup commented Nov 29, 2016

@truell20 I have no problem installing stack to docker image, please see #282

[wizzup@earth worker]$ docker run -it --rm mntruell/halite_sandbox
root@537b8acfc370:/# which stack
/usr/bin/stack
root@537b8acfc370:/# stack --version
Version 1.2.0, Git revision 241cd07d576d9c0c0e712e83d947e3dd64541c42 (4054 commits) x86_64 hpack-0.14.0
root@537b8acfc370:/# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.1 LTS
Release:	16.04
Codename:	xenial

Below is building log

./buildDocker.sh 
Sending build context to Docker daemon 4.096 kB
Step 1 : FROM ubuntu:latest
 ---> e4415b714b62
Step 2 : RUN apt-get update
 ---> Using cache
 ---> 41dddd49feae
Step 3 : RUN apt-get install -y sudo
 ---> Using cache
 ---> 8ba1811fca98
Step 4 : RUN apt-get install -y curl
 ---> Using cache
 ---> b17aab6deb26
Step 5 : RUN apt-get install -y libstdc++6
 ---> Using cache
 ---> 53aba3fc0d33
Step 6 : RUN apt-get install -y gcc
 ---> Using cache
 ---> efed9a872d77
Step 7 : RUN apt-get install -y g++
 ---> Using cache
 ---> 568df5e2914a
Step 8 : RUN apt-get install -y python3 python3-pip python3-dev python3-numpy
 ---> Using cache
 ---> e703bdd2c4d1
Step 9 : RUN curl -sSf https://static.rust-lang.org/rustup.sh | sh
 ---> Using cache
 ---> 69747f332a6b
Step 10 : RUN apt-get install -y python-software-properties
 ---> Using cache
 ---> 99b48c347294
Step 11 : RUN apt-get install -y software-properties-common
 ---> Using cache
 ---> f3e5c8ac622e
Step 12 : RUN apt-get install -y openjdk-8-jdk
 ---> Using cache
 ---> 08fbaa5db877
Step 13 : RUN apt-get install -y scala
 ---> Using cache
 ---> 9e6009db4071
Step 14 : RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
 ---> Using cache
 ---> f2aa565e8101
Step 15 : RUN echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
 ---> Using cache
 ---> 7c9fc9d7aa47
Step 16 : RUN apt-get update
 ---> Using cache
 ---> a418020f2f37
Step 17 : RUN apt-get install -y mono-devel
 ---> Using cache
 ---> e30059e4c6ab
Step 18 : RUN apt-get install -y ruby
 ---> Using cache
 ---> df4d54cc9dcd
Step 19 : RUN gem install bundler
 ---> Using cache
 ---> 33bf74e92907
Step 20 : RUN apt-get install -y golang
 ---> Using cache
 ---> f4d4dd5128b2
Step 21 : RUN apt-get install -y php
 ---> Using cache
 ---> 18de3f4a5ed8
Step 22 : RUN apt-get install -y build-essential
 ---> Using cache
 ---> 7ae5c00c5094
Step 23 : RUN curl -sL https://deb.nodesource.com/setup_7.x | bash -
 ---> Using cache
 ---> 81ab2b0a9d21
Step 24 : RUN apt-get install -y nodejs
 ---> Using cache
 ---> d2250795c191
Step 25 : RUN apt-get install -y ocaml
 ---> Using cache
 ---> a7a1f231161e
Step 26 : RUN sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 575159689BEFB442
 ---> Using cache
 ---> ae91af6daedb
Step 27 : RUN echo 'deb http://download.fpcomplete.com/ubuntu xenial main'|sudo tee /etc/apt/sources.list.d/fpco.list
 ---> Using cache
 ---> 511a99ad788f
Step 28 : RUN sudo apt-get update && sudo apt-get install stack -y
 ---> Using cache
 ---> a68d64428c48
Successfully built a68d64428c48

@truell20 truell20 removed this from the Sprint 2 (Before Pruning) milestone Dec 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants