Skip to content

Commit

Permalink
Fix sein and clan
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-levan committed Nov 22, 2024
1 parent c8f2080 commit 35afd21
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/aura/p.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ def self.patp2dec(name)

def self.clan(who)
begin
name = patp2hex(who)
name = patp2dec(who)
puts name
rescue ArgumentError
raise "clan: not a valid @p"
end

wid = met(name, 3)
wid = met(3, name)
case wid
when (0..1) then "galaxy"
when 2 then "star"
Expand All @@ -53,17 +54,17 @@ def self.clan(who)

def self.sein(name)
begin
who = patp2hex(name)
who = patp2dec(name)
mir = clan(name)
rescue ArgumentError
raise "sein: not a valid @p"
end

res = case mir
when "galaxy" then who
when "star" then end_bits(who, 1, 3)
when "planet" then end_bits(who, 1, 4)
when "moon" then end_bits(who, 1, 5)
when "star" then end_bits(3, 1, who)
when "planet" then end_bits(4, 1, who)
when "moon" then end_bits(5, 1, who)
else 0
end
patp(res)
Expand Down

0 comments on commit 35afd21

Please sign in to comment.