| |
| |
| |
|
Page: 1 2 3 4 5 6 7
Comments:
<0> :) <1> erm <1> maybe this <1> ;set mylist(1) [list]; set mylist(2) [list]; foreach {first second} list { lappend mylist(1) $first; lappend mylist(2) $second; } <2> [GRiMMY]: #61 (373 clicks) Tcl: <1> puts $mylist(1) <1> ;puts $mylist(1) <2> [GRiMMY]: #62 (stdout) list <2> [GRiMMY]: #63 (stdout) list <1> ;set mylist(1) [list]; set mylist(2) [list]; foreach {first second} $list { lappend mylist(1) $first; lappend mylist(2) $second; } <2> [GRiMMY]: #64 (446 clicks) Tcl: <1> ;puts $mylist(1) <3> .set bleh 1 ;foreach num $list { if {$bleh == 1} { puts [expr $multiply * $num] ; set bleh 0 } else { set bleh 1} } <2> [GRiMMY]: #65 (stdout) 3 3 1 <3> boo <1> lol
<3> grims i cant remember my uname for that damn site <1> uname? site? <3> i gotta try mail.yahoo <3> uname username <1> lol <3> site = poker <1> just sign up again =) <1> lol <3> lol <3> duh <4> tztzt <3> damn dice . com keeps trying too get me too narq0 <1> set array answer {1 1 2 1} foreach {first second} $list { set answer(1) [expr {$first * $answer(1)}]; set answer(2) [expr {$first * $answer(2)}]; }; puts $answer(1) <1> ;array set answer {1 1 2 1} foreach {first second} $list { set answer(1) [expr {$first * $answer(1)}]; set answer(2) [expr {$first * $answer(2)}]; }; puts $answer(1) <2> [GRiMMY]: #82 (368 clicks) Tcl error: wrong # args: should be "array set arrayName list" <1> ;array set answer {1 1 2 1}; foreach {first second} $list { set answer(1) [expr {$first * $answer(1)}]; set answer(2) [expr {$first * $answer(2)}]; }; puts $answer(1) <2> [GRiMMY]: #83 (stdout) 9 <1> 9 = 3 * 3 * 1 <1> =) <3> my .tcl works not sure why safetcl dont like it ;p <3> that or eggie is lying too me <4> ;proc funkycalc { list num } { <4> set pre "[string repeat "- " [incr num -1]]var" <4> set result 1 <4> foreach $pre $list { set result [expr {$result*$var}]} <4> return $result <4> } <4> ;funkycalc "1 2 3 4 5 6" 2 <2> Gotisch: #89 (2215 clicks) Tcl error: invalid command name "funkycalc" <3> ;set bleh 1 ;foreach num $list { if {$bleh == 1} { puts [expr $multiply * $num] ; set bleh 0 } else { set bleh 1} } <2> R2_2k: #90 (stdout) 6 <4> pff <2> R2_2k: There's 6 lines, but I'm not gonna show you the rest of them! =P <3> 6lines how <5> why not a while loop <5> and remove stuff from the list that's processed <4> ;proc funkycalc { list num } { set pre "[string repeat "- " [incr num -1]]var";set result 1;foreach $pre $list { set result [expr {$result*$var}]};return $result} <2> Gotisch: #95 (616 clicks) Tcl: <4> ;funkycalc "1 2 3 4 5 6" 2 <2> Gotisch: #96 (1124 clicks) Tcl: 48 <4> that would be <4> ; expr 2*4*6 <2> Gotisch: #98 (216 clicks) Tcl: 48 <4> ;funkycalc "1 2 3 4 5 6" 3 <2> Gotisch: #99 (686 clicks) Tcl: 18 <4> ; expr 3*6 <2> Gotisch: #100 (170 clicks) Tcl: 18 <4> ;funkycalc "1 2 3 4 5 6" 1 <2> Gotisch: #101 (687 clicks) Tcl: 720 <4> ; expr 1*2*3*4*5*6 <2> Gotisch: #102 (241 clicks) Tcl: 720 <4> <- great :) ain't i? <5> ;funkycalc "1 2 3 4 5 6 7 8 9" 4 <2> Pixelz: #104 (891 clicks) Tcl error: can't use empty string as operand of "*" <5> <- destroyer of worlds <4> no <6> ; expr [join "1 2 3 4 5 6 7 8 9" *] <2> BL4DE: #107 (344 clicks) Tcl: 362880 <6> i might be missing the point, but what's the purpose ?
<4> ;proc funkycalc { list num } { if {[expr {[llength $list]%$num}] != 0} { error "Wrong list length"}; set pre "[string repeat "- " [incr num -1]]var";set result 1;foreach $pre $list { set result [expr {$result*$var}]};return $result} <2> Gotisch: #109 (304 clicks) Tcl: <3> my gods <4> there <5> the point is to only multiply every other number or whatever <4> BL4DE its multiplying every x nmber <6> i am aware of that <3> 2nd <6> but what's the point <0> i need it <4> who knows \o/ <3> why dont safetcl ;; like mine :"( <4> my thing works :) <5> ;funkycalc "1 2 3 4 5 6 7 8 9" 4 <2> Pixelz: #121 (942 clicks) Tcl error: Wrong list length <5> tsk tsk <4> so what? <4> its normal that would never work <4> you list doesnt have the right length :P <5> in my mind that'd be 42 but perhaps that's just me :p <6> should return 32 ;) <5> err 32 <6> hehe <6> back to school with u ;) <5> I **** at multiplication <4> Pixelz better supply a fix <0> the list im working with will always be 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 1...... <4> or can't you? <6> anc- it turned into a showoff war ;) <0> :) <5> like I said, while & remove stuff from the list is what I'd do <5> I'm too lazy to code it <0> so the numbers from [1-12] [1-12] my point is to gather these values into just [1-12] <0> if you understand <0> though there might be like [1-12] [1-12] [1-12] [1-12] .... <5> you lost me there :p <0> hehe <0> ;set list "5 6 0 - 13 19 24 0 - 35 - - 7 6 1 - 0 33 - 40 - 53 - 25 2" <2> anc-: #144 (145 clicks) Tcl: 5 6 0 - 13 19 24 0 - 35 - - 7 6 1 - 0 33 - 40 - 53 - 25 2 <0> that should be 24 numbers <0> 2 lists <0> 12 numbers in every list <0> first list 1-12 seclist 1-2 <0> first list 1-12 seclist 1-12 <6> in our face everyone who made funkycalc ;) <4> ;proc funkycalc { list num } { set a [llength $list];if [set b [expr {$a%$num}]] != 0} { set list [lreplace $list [expr {$a+1-b}] $a]}; set pre "[string repeat "- " [incr num -1]]var";set result 1;foreach $pre $list { set result [expr {$result*$var}]};return $result} <2> Gotisch: #151 (474 clicks) Tcl error: wrong # args: should be "::pubsafetcl::Proc interp name arguments body" <0> numbers like - will just be treated as 1 <4> ;proc funkycalc { list num } { set a [llength $list]; if {[set b [expr {$a%$num}]] != 0} { set list [lreplace $list [expr {$a+1-b}] $a]}; set pre "[string repeat "- " [incr num -1]]var";set result 1;foreach $pre $list { set result [expr {$result*$var}]};return $result} <6> LIST1: 5 6 0 - 13 19 24 0 - 35 - - 7 <2> Gotisch: #153 (370 clicks) Tcl: <6> LIST2: 5 6 0 - 13 19 24 0 - 35 - - 7 6 1 - 0 33 - 40 - 53 - 25 2 <5> won't lrange work here? <6> arg <4> duh <5> I don't get it <6> copy past error <6> guess u get the point :) <4> why do i even try? <4> i mean people give wrong infos <4> and you get flamed anyway <4> ;funkycalc "1 2 3 4 5 6 7 8 9" 4 <2> Gotisch: #165 (687 clicks) Tcl error: syntax error in expression "$a+1-b": variable references require preceding $ <4> ;proc funkycalc { list num } { set a [llength $list]; if {[set b [expr {$a%$num}]] != 0} { set list [lreplace $list [expr {$a+1-$b}] $a]}; set pre "[string repeat "- " [incr num -1]]var";set result 1;foreach $pre $list { set result [expr {$result*$var}]};return $result} <2> Gotisch: #166 (346 clicks) Tcl: <4> ;funkycalc "1 2 3 4 5 6 7 8 9" 4 <2> Gotisch: #167 (1051 clicks) Tcl error: list doesn't contain element 9 <0> thought you said it was easy :) <5> well <5> I don't understand any of this <6> they misunderstood anc- <5> well what is is that he wants then? <5> lrange?
Return to
#tcl or Go to some related
logs:
cees de groot #politics apuzilla #politics dds3 tape downwards compatible
boob simulator #politics #hardware proxy judges azenv accessdiver 999999 select from systables ms sql
|
|