예제 #1
0
function cpu($deck, $flowed, $hands, $field)
{
    $goalmark = decidegoalmark($hands);
    $markcount = markcount($hands);
    if ($markcount == 1) {
        //[5]のとき
        $wantkeys = wantkeys($field, $hands);
        if ($wantkeys) {
            //場にgoalmarkと同じカードが存在する場合
            $mostwantkey = mostwantkey($field, $hands);
            $fieldmax = pointconvert($field[$mostwantkey]['face']);
            $handsfaces = array();
            foreach ($hands as $value) {
                array_push($handsfaces, $value['face']);
            }
            $handsfaces = array_walk($fieldfaces, 'pointconvert');
            $handsmin = min($fieldfaces);
            $handsmin_nums = pointreverse($handsmin);
            foreach ($handsmin_nums as $value) {
                $dashukey = array_search($handsmin_num, $fieldfaces);
            }
            if ($fieldmax > $handsmin) {
                //場に手札より大きいカードが存在する場合
                $replaced_set = replace($field, $hands, $mostwantkey, $dashkey);
                $field = $replaced_set[0];
                $hands = $replaced_set[1];
            } else {
            }
        } else {
        }
    } else {
        $dashkey = dashkey($hands);
        $wantkeys = wantkeys($field, $hands);
        if ($wantkeys) {
            //場にgoalmarkと同じカードが存在する場合
            $mostwantkey = mostwantkey($field, $hands);
            $replaced_set = replace($field, $hands, $mostwantkey, $dashkey);
            $field = $replaced_set[0];
            $hands = $replaced_set[1];
        } else {
            //場にgoalmarkと同じカードが存在しなかった場合
            //流す
            $flowset = flow($field, $deck, $flowed);
            $field = $flowset[0];
            $deck = $flowset[1];
            $flowed = $flowset[2];
            //流した後のカード交換ここから
            //流した後の場の欲しいカードのキー取得ここから
            $wantkeys = wantkeys($field, $hands);
            if ($wantkeys) {
                //場にgoalmarkと同じカードが存在する場合
                $mostwantkey = mostwantkey($field, $hands);
                $replaced_set = replace($field, $hands, $mostwantkey, $dashkey);
                $field = $replaced_set[0];
                $hands = $replaced_set[1];
                //場を流した後のカード交換ここまで
            } else {
                //流したのにも関わらず、場にgoalmarkと同じカードが存在しなかった場合
                $fieldfaces = array();
                foreach ($field as $value) {
                    array_push($fieldfaces, $value['face']);
                }
                $fieldfaces_num = array();
                foreach ($fieldfaces as $value) {
                    array_push($fieldfaces_num, $value);
                }
                $maxface = max($fieldfaces_num);
                $mostwantkey = array_search($maxface, $fieldfaces);
                $dashkey = dashkey($hands);
                $replaced_set = replace($field, $hands, $mostwantkey, $dashkey);
                $field = $replaced_set[0];
                $hands = $replaced_set[1];
                //場を流した後の要らないカード交換ここまで
            }
        }
    }
    $multi_set = array($deck, $flowed, $hands, $field);
    return $multi_set;
}
include_once('ressources/class.system.network.inc');
include_once('ressources/class.system.nics.inc');


$users=new usersMenus();
if(!$users->AsWebStatisticsAdministrator){
	$tpl=new templates();
	echo FATAL_WARNING_SHOW_128("{ERROR_NO_PRIVS}");die();

}



if(isset($_GET["popup"])){page();exit;}
if(isset($_GET["tabs"])){tabs();exit;}
if(isset($_GET["flow"])){flow();exit;}
if(isset($_GET["flow-month-graph1"])){flow_month_graph1();exit;}
if(isset($_GET["flow-month-graph2"])){flow_month_graph2();exit;}
if(isset($_GET["websites"])){websites_table();exit;}
if(isset($_GET["search-websites"])){websites_search();exit;}

if(isset($_GET["categories"])){categories_table();exit;}
if(isset($_GET["search-categories"])){categories_search();exit;}



js();


function js(){
	header("content-type: application/x-javascript");
$users = new usersMenus();
if (!$users->AsWebStatisticsAdministrator) {
    $tpl = new templates();
    echo FATAL_ERROR_SHOW_128("{ERROR_NO_PRIVS}");
    die;
}
if (isset($_GET["popup"])) {
    page();
    exit;
}
if (isset($_GET["tabs"])) {
    tabs();
    exit;
}
if (isset($_GET["flow"])) {
    flow();
    exit;
}
if (isset($_GET["flow-month-graph1"])) {
    flow_month_graph1();
    exit;
}
if (isset($_GET["flow-month-graph2"])) {
    flow_month_graph2();
    exit;
}
if (isset($_GET["websites"])) {
    websites_table();
    exit;
}
if (isset($_GET["search-websites"])) {
예제 #4
0
<?php

/* */
$rss_assoc = "http://www.croix-rouge.fr/fluxrss/view";
function flow($url_assoc)
{
    $feed_to_array = (array) simplexml_load_file($url_assoc);
    return $feed_to_array;
}
$rss = flow($rss_assoc);
?>

<!DOCTYPE html>
<html>
	<head>
		<title>Moniteur de charité</title>
		<meta name="author" content="Coffeed">
		<meta charset="UTF-8">
		<style type="text/css" media="screen">
	        body{ background:#000;color:#555;font-size:.9em;margin:0;padding:0; font:12px/16px "Helvetica Neue",Arial,sans-serif;}
	        #screen{ width:800px;height:480px;background:#FFF; }
	        #slogan{color: green;font-size: 40px;font-family: 'Lato', sans-serif;position:relative;top:50px;text-align: center;padding-right: 375px;}
	        #logo-assoc{height:100px;width:180px;position: absolute;top:160px;}
	        #logo-coffeed{position: relative;top:10px;left: 420px;}
	        #rss-assoc{top:370px;z-index: 1;position: absolute;font-family: 'Lato', sans-serif;padding-left:10px;font-size: 18px;color:#BBB;}
	        #time{ color:white;font-family: 'Lato', sans-serif;font-size: 20px;background-color: green;height:28px;padding-top: 9px;text-align: center; padding-right: 250px;}
	        .twitter-timeline{left:550px; top:0; position: absolute;}
	        #info{position: absolute;color:black;top:225px;font-size: 18px;font-family: 'Lato', sans-serif;line-height: 28px;padding-left:10px;}
	        #footer{height:110px;width: 800px;background-color: green;top:370px;position: absolute;color:white;}
	        h2{color:white;font-family: 'Lato', sans-serif;font-size: 24px;margin-top: 10px;}
	    </style>