I hereby claim:
- I am kwkdesign on github.
- I am kwksilver (https://keybase.io/kwksilver) on keybase.
- I have a public key whose fingerprint is 9133 8EFE C32E 1CD8 53D4 6AD6 5586 F203 596B DD97
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
-- Schemaversus Cheat Sheet | |
-- Schemaversus.com | |
-- Scheaverse.com | |
-- https://github.com/Abstrct/schemaversus | |
-- View your player stats | |
SELECT * FROM my_player; | |
-- Create some ships on your home planet to mine some resources |
select row_number, ( case row_number % 12 | |
when 0 then 'Aethra' | |
when 1 then 'Mony' | |
when 2 then 'Semper' | |
when 3 then 'Voit' | |
when 4 then 'Lester' | |
when 5 then 'Rio' | |
when 6 then 'Zergon' | |
when 7 then 'Cannibalon' | |
when 8 then 'Omicron Persei' |
-- example image: http://imgur.com/9eGABd6 | |
/* | |
-- map generation variable declarations | |
r numeric; | |
a numeric; | |
b numeric; | |
turns int := 1; -- values >= 1 | |
arms int := 4; | |
loc point; | |
*/ |
insert into my_fleets ( name ) values ( 'main' ); | |
update my_fleets set | |
script_declarations = ' | |
my_player_id int := get_player_id( session_user ); | |
cash bigint; | |
ship record; | |
planet record; | |
target record; | |
', |
create or replace function pg_temp.rot13( string text ) | |
returns text as $rot13$ | |
begin | |
return translate( string, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', 'NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm' ); | |
end $rot13$ language plpgsql; |
select | |
100000::numeric radius, | |
0::numeric y, | |
0::numeric a, | |
0::numeric b, | |
( null )::point ta, | |
( null )::point tb, | |
0::numeric angle, | |
1::int i, | |
0::int cnt, |
-- while ( select count(1) from planet ) < ( select count(1) from player ) * 1.05 loop | |
while ( select count(1) from planet ) < 2000 loop | |
for new_planet in | |
select nextval( 'planet_id_seq' ) as id, | |
case ( random() * 11 )::integer % 12 | |
when 0 then 'Aethra_' || generate_series | |
when 1 then 'Mony_' || generate_series | |
when 2 then 'Semper_' || generate_series | |
when 3 then 'Voit_' || generate_series | |
when 4 then 'Lester_' || generate_series |
with max_xy as ( | |
select greatest( | |
max( abs( location_x ) ), | |
max( abs( location_y ) ) | |
) v | |
from planets | |
), | |
scale as ( | |
select m * ceil( v / m ) scale from ( | |
select 10 ^ floor( log( v ) ) m, v |
with max_xy as ( | |
select greatest( | |
max( abs( location_x ) ), | |
max( abs( location_y ) ) | |
) v | |
from planets | |
), | |
scale as ( | |
select m * ceil( v / m ) scale from ( | |
select 10 ^ floor( log( v ) ) m, v |