changed parc to fucking george vernot
This commit is contained in:
1 parent
ae5b3365e2
commit
337508e72a
3 files changed
+114
-6
No files matched your search
@@ -24,14 +24,14 @@ aura donc aucun match pré-saison.
|
|||||||
|
|
||||||
Nous sommes toujours a la **recherche de capitaines**. La case "je veux devenir
|
Nous sommes toujours a la **recherche de capitaines**. La case "je veux devenir
|
||||||
capitaine" ne fut pas des plus populaire. Nous cherchons donc intensément
|
capitaine" ne fut pas des plus populaire. Nous cherchons donc intensément
|
||||||
cinq capitaines au sang neuf pour diriger cinq équipes au sang chaud.
|
quatre capitaines au sang neuf pour diriger cinq équipes au sang chaud.
|
||||||
|
|
||||||
|
|
||||||
En résumé.
|
En résumé.
|
||||||
|
|
||||||
* La saison debute le **jeudi 18 mai 2017** au parc **[Georges-Vernot](http://bit.ly/2qMdsdm)**
|
* La saison debute le **jeudi 18 mai 2017** au parc **[Georges-Vernot](http://bit.ly/2qMdsdm)**
|
||||||
* Nous retrouverons le parc [Walter-Stewart](http://bit.ly/2qDlnMW) la semaine du 19 juin
|
* Nous retrouverons le parc [Walter-Stewart](http://bit.ly/2qDlnMW) la semaine du 19 juin
|
||||||
* Il nous manque 5 capitaines
|
* Il nous manque 4 capitaines
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,89 @@
|
|||||||
|
var _ = require('lodash');
|
||||||
|
|
||||||
|
var hostTeamsFactory = function(teams){
|
||||||
|
var i = 0;
|
||||||
|
return function(){
|
||||||
|
var ret = teams[i];
|
||||||
|
i = i + 1;
|
||||||
|
if(i == teams.length){
|
||||||
|
i = 0;
|
||||||
|
teams = _.shuffle(teams);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var getGuestTeams = function(hostTeams, teams){
|
||||||
|
return _.difference(hostTeams, teams);
|
||||||
|
};
|
||||||
|
|
||||||
|
var getLastTimeTwoTeamHasPlayedAgainst = function(history, team1, team2){
|
||||||
|
for(var i = 0; i < history.length; i++){
|
||||||
|
var nighGame = history[history.length - i - 1];
|
||||||
|
if(nighGame[team1] == team2 || nighGame[team2] == team1){
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -Infinity;
|
||||||
|
};
|
||||||
|
|
||||||
|
var initiateScheduleWithHostTeams = function(teams, numberOfNights, numberOfGamePerNight){
|
||||||
|
var hostTeams = hostTeamsFactory(teams);
|
||||||
|
return _.map(_.range(numberOfNights), function(){
|
||||||
|
var ret = {};
|
||||||
|
_.each(_.range(numberOfGamePerNight), function(){
|
||||||
|
ret[hostTeams()] = undefined;
|
||||||
|
});
|
||||||
|
return ret;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
var getBestGuestTeam = function(hostTeam, previousSchedule, possibleGuests){
|
||||||
|
|
||||||
|
// TODO: FIX ME.
|
||||||
|
var presiouslyPlayed = _.map(possibleGuests, function(guestTeam){
|
||||||
|
return getLastTimeTwoTeamHasPlayedAgainst(previousSchedule, hostTeam, guestTeam);
|
||||||
|
});
|
||||||
|
var m = _.fromPairs(_.zip(presiouslyPlayed, possibleGuests));
|
||||||
|
console.log(hostTeam);
|
||||||
|
console.log(m);
|
||||||
|
console.log(m[_.min(presiouslyPlayed)]);
|
||||||
|
console.log('\n\n\n\n');
|
||||||
|
return m[_.min(presiouslyPlayed)];
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
var addGuestTeamToNight = function(night, previousSchedule, teams){
|
||||||
|
var hostTeams = _.keys(night);
|
||||||
|
var nightHistory = 12;
|
||||||
|
_.each(hostTeams, function(hostTeam){
|
||||||
|
var alreadyChoosenTeam = _.compact(_.values(night));
|
||||||
|
var prohibitedGuests = _.concat(hostTeams, alreadyChoosenTeam);
|
||||||
|
var possibleGuests = _.difference(teams, prohibitedGuests);
|
||||||
|
night[hostTeam] = getBestGuestTeam(hostTeam, previousSchedule, possibleGuests);
|
||||||
|
});
|
||||||
|
return night;
|
||||||
|
};
|
||||||
|
|
||||||
|
var addGuestTeams = function(schedule, teams){
|
||||||
|
return _.map(schedule, function(night, idx){
|
||||||
|
return addGuestTeamToNight(night, schedule.slice(0, idx), teams);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
function createSchedule(teams, numberOfNights, numberOfGamePerNight){
|
||||||
|
var schedule = initiateScheduleWithHostTeams(teams, numberOfNights, numberOfGamePerNight);
|
||||||
|
return addGuestTeams(schedule, teams);
|
||||||
|
}
|
||||||
|
|
||||||
|
function main(){
|
||||||
|
var teams = ['jaune', 'vert', 'bleu', 'rouge', 'gris', 'orange'];
|
||||||
|
var numberOfNights = 10;
|
||||||
|
var numberOfGamePerNight = 3;
|
||||||
|
var schedule = createSchedule(teams, numberOfNights, numberOfGamePerNight);
|
||||||
|
_.each(schedule, function(night){
|
||||||
|
console.log(night, ',');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
main();
|
||||||
@@ -112,8 +112,7 @@ define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer', 'ar
|
|||||||
|
|
||||||
var mainMap = {};
|
var mainMap = {};
|
||||||
|
|
||||||
mainMap.getMap = function(){
|
mainMap.getWalterStewartMap = function(){
|
||||||
//
|
|
||||||
var iframeUrl = "//www.openstreetmap.org/export/embed.html?bbox=-73.55936229228975%2C45.53102667048665%2C-73.55230271816255%2C45.53444249585723&layer=mapnik"; // "//www.openstreetmap.org/export/embed.html?bbox=-73.56355190277101%2C45.5294483312637%2C-73.54943275451662%2C45.53627996625677&layer=mapnik"; // "//www.openstreetmap.org/export/embed.html?bbox=-73.56355190277101%2C45.5294483312637%2C-73.54943275451662%2C45.53627996625677&layer=mapnik";
|
var iframeUrl = "//www.openstreetmap.org/export/embed.html?bbox=-73.55936229228975%2C45.53102667048665%2C-73.55230271816255%2C45.53444249585723&layer=mapnik"; // "//www.openstreetmap.org/export/embed.html?bbox=-73.56355190277101%2C45.5294483312637%2C-73.54943275451662%2C45.53627996625677&layer=mapnik"; // "//www.openstreetmap.org/export/embed.html?bbox=-73.56355190277101%2C45.5294483312637%2C-73.54943275451662%2C45.53627996625677&layer=mapnik";
|
||||||
var externalLink = "http://www.openstreetmap.org/#map=17/45.53216/-73.55692";
|
var externalLink = "http://www.openstreetmap.org/#map=17/45.53216/-73.55692";
|
||||||
var iframeParams = {
|
var iframeParams = {
|
||||||
@@ -131,13 +130,33 @@ define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer', 'ar
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mainMap.getGeorgesVernotMap = function(){
|
||||||
|
// " style="border: 1px solid black"></iframe><br/><small><a href="http://www.openstreetmap.org/#map=16/45.5670/-73.6177">View Larger Map</a></small>
|
||||||
|
|
||||||
|
var iframeUrl = "//www.openstreetmap.org/export/embed.html?bbox=-73.63185167312623%2C45.560217957150535%2C-73.60361337661745%2C45.57387292040785&layer=mapnik";
|
||||||
|
var externalLink = "http://www.openstreetmap.org/#map=17/45.53216/-73.55692";
|
||||||
|
var iframeParams = {
|
||||||
|
style: {border: '1px solid black', 'min-height': '300px'},
|
||||||
|
width: '100%',
|
||||||
|
frameborder: 0,
|
||||||
|
scrolling: 'no',
|
||||||
|
marginheight: 0,
|
||||||
|
src: iframeUrl
|
||||||
|
};
|
||||||
|
return [
|
||||||
|
m('iframe', iframeParams),
|
||||||
|
m('br'),
|
||||||
|
m('small', m('a', {href: externalLink}, 'Voir la carte'))
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
mainMap.view = function(){
|
mainMap.view = function(){
|
||||||
return m('div.uk-panel.uk-panel-box',[
|
return m('div.uk-panel.uk-panel-box',[
|
||||||
m('div.uk-panel-badge.uk-badge', [
|
m('div.uk-panel-badge.uk-badge', [
|
||||||
m('i.fa.fa-map-o', {style: {'font-size': '1.7em'}})
|
m('i.fa.fa-map-o', {style: {'font-size': '1.7em'}})
|
||||||
]),
|
]),
|
||||||
m('h3.uk-panel-title', 'Parc Walter-Stewart'),
|
m('h3.uk-panel-title', 'Parc Georges-Vernot'),
|
||||||
mainMap.getMap()
|
mainMap.getGeorgesVernotMap()
|
||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user