The following warnings occurred:
Warning [2] Undefined variable $search_thread - Line: 60 - File: showthread.php(1617) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1617) : eval()'d code 60 errorHandler->error_callback
/showthread.php 1617 eval
Warning [2] Undefined variable $forumjump - Line: 89 - File: showthread.php(1617) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1617) : eval()'d code 89 errorHandler->error_callback
/showthread.php 1617 eval




Bludgeoning!
#1
Right, so here's my current code, very simple and could probably be shorter but this is easiest for me:

Spoiler:
rand=random(3)
nc= 0
th=0

while nc < 3
do
if rand==1
then
GHI_Message("You've drawn one Sword Card, worth one point.")
end
if rand==2
then
GHI_Message("You've drawn one Axe Card, worth two points.")
end
if rand==3
then
GHI_Message("You've drawn one Mace Card, worth three points.")
end
nc=nc+1
th=th+rand
rand=random(3)
end

if nc==3
then
GHI_Message("Your entire hand is worth "...th... "points.")
end

The error I get is the following:
[string "WowLua"]:26: ')' expected near '...'
“Without deviation from the norm, progress is not possible.”
― Frank Zappa
Reply
#2
Had an extra dot in there

Code:
rand=random(3)
nc= 0
th=0

while nc < 3
do
   if rand==1
   then
      GHI_Message("You've drawn one Sword Card, worth one point.")
   end
   if rand==2
   then
      GHI_Message("You've drawn one Axe Card, worth two points.")
   end
   if rand==3
   then
      GHI_Message("You've drawn one Mace Card, worth three points.")
   end
   nc=nc+1
   th=th+rand
   rand=random(3)
end

if nc==3
then
   GHI_Message("Your entire hand is worth "..th.." points.")
end
Reply




Users browsing this thread: 1 Guest(s)