Skip to content

R-Rudolf/progtabor2015

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

progtabor2015

A Szent István gimnázium által szervezett 2015-ös Programozói táborra készülő játék.

##A játékszerver működése: A szerver a MARTON-FREE-2 wifi hálózaton van a 192.168.0.112 ip címen és az 5555 porton kínálja fel a ZMQ csatornát.

Bővebben a ZMQ-ról: link

A Request-Response eljárást használjuk.

A használathoz telepítened kell a használt programozási nyelvnek megfelelő függvénykönyvtárat.

  • C# esetén:
  • A Visual Studioban telepítsd a nuget csomagtelepítővel a netMQ csomagot.
  • A többi teendő elvileg érthetővé válik a következő script elemzésével: link

A parancsok kiadása és a válaszok értelemzése a JSON adatstruktúra segítségével történik. Ehhez egy kis segítség:

  • C# esetén:
  • Szintén a nugettel kell telepíteni a newtonsoft JSON könyvtárat.
  • Ehhez segítség a következő honlapokon található: link
  • (A korábban ajánlott JSON könyvtárhoz a segédkód: link )

##Kérések és Válaszok a szerverrel:

Mindenhol ahol szöveg az adattípus idézőjeleket "" használok, mindehol ahol egész szám van számokat írok, lebegőpontos adattípúosoknál pedig tizedestörteket írok a példákban.

  • Handshake Return a "World!" for a "Hello" request

  • getKey(teamName) returns a secret key, which is needed for the other requests

    example_request = {
        "action": "getKey",
        "team_name": "test"
    }
    example_response = {
        "secret": "kL4QBbPZRu"
    }
    
  • initLevel(level) resets drones, maps, timers, sets map to the given level return a the list of drone names

    example_request = {
        "action": "initLevel",
        "team_name": "test",
        "secret": "kL4QBbPZRu",
        "level": 1
    }
    example_response = {
        "drones": ["Muffin", "Baboo", "Prince_Charming"]
    }
    
  • moveDrone(name, acc, turn) Return actual datas (life, cooordinates, angle, acc, speed) Turn is in radians! Maximum speed is: 10 (pixel per tick) Acceleration is between: 1 and -1 (pixel per tick^2) Turn is between: +- 10*pi/180 (radian per tick) If crashed life is 0

    example_request = {
        "action": "moveDrone",
        "team_name": "test",
        "secret": "kL4QBbPZRu",
        "drone": "Baboo",
        "acceleration": 0.3,
        "turn ": 0.45
    }
    example_response = {
        "life": 1,
        "x": 256.556,
        "y": 195.999,
        "angle": 2.67,
        "acceleration": -0.3
        "speed": 4.7
    }
    
  • getMeasure(name) return measurement of the drone

    example_request = {
        "action": "getMeasure",
        "team_name": "test",
        "secret": "kL4QBbPZRu",
        "drone": "Baboo"
    }
    example_response = {
        "result": 21.64
    }
    
  • tick() Drones alive: turn, accelerate, go ahead Increment and return tick.

    example_request = {
        "action": "tick",
        "team_name": "test",
        "secret": "kL4QBbPZRu"
    }
    example_response = {
        "tick": 14
    }
    
  • getScore(map) Evaluates sent map and original map similarity. (Only once per minute can be evaluated per user! --> only during competition) Returns Score, which is between 0 and 100, where 100 is the total match. The Map is a 2 dimesnional array of integers between 0 and 100, with 512x512 size.

    example_request = {
        "action": "getScore",
        "team_name": "test",
        "secret": "kL4QBbPZRu",
        "map": [[0, 0, 12, 0, 1, 33, 45, 0 ...], [0, 100, 100, ... 100, 0], [...] ... []]
    }
    example_response = {
        "score": 14
    }
    

About

A Szent István gimnázium által szervezett 2015-ös Programozói táborra készülő játék feladat.

Resources

Stars

Watchers

Forks

Packages

No packages published