chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.main.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
28256e2
)
Fix to make example2 work
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Tue, 9 Jun 2009 13:19:25 +0000
(14:19 +0100)
committer
Ian Jackson
<Ian.Jackson@eu.citrix.com>
Tue, 9 Jun 2009 13:19:25 +0000
(14:19 +0100)
pctb/yppsc-decode-marketdata
patch
|
blob
|
history
diff --git
a/pctb/yppsc-decode-marketdata
b/pctb/yppsc-decode-marketdata
index 787790c4a1349bfccd98898481d70975f870bb3c..e8f0ef0b3df447ba306e2ca90871a317f7914936 100755
(executable)
--- a/
pctb/yppsc-decode-marketdata
+++ b/
pctb/yppsc-decode-marketdata
@@
-45,7
+45,7
@@
sub inmap($\@$) {
my ($what,$ary,$ix) = @_;
my $got= $ary->[$ix];
return $got if defined $got;
my ($what,$ary,$ix) = @_;
my $got= $ary->[$ix];
return $got if defined $got;
-
warn
"$what $ix ?";
+
die
"$what $ix ?";
}
}
@@
-67,9
+67,10
@@
unshift @stalls, undef;
$|=1;
foreach $bs qw(Buy Sell) {
$|=1;
foreach $bs qw(Buy Sell) {
- $ncommods= getint("Buy ncommods");
- for ($commodnum=0; $commodnum<$ncommods; $commodnum++) {
- $commodix= getint("Buy $commodnum commodix");
+ $alloffers_want= getint("Buy ncommods");
+ $alloffers_done=0;
+ while ($alloffers_done < $alloffers_want) {
+ $commodix= getint("Buy $alloffers_done/$alloffers_want commodix");
$offers= getint("Buy $commodnum offers");
for ($offernum=0; $offernum<$offers; $offernum++) {
$stallix= getint("Buy $commodnum $offernum stallix");
$offers= getint("Buy $commodnum offers");
for ($offernum=0; $offernum<$offers; $offernum++) {
$stallix= getint("Buy $commodnum $offernum stallix");
@@
-83,6
+84,8
@@
foreach $bs qw(Buy Sell) {
printf("\t%d\t%d", $price, $qty) or die $!;
if ($bs eq 'Buy') { print "\t\t" or die $!; }
print "\n" or die $!;
printf("\t%d\t%d", $price, $qty) or die $!;
if ($bs eq 'Buy') { print "\t\t" or die $!; }
print "\n" or die $!;
+ $alloffers_done++;
+ die if $alloffers_done > $alloffers_want;
}
}
}
}
}
}