erreur sur final_hash et modif block2.sh
This commit is contained in:
@@ -50,9 +50,11 @@ for($i=0; $i<$nb_max; $i++)
|
|||||||
$the_block = blockchain::getBlockWithHash($block_hash);
|
$the_block = blockchain::getBlockWithHash($block_hash);
|
||||||
if ($the_block === FALSE) die();
|
if ($the_block === FALSE) die();
|
||||||
|
|
||||||
$hash=DATA_PATH.'/hashes/'.$the_block->hash.'.png';
|
|
||||||
$block_hash = $the_block->prev_block;
|
$block_hash = $the_block->prev_block;
|
||||||
|
|
||||||
|
$hash=DATA_PATH.'/hashes/'.$the_block->hash.'.png';
|
||||||
|
if ($final_hash == 'default') $final_hash = $hash;
|
||||||
|
|
||||||
if (file_exists($hash))
|
if (file_exists($hash))
|
||||||
{
|
{
|
||||||
$src_img = imagecreatefrompng($hash);
|
$src_img = imagecreatefrompng($hash);
|
||||||
|
|||||||
@@ -59,7 +59,16 @@ while IFS='' read -r line || [[ -n "$line" ]]; do
|
|||||||
#
|
#
|
||||||
# CHOISIR UNE METHODE2 AU HASARD
|
# CHOISIR UNE METHODE2 AU HASARD
|
||||||
#
|
#
|
||||||
for METHODE in `ls $APPS_PATH/methode2 | grep -v robot | shuf | head -n 1`
|
# LISTE_METHODE=`ls $APPS_PATH/methode2 | grep -v robot | shuf`
|
||||||
|
# LISTE_METHODE=`ls $APPS_PATH/methode2 | grep -v robot | shuf | head -n 1`
|
||||||
|
# en rajoutant le head, on ne fait qu'un seul dessin
|
||||||
|
LISTE_METHODE=`ls $APPS_PATH/methode2 | grep -v robot | shuf | head -n 1`
|
||||||
|
if [ $HEIGHT -eq 1 ]
|
||||||
|
then
|
||||||
|
LISTE_METHODE=`ls $APPS_PATH/methode2 | grep -v treemap | grep -v robot | shuf | head -n 1`
|
||||||
|
fi
|
||||||
|
|
||||||
|
for METHODE in $LISTE_METHODE
|
||||||
do
|
do
|
||||||
if [ ! -d $DATA_PATH/$METHODE ]
|
if [ ! -d $DATA_PATH/$METHODE ]
|
||||||
then
|
then
|
||||||
@@ -71,6 +80,7 @@ while IFS='' read -r line || [[ -n "$line" ]]; do
|
|||||||
cd $APPS_PATH/methode2
|
cd $APPS_PATH/methode2
|
||||||
php robot.php $METHODE $BLOCK $((RANDOM % 6)) $2
|
php robot.php $METHODE $BLOCK $((RANDOM % 6)) $2
|
||||||
cp $DATA_PATH/last/$BLOCK.png $DATA_PATH/$METHODE/$BLOCK.png
|
cp $DATA_PATH/last/$BLOCK.png $DATA_PATH/$METHODE/$BLOCK.png
|
||||||
|
cd - >> /dev/null
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user