About us – What do we need? – Connectivity



About us – What do we need? – Connectivity

0 0


challenge-pitch-reveal


On Github webplatformz / challenge-pitch-reveal

Jass-Challenge
Patrick Walther & Nick Payne
Nick

About us

  • FHNW graduates
  • Zühlke employees
  • Web developers
  • Passionate Jasser
Nick Zühlke Weiterbildung Programmieren von Bots = nice Genug Poker-/Panzerbots

Agenda

  • Jass - The Game
  • What do we need?
  • Server
  • Connectivity
  • GUI
  • About Bots
  • What's next?
Nick
Patrick ask who plays jass short jass rules schieber obenabe undenufe trumpf

Things to remember

  • Cards played
  • Card colors played per player
  • Trumpf still in play
  • Which cards are Bock
explain advantage of bots easy card counting, trumpf counting, who played which card...

What do we need?

Nick

A Server

  • Not Java
  • Lightweight
  • Easy to run/setup
  • Good to test

Connectivity

  • JavaScript, Java, C#, Haskell ...
  • Well defined API
  • Validation

GUI

  • Play against Players or Bots
  • Watch games of Bots slowed down
  • German/French cards
Patrick

Huge package ecosystem

Lightweight

npm start

A lot of good packages ~260k - 667 per day(maven 121) front- and backend compared to maven easy and lightweight super easy start

Prototypal Inheritance

No static types

Nonverbose Syntax

modules with prototypes and factories instead of classes no type guarantees -> more unit tests more concise syntax (arrow functions, object literal...)

Connectivity

Nick

WebSockets

  • Package in almost every programming language
  • Easy Setup
  • Low Level
due to low level, it's easy but has no messaging queue or whatever basicall just text

Bot, what is your name?

                
{
    "type" : "REQUEST_PLAYER_NAME"
}
                
            

Here are your cards. Good luck.

                
{
    "type" : "DEAL_CARDS",
    "data" : [{
        "number" : 13,
        "color" : "SPADES"
    }, {
        "number" : 9,
        "color" : "DIAMONDS"
    },
    ...
    ]
}
                
            

API Language?

                    
{
    "type" : "REQUEST_TRUMP"
}
                    
                
                    
{
    "type" : "BROADCAST_TRICK"
}
                    
                
Sprache Trumpf, Wyse, Stich, Stöck, Undeufe, Obenabe

Better...

                    
{
    "type" : "REQUEST_TRUMPF"
}
                    
                
Patrick

ReactJS

  • Virtual DOM
  • Invented by Facebook
  • One-way data flow
facebook invented react chat widget -> error search flux

Flux

Flux -> controller Redux or other alternatives (Observable only)
Your browser does not support the video tag.

About bots

what makes a bot smart?
Nick

Bot skeletons

There are bot skeletons ready to use in Java 8 and JavaScript.

They are not very smart, but they can play.

A stupid bot

                
function onRequestCard() {
    let cardToPlay = this.getRandomCard();
    this.api.playCard(cardToPlay);
}
                
            

A bit smarter?

  • Choose a valid card.
  • Keep track of the cards in the hand.
                
function onRequestCard() {
    let handCard = this.giveValidCardFromHand();
    this.handcards.splice(this.handcards.indexOf(handCard), 1);
    this.client.send(handCard));
}
                
            

More stuff to consider

  • Creating rules/strategies for the different game modes Trumpf, Obeabe, Undeufe, or if you want to Schiebe
  • Your partner's needs.
  • Give your bot the ability to learn and improve.
Jass - Challenge Hackathon
Patrick
Beer & Pizza
Patrick
2 GoPro HERO 4
Patrick
04.05.2016 6.0D09
Patrick
Interested?
Patrick Dozenten sind auch willkommen
Nick