Skip to content

Commit

Permalink
Merge branch 'master' of github.com:cbbrowne/Schemaverse
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Browne committed Mar 23, 2012
2 parents d6a61f8 + a943671 commit 5b3f4bf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sample_script.sql
Expand Up @@ -132,7 +132,12 @@ create temp table scout_movement (ship_id integer, target_speed integer, directi
insert into scout_movement (ship_id, target_speed, x, y, distance)
select ship_id, s.max_speed, l.destination[0]::integer, l.destination[1]::integer, s.location<->s.destination from scout_locations l, my_ship_data s where s.id = l.ship_id;

update scout_movement set target_speed = 100 where ((target_speed * target_speed)/(100 *2) > distance);
--- whoah, nelly!!!
update scout_movement
set target_speed = 100
where
((target_speed*target_speed)/200.0+1.5*target_speed+100) > distance;

perform move(ship_id, target_speed, NULL::integer, x, y) from scout_movement;

timediff := clock_timestamp() - laststep;
Expand Down

0 comments on commit 5b3f4bf

Please sign in to comment.