Hi Erich and Alain,
Your conversation about a "logic" level got me interested in trying to make
one. The attached level is not quite what you were talking about but it seems
to work after a fashion. The real problem seems to be reading the clues as
they race past the document viewing area but this is the only way I could thing
of presenting the text. I used the mentioned logic problem of the Kings and
their nick names as a test. I hope I got the right solution. The level is for
Enigma 1.10.
As always, any comments, suggestions and critiques would be welcome.
Enjoy,
Ray
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<el:level xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://enigma-game.org/schema/level/1 level.xsd" xmlns:el="http://enigma-game.org/schema/level/1">
<el:protected>
<el:info el:type="level">
<el:identity el:title="Logic 001" el:subtitle="Logic 001" el:id="RayWick016_1-0_1-10"/>
<el:version el:score="1" el:release="1" el:revision="0" el:status="experimental"/>
<el:author el:name="Ray Wick" el:email="rayrw...@aol.com" el:homepage=""/>
<el:copyright>Copyright © 2009 Ray Wick</el:copyright>
<el:license el:type="GPL v2.0 or above" el:open="true"/>
<el:compatibility el:enigma="1.10">
<el:dependency el:path="lib/liblua" el:id="lib/liblua" el:release="1" el:preload="true"/>
</el:compatibility>
<el:modes el:easy="true" el:single="true" el:network="false"/>
<el:comments>
<el:code>Lua 5.1 and XML (copied from Level administrators) revised 08-13-09 by Ray Wick</el:code>
</el:comments>
<el:score el:easy="-" el:difficult="-"/>
</el:info>
<el:luamain><![CDATA[
-- ### Logic 001 ######################################################################################
-- === Comments =======================================================================================
-- The facts, clues and solution coordinates could be changed to present any logic problem of this
-- size or smaller. Several puzzles could be defined and a random number generator used to
-- choose which one to display each time the level is started.
-- ### functions ######################################################################################
function test(onoff, sender) -- These are the rules for testing coin positions
if (onoff==false) then return end
count = 0
if (po["coin1"] == po(x1, y1) or po["coin2"] == po(x1, y1) or po["coin3"] == po(x1, y1) or po["coin4"] == po(x1, y1) or po["coin5"] == po(x1, y1)) then count = count + 1 end
if (po["coin1"] == po(x2, y2) or po["coin2"] == po(x2, y2) or po["coin3"] == po(x2, y2) or po["coin4"] == po(x2, y2) or po["coin5"] == po(x2, y2)) then count = count + 1 end
if (po["coin1"] == po(x3, y3) or po["coin2"] == po(x3, y3) or po["coin3"] == po(x3, y3) or po["coin4"] == po(x3, y3) or po["coin5"] == po(x3, y3)) then count = count + 1 end
if (po["coin1"] == po(x4, y4) or po["coin2"] == po(x4, y4) or po["coin3"] == po(x4, y4) or po["coin4"] == po(x4, y4) or po["coin5"] == po(x4, y4)) then count = count + 1 end
if (po["coin1"] == po(x5, y5) or po["coin2"] == po(x5, y5) or po["coin3"] == po(x5, y5) or po["coin4"] == po(x5, y5) or po["coin5"] == po(x5, y5)) then count = count + 1 end
if (count == 5) then no["door_l"]:open() else wo[po(19, 9)] = {"it_document", text="textN4"} end
end
function pins(onoff, sender) -- This generates pins that can be used to mark eliminated possibilities.
wo[po(19, 1)] = {"it_pin"}
end
-- ### Some variables used to define strings for "it_document"s #######################################
-- === facts ==========================================================================================
-- Each column and row has a fact assigned to it.
fact1 = "fact1"
fact2 = "fact2"
fact3 = "fact3"
fact4 = "fact4"
fact5 = "fact5"
fact6 = "fact6"
fact7 = "fact7"
fact8 = "fact8"
fact9 = "fact9"
fact10 = "fact10"
fact11 = "fact11"
fact12 = "fact12"
fact13 = "fact13"
fact14 = "fact14"
fact15 = "fact15"
fact16 = "fact16"
fact17 = "fact17"
fact18 = "fact18"
fact19 = "fact19"
fact20 = "fact20"
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- === clues ==========================================================================================
-- There are provisions for up to 20 clues.
-- A clue with the value of "none" will not appear in the puzzle.
clue0 = "clue0"
clue1 = "clue1"
clue2 = "clue2"
clue3 = "clue3"
clue4 = "clue4"
clue5 = "clue5"
clue6 = "clue6"
clue7 = "clue7"
clue8 = "none"
clue9 = "none"
clue10 = "none"
clue11 = "none"
clue12 = "none"
clue13 = "none"
clue14 = "none"
clue15 = "none"
clue16 = "none"
clue17 = "none"
clue18 = "none"
clue19 = "none"
clue20 = "none"
-- ### Solution coordinates ###########################################################################
x1 = 1
x2 = 2
x3 = 3
x4 = 4
x5 = 5
y1 = 5
y2 = 4
y3 = 1
y4 = 3
y5 = 2
-- ### Tile definitions ###############################################################################
ti[" "] = {"fl_sahara"}
ti["F2"] = {"fl_sahara_framed"}
ti["F1"] = {"fl_sand_framed"}
ti[" @"] = {"st_oxyd", flavor="b"}
ti[" P"] = {"st_fourswitch", name="pin1", action="callback", target="pins"}
ti[" G"] = {"st_lightglass_hollow"}
ti["GG"] = {"st_lightglass"}
ti["TT"] = {"it_trigger", "trigger_1", invisible=0, action="callback", target="test"}
ti["DD"] = {"st_door_d", "door_l", faces="ns"}
ti["$1"] = ti[" "] .. {"it_coin_l", "coin1"}
ti["$2"] = ti[" "] .. {"it_coin_l", "coin2"}
ti["$3"] = ti[" "] .. {"it_coin_l", "coin3"}
ti["$4"] = ti[" "] .. {"it_coin_l", "coin4"}
ti["$5"] = ti[" "] .. {"it_coin_l", "coin5"}
ti["N0"] = ti[" "] .. {"it_document", text="textN0"}
ti["N1"] = ti[" "] .. {"it_document", text="textN1"}
ti["N2"] = ti[" "] .. {"it_document", text="textN2"}
ti["N3"] = ti[" "] .. {"it_document", text="textN3"}
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
ti["tA"] = ti[" G"] .. {"it_document", text=fact1}
ti["SA"] = ti["tA"] .. {"fl_brick"}
ti["tB"] = ti[" G"] .. {"it_document", text=fact2}
ti["SB"] = ti["tB"] .. {"fl_gravel"}
ti["tC"] = ti[" G"] .. {"it_document", text=fact3}
ti["SC"] = ti["tC"] .. {"fl_himalaya"}
ti["tD"] = ti[" G"] .. {"it_document", text=fact4}
ti["SD"] = ti["tD"] .. {"fl_dunes"}
ti["tE"] = ti[" G"] .. {"it_document", text=fact5}
ti["SE"] = ti["tE"] .. {"fl_concrete"}
ti["tF"] = ti[" G"] .. {"it_document", text=fact6}
ti["SF"] = ti["tF"] .. {"fl_hay"}
ti["tG"] = ti[" G"] .. {"it_document", text=fact7}
ti["SG"] = ti["tG"] .. {"fl_bast"}
ti["tH"] = ti[" G"] .. {"it_document", text=fact8}
ti["SH"] = ti["tH"] .. {"fl_adhesionless", adhesion=4, friction=10, mousefactor=4}
ti["tI"] = ti[" G"] .. {"it_document", text=fact9}
ti["SI"] = ti["tI"] .. {"fl_metal"}
ti["tJ"] = ti[" G"] .. {"it_document", text=fact10}
ti["SJ"] = ti["tJ"] .. {"fl_plank"}
ti["tK"] = ti[" G"] .. {"it_document", text=fact11}
ti["SK"] = ti["tK"] .. {"fl_pinkbumps"}
ti["tL"] = ti[" G"] .. {"it_document", text=fact12}
ti["SL"] = ti["tL"] .. {"fl_wood"}
ti["tM"] = ti[" G"] .. {"it_document", text=fact13}
ti["SM"] = ti["tM"] .. {"fl_lawn"}
ti["tN"] = ti[" G"] .. {"it_document", text=fact14}
ti["SN"] = ti["tN"] .. {"fl_red"}
ti["tO"] = ti[" G"] .. {"it_document", text=fact15}
ti["SO"] = ti["tO"] .. {"fl_dark"}
ti["tP"] = ti[" G"] .. {"it_document", text=fact16}
ti["SP"] = ti["tP"] .. {"fl_pinkbumps"}
ti["tQ"] = ti[" G"] .. {"it_document", text=fact17}
ti["SQ"] = ti["tQ"] .. {"fl_wood"}
ti["tR"] = ti[" G"] .. {"it_document", text=fact18}
ti["SR"] = ti["tR"] .. {"fl_lawn"}
ti["tS"] = ti[" G"] .. {"it_document", text=fact19}
ti["SS"] = ti["tS"] .. {"fl_red"}
ti["tT"] = ti[" G"] .. {"it_document", text=fact20}
ti["ST"] = ti["tT"] .. {"fl_dark"}
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
ti["C0"] = ti[" "] .. {"it_document", text=clue0}
if (clue1=="none") then ti["C1"] = ti[" "] else ti["C1"] = ti[" "] .. {"it_document", text=clue1} end
if (clue2=="none") then ti["C2"] = ti[" "] else ti["C2"] = ti[" "] .. {"it_document", text=clue2} end
if (clue3=="none") then ti["C3"] = ti[" "] else ti["C3"] = ti[" "] .. {"it_document", text=clue3} end
if (clue4=="none") then ti["C4"] = ti[" "] else ti["C4"] = ti[" "] .. {"it_document", text=clue4} end
if (clue5=="none") then ti["C5"] = ti[" "] else ti["C5"] = ti[" "] .. {"it_document", text=clue5} end
if (clue6=="none") then ti["C6"] = ti[" "] else ti["C6"] = ti[" "] .. {"it_document", text=clue6} end
if (clue7=="none") then ti["C7"] = ti[" "] else ti["C7"] = ti[" "] .. {"it_document", text=clue7} end
if (clue8=="none") then ti["C8"] = ti[" "] else ti["C8"] = ti[" "] .. {"it_document", text=clue8} end
if (clue9=="none") then ti["C9"] = ti[" "] else ti["C9"] = ti[" "] .. {"it_document", text=clue9} end
if (clue10=="none") then ti["Ca"] = ti[" "] else ti["Ca"] = ti[" "] .. {"it_document", text=clue10} end
if (clue11=="none") then ti["Cb"] = ti[" "] else ti["Cb"] = ti[" "] .. {"it_document", text=clue11} end
if (clue12=="none") then ti["Cc"] = ti[" "] else ti["Cc"] = ti[" "] .. {"it_document", text=clue12} end
if (clue13=="none") then ti["Cd"] = ti[" "] else ti["Cd"] = ti[" "] .. {"it_document", text=clue13} end
if (clue14=="none") then ti["Ce"] = ti[" "] else ti["Ce"] = ti[" "] .. {"it_document", text=clue14} end
if (clue15=="none") then ti["Cf"] = ti[" "] else ti["Cf"] = ti[" "] .. {"it_document", text=clue15} end
if (clue16=="none") then ti["Cg"] = ti[" "] else ti["Cg"] = ti[" "] .. {"it_document", text=clue16} end
if (clue17=="none") then ti["Ch"] = ti[" "] else ti["Ch"] = ti[" "] .. {"it_document", text=clue17} end
if (clue18=="none") then ti["Ci"] = ti[" "] else ti["Ci"] = ti[" "] .. {"it_document", text=clue18} end
if (clue19=="none") then ti["Cj"] = ti[" "] else ti["Cj"] = ti[" "] .. {"it_document", text=clue19} end
if (clue20=="none") then ti["Ck"] = ti[" "] else ti["Ck"] = ti[" "] .. {"it_document", text=clue20} end
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
ti[" *"] = ti["C0"] .. {"#ac_marble_black"}
wo(ti, " ", {
" @SFSGSHSISJ SKSLSMSNSO$1$2$3$4$5N1N2 P",
"SAF1F1F1F1F1 F2F2F2F2F2 ",
"SBF1F1F1F1F1 F2F2F2F2F2 N0 ",
"SCF1F1F1F1F1 F2F2F2F2F2 C1 Cb ",
"SDF1F1F1F1F1 F2F2F2F2F2 C2 Cc ",
"SEF1F1F1F1F1 F2F2F2F2F2 C3 Cd ",
" C4 Ce ",
"SPF2F2F2F2F2 C5 Cf ",
"SQF2F2F2F2F2 C6 Cg ",
"SRF2F2F2F2F2 * C7 Ch ",
"SSF2F2F2F2F2 C8 Ci N3TT",
"STF2F2F2F2F2 C9 Cj GGDD",
" Ca Ck GG @"})
wo:shuffleOxyd()
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
]]></el:luamain>
<el:i18n>
<el:string el:key="title">
<el:english el:translate="false"/>
</el:string>
<el:string el:key="subtitle">
<el:english el:translate="true"/>
</el:string>
<el:string el:key="textN0">
<el:english el:translate="true">You might want to write down the clues below for future reference.</el:english>
</el:string>
<el:string el:key="textN1">
<el:english el:translate="true">The coins at the left must be placed on the row and column junction of each King and his matching Nick Name for a solution.</el:english>
</el:string>
<el:string el:key="textN2">
<el:english el:translate="true">Hit the stone at the right to generate pins to mark negative deductions.</el:english>
</el:string>
<el:string el:key="textN3">
<el:english el:translate="true">Step on the trigger at the right to test your placement of coins and open the door.</el:english>
</el:string>
<el:string el:key="textN4">
<el:english el:translate="true">Sorry, try another solution.</el:english>
</el:string>
<el:string el:key="fact1">
<el:english el:translate="true">The row to the right represents King Robert.</el:english>
</el:string>
<el:string el:key="fact2">
<el:english el:translate="true">The row to the right represents King Edward.</el:english>
</el:string>
<el:string el:key="fact3">
<el:english el:translate="true">The row to the right represents King James.</el:english>
</el:string>
<el:string el:key="fact4">
<el:english el:translate="true">The row to the right represents King William.</el:english>
</el:string>
<el:string el:key="fact5">
<el:english el:translate="true">The row to the right represents King O-Helred.</el:english>
</el:string>
<el:string el:key="fact6">
<el:english el:translate="true">The column below represents nick name "Unprepared".</el:english>
</el:string>
<el:string el:key="fact7">
<el:english el:translate="true">The column below represents nick name "Campaigner".</el:english>
</el:string>
<el:string el:key="fact8">
<el:english el:translate="true">The column below represents nick name "Brute".</el:english>
</el:string>
<el:string el:key="fact9">
<el:english el:translate="true">The column below represents nick name "Pierce-Arrow".</el:english>
</el:string>
<el:string el:key="fact10">
<el:english el:translate="true">The column below represents nick name "In-law".</el:english>
</el:string>
<el:string el:key="fact11">
<el:english el:translate="true">The column below represents death by Dragons.</el:english>
</el:string>
<el:string el:key="fact12">
<el:english el:translate="true">The column below represents death by English.</el:english>
</el:string>
<el:string el:key="fact13">
<el:english el:translate="true">The column below represents death by Hunting.</el:english>
</el:string>
<el:string el:key="fact14">
<el:english el:translate="true">The column below represents death by Poison.</el:english>
</el:string>
<el:string el:key="fact15">
<el:english el:translate="true">The column below represents death by Plague.</el:english>
</el:string>
<el:string el:key="fact16">
<el:english el:translate="true">The row to the right represents death by Dragons.</el:english>
</el:string>
<el:string el:key="fact17">
<el:english el:translate="true">The row to the right represents death by English.</el:english>
</el:string>
<el:string el:key="fact18">
<el:english el:translate="true">The row to the right represents death by Hunting.</el:english>
</el:string>
<el:string el:key="fact19">
<el:english el:translate="true">The row to the right represents death by Poison.</el:english>
</el:string>
<el:string el:key="fact20">
<el:english el:translate="true">The row to the right represents death by Plague.</el:english>
</el:string>
<el:string el:key="clue0">
<el:english el:translate="true">Logic Puzzle one, King's nick Names.</el:english>
</el:string>
<el:string el:key="clue1">
<el:english el:translate="true">The five kings were: Robert, James, the one known as "the Campaigner", the one killed in a hunting accident, and the one who died from the plague.</el:english>
</el:string>
<el:string el:key="clue2">
<el:english el:translate="true">O-helred (who was not known as the In-law), Pierce-Arrow, and the king killed by dragons were all 3rd cousins.</el:english>
</el:string>
<el:string el:key="clue3">
<el:english el:translate="true">Neither dragons nor the English killed Edward nor the Unprepared.</el:english>
</el:string>
<el:string el:key="clue4">
<el:english el:translate="true">Pierce-Arrow was the only king to share an initial with his means of death.</el:english>
</el:string>
<el:string el:key="clue5">
<el:english el:translate="true">O-helred was frightened as a youth by a wild boar. Consequently, he avoided the hunt at all costs.</el:english>
</el:string>
<el:string el:key="clue6">
<el:english el:translate="true">Robert the Brute was not poisoned.</el:english>
</el:string>
<el:string el:key="clue7">
<el:english el:translate="true">William's death held political reasons.</el:english>
</el:string>
</el:i18n>
</el:protected>
</el:level>
_______________________________________________
Enigma-devel mailing list
Enigma-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/enigma-devel