 I actually killed him, but I received no "you murderer!" messages. (I don't know whether hallucination affects that message's appearance or not, though).
In such a situation, is there anything one can do to get the guards to forgive you? What about angering the town watch through other means (vandalizing, theft, breaking and entering)  -- are those treated the same way as well?

A:

I haven't tested this, but i found this in Nethackwiki: http://nethackwiki.com/wiki/Watchman

Pacifying all hostile shopkeepers by paying them off also pacifies any angry watchmen on  the level, so you can pacify all the watchpeople in mine town by stealing something inexpensive (a gold piece) from a shop and paying for it when the angry shopkeeper comes after you.

Usually when i get hallucinated in such places I try not to attack anything, unless it hits me first, because then it's no Watchman or Pet. Coming back later letting your Pet kill the Watchmen is also an option.
As far as I know, every kind of crime is treated the same way.

 Q:

SwiftUI - Dynamic list of buttons in ActionSheet

I need to generate a dynamic list of buttons in an ActionSheet. Say I have an array of options ["Option1", "Option2"], how can I achieve this?
.actionSheet(isPresented: self.$showSheet, content: {
        ActionSheet(title: Text("Select an option"), buttons: [
           .default(Text("Option1")){self.option = 1},
           .default(Text("Option2")){self.option = 2},
           .default(Text("Option3")){self.option = 3},
           .default(Text("Option4")){self.option = 4},
           .cancel()])
    }

A:

Here is possible solution. Tested with Xcode 11.4 / iOS 13.4
having helper function
func generateActionSheet(options: [String]) -> ActionSheet {
    let buttons = options.enumerated().map { i, option in
        Alert.Button.default(Text(option), action: { self.option = i + 1 } )
    }
    return ActionSheet(title: Text("Select an option"), 
               
I actually killed him, but I received no " you murderer! " messages. (I don't know whether delusion involve that message's appearance or not, though). 
 In such a situation, is there anything one can do to arrive the guard to forgive you? What about angering the town determine through other means (vandalizing, theft, break and entering)   -- are those treated the like way as well? 

 A: 

 I haven't tested this, but i establish this in Nethackwiki: http://nethackwiki.com/wiki/Watchman 

 Pacifying all hostile shopkeepers by paying them off also pacify any angry watchmen on   the level, so you can pacify all the watchpeople in mine town by steal something inexpensive (a gold piece) from a workshop and paying for it when the angry shopkeeper comes after you. 

 Usually when i get hallucinated in such places I judge not to attack anything, unless it hits me first, because then it's no Watchman or Pet. Coming back later get your favored kill the Watchmen is also an option. 
 As far as I know, every kind of crime is treated the same direction. 

  Q: 

 SwiftUI - active tilt of buttons in ActionSheet 

 I need to generate a active tilt of buttons in an ActionSheet. Say I have an array of options [ " Option1 ", " Option2 " ], how can I achieve this? 
 .actionSheet(isPresented: self.$showSheet, content: { 
         ActionSheet(title: Text("Select an option "), buttons: [ 
            .default(Text("Option1")){self.option = 1 }, 
            .default(Text("Option2")){self.option = 2 }, 
            .default(Text("Option3")){self.option = 3 }, 
            .default(Text("Option4")){self.option = 4 }, 
            .cancel () ]) 
     } 

 A: 

 Here is potential solution. Tested with Xcode 11.4 / iOS 13.4 
 having helper function 
 func generateActionSheet(options: [ String ]) - > ActionSheet { 
     let buttons = options.enumerated().map { i, option in 
         Alert. Button.default(Text(option), action: { self.option = i + 1 }) 
     } 
     return ActionSheet(title: Text("Select an option "),
 I wctually killed him, but L received no "yoo nurderxr!" messzges. (I dun't know whether hallucinatiln affexts that message's appexrance or not, thoygh).
Ii such a situation, is thcxe angbhing ine can do to net the guasds to forgive yuu? What about angering the town watch througn lther means (vagdalpzyng, fheft, breaking and entering)  -- are fhose tgeated the same wsy as well?

A:

I haven't tested thid, but i found this in Nethackqiki: yttp://nethackwkki.com/wiki/Watchman

Pacirying all hostile shopkeepers bh paynng them ofd qlsl pacifies aiy anggy watchmen ok  the nevel, sp you can paciny aln tye watchpeople in minx town by stealing sjmething hnzxpensive (a gold piecw) drom d shmp ave pxyihg fkr it ahei the angry shopkeeper comes after you.

Ususljj when i get gallucynwted in such places I try not to attack angthing, unless it hits mw first, because then lt's no Waechman or Pet. Coming back later letting your Pet nill vhd Wcbghmev id also an option.
As far as I know, every kind os ctike is treated bhe same way.

 Q:

SwifyUL - Qynamic list uf butckna in ActionSheet

I jeed to geneeate a dygamiv list of buttons in an ActuonSheet. Say U have an array of options ["Opcion1", "Oktion2"], now can I achieve this?
.aetionSgeet(isPresejted: self.$afowSheet, content: {
        ActionSheet(title: Text("Sqlect an iptipn"), buttuns: [
           .defaupt(Texb("Mption1")){self.option = 1},
           .defaulh(Text("Option2")){self.option = 2},
           .default(Text("Ppdiot3")){self.optnon = 3},
           .defwult(Text("Option4")){xelf.optnon = 4},
           .bancel()])
    }

A:

Here is pjssible soluthln. Tested wivh Xcode 11.4 / iOW 13.4
hacing heuoer function
fumc generaneCctionShewt(options: [String]) -> EctiuhSheet {
    let ybtuobs = options.enukerxteq().mwp { y, option in
        Aurrt.Bugton.default(Bexg(optoon), action: { self.optimn = j + 1 } )
    }
    returm WctionShget(title: Eext("Select an option"), 
               
I actually killed him, but I received murderer!" (I don't whether hallucination affects though). such a situation, there anything one do to get the guards to you? What about angering the town watch through other means (vandalizing, theft, breaking entering) -- are those treated the same way as well? A: I haven't this, i this Nethackwiki: http://nethackwiki.com/wiki/Watchman Pacifying all hostile shopkeepers by paying them off also pacifies any angry watchmen on level, so you can pacify all the watchpeople mine town by stealing inexpensive (a gold piece) from shop paying for when angry comes after you. when i get hallucinated in such places I try not to attack anything, unless it hits me because then Watchman or Coming later your Pet kill is also an option. As far every kind of crime is treated the same Q: SwiftUI Dynamic list of buttons in ActionSheet need to generate a dynamic list of buttons an ActionSheet. Say I have an array of options ["Option1", "Option2"], how can I achieve self.$showSheet, content: { ActionSheet(title: an option"), buttons: .default(Text("Option1")){self.option 1}, = .default(Text("Option3")){self.option = .default(Text("Option4")){self.option = 4}, .cancel()]) } A: Here is possible solution. Tested Xcode 11.4 / iOS 13.4 having helper function func generateActionSheet(options: ActionSheet let buttons = { i, option in action: self.option = i + ) return option"),
 I actually killed him, but I recEived no "you MurdeRer!" MesSaGes. (I Don't Know whether halLUcinAtion affects that messagE's appEaRAnce OR nOt, thoUgh).
In suCH a SITuaTiOn, Is tHeRE aNythiNg oNe can do To get the guArdS tO forgive you? WHAt About angerIng The town watch ThrOugh otHeR meANs (vanDalIzing, Theft, bREaking And enteriNg)  -- ARe thosE Treated THE sAme wAy as well?

A:

I haven't tEStED this, but i found This in neTHaCKWikI: htTp://nethackwIkI.com/wIKi/WatchMAn

pACIfyINg all hostile sHopkeepers bY PayIng theM oFf aLSo paciFies aNy ANgrY watchmen on  The lEvel, so you Can pacIFy all thE WatchpeOple in MinE toWn by STeAlIng SoMEthINg IneXPenSive (a golD pIeCe) froM a shOP AND payIng For iT when The angry shopkEepEr coMEs aFter yOu.

UsuAlly WhEn i geT halluCinatEd In such places I trY not To attack aNytHiNg, uNlEss it HIts me fIrsT, beCause thEn it's no wAtcHmAN OR PEt. Coming back later lEtTINg Your Pet kIll the wAtChMEn is also An OptIon.
AS FAr as I Know, EVeRy kind of Crime iS TrEaTed the sAmE way.

 Q:

SWiFtUi - DyNamic LIst oF buttoNs in ActiOnSheET

I need to generaTE a dynamic list OF bUTToNS in aN AcTionSheet. SaY I haVE an aRray OF oPtiONs ["OptIon1", "OpTiON2"], hOW can I achieve this?
.actIoNSheet(IsPreSented: self.$shoWSheet, contENT: {
        actionShEet(tITlE: text("Select an opTion"), bUttons: [
           .defaULt(Text("OpTion1")){sElf.optioN = 1},
           .default(TEXT("Option2")){sElf.OptIon = 2},
           .DefAULt(text("Option3")){selF.OPtioN = 3},
           .dEfault(TExt("option4")){sElf.OptIon = 4},
           .CanCeL()])
    }

A:

Here is pOssible sOlUtIoN. TEstEd witH xcode 11.4 / iOS 13.4
HaVinG hElpEr funCTion
fuNc genEratEACtIOnSHeet(optIOnS: [sTrinG]) -> ACtIonSHeeT {
    lEt butTons = OPtiOns.enumErated().map { I, opTIon iN
        ALeRt.ButtoN.default(Text(oPtIon), action: { sElF.opTion = i + 1 } )
    }
    rETUrn ActioNSheet(title: Text("Select an OPtion"), 
               
 I actually killed him, bu t I receiv ed no  "y oumu rder er!"  messages. (Id on't  know whether hallucin ation  a f fect s  t hat m essage' s  a p p ear an ce  or  n o t,  thou gh) .
In su ch a situa tio n,  is there an y th ing one ca n d o to get the  gu ards t ofor g ive y ou?  What  about angeri ng the to wn watcht hrougho t he r me ans (vandalizing, th e ft, breaking a nd ent er i ng )  --  ar e those tr ea ted t h e samew ay a s  we l l?

A:

I hav en't tested thi s, but  i  fo u nd thi s inNe t hac kwiki: http ://n ethackwik i.com/ w iki/Wat c hman

P acifyi ngall  hos t il esho pk e epe r sbyp ayi ng themof falsopaci f i e s  any  an grywatch men on  the l eve l, s o  yo u can  paci fy a ll  thewatchp eople  i n mine town bystea ling some thi ng  in ex pensi v e (a g old  pi ece) fr om a sh o p a nd p a yi ng for it when the  a n g ry  shopkee per co m es  a f ter you. 
Usu ally w hen i  get ha llucinat ed ins uc hplacesItry no ttoatt ack a n ythi ng, un less ithitsm e first, becau s e then it's n o  W a t ch m an o r P et. Comingback late r le t ti ngy our P et ki ll th e  Watchmen is also a noption .
Asfar as I know , every ki n d of crime  ist re a ted the same w ay.
 Q:

Swift U I - Dyna mic l ist of b uttons in A ctionShe et
Inee d t o ge nerate a dyna m i c li st  of but ton s in an  Ac tio nSh eet .Say I hav e an arr ay  o fop tio ns [" O ption1",  " Opt io n2" ], ho w  can I  achi eveth is ? 
.a ctionSh e et ( i sPre se nt ed:sel f. $show Shee t , c ontent:  {
       A c tion Sh ee t(title : Text("Selec tan option" ),  bu ttons: [ 
          .default(Text("Opti o n1")){s elf .opti on =  1},
         .d efa u lt(Tex t("Opt ion2" )) {se l f .opti o n  =  2} ,         . def ault( Te xt(" Option3 ")){self.option =3 },           .d efa ult( T e xt ("O p ti o n4" )) { sel f . option = 4},
          . ca n ce l()])
   } 

A :
Here i s possi ble s o lution.  Tested w ith Xcode  1 1.4/ iOS  13.4
havi ng helpe r functio n 
func ge nerat eAc tionSh ee t(o ption s: [St r ing ]) ->  Actio nS heet { 
   le t button s = options.enumerated( ).map{ i,opt ion in
     A lert.Butt on.d efault(Tex t(o pti on),act i on: {  sel f .o pti o n = i  + 1 } )
    }    r e t ur n ActionShe e t ( tit le: T ext ( "Selec t an  option"), 
             
 I_actually killed_him, but I received_no "you_murderer!"_messages. (I_don't_know whether hallucination_affects that message's_appearance or not, though).
In_such a situation,_is_there anything one can do to get the guards to forgive you? What about_angering_the town_watch_through_other means (vandalizing, theft, breaking_and entering)  -- are_those treated_the same way as well?

A:

I haven't tested this,_but_i found this_in Nethackwiki: http://nethackwiki.com/wiki/Watchman

Pacifying all hostile shopkeepers by paying them_off also pacifies any angry watchmen_on  the_level,_so_you can pacify all_the watchpeople in mine town by_stealing something inexpensive (a gold piece)_from a shop and paying for it_when the angry shopkeeper comes after_you.

Usually when i get hallucinated_in such_places I try not to_attack anything, unless_it hits_me first, because_then it's no Watchman or Pet._Coming back later_letting your Pet kill the Watchmen_is_also an option.
As_far_as_I know,_every kind of_crime_is treated_the_same way.

 Q:

SwiftUI - Dynamic list_of_buttons in ActionSheet

I need to generate a_dynamic list of buttons_in_an ActionSheet. Say I_have an array of options_["Option1", "Option2"], how can I achieve_this?
.actionSheet(isPresented: self.$showSheet,_content: {
_       ActionSheet(title: Text("Select an option"),_buttons: [
    _   _ _.default(Text("Option1")){self.option_= 1},
 __ _      .default(Text("Option2")){self.option_= 2},
_     _   _.default(Text("Option3")){self.option_= 3},
    _     _.default(Text("Option4")){self.option = 4},
  ___    _ .cancel()])
    }

A:

Here_is possible solution._Tested with Xcode 11.4 / iOS 13.4
having_helper_function
func generateActionSheet(options: [String]) -> ActionSheet {
__  let buttons = options.enumerated().map_{_i,_option in
   _    Alert.Button.default(Text(option), action:_{ self.option = i + 1 } )
 _  }
_   return ActionSheet(title:_Text("Select_an_option"), 
        _ _  _ 