にっき

2007/12/17 20:19:15

りば〜すか〜どお〜ぷん☆


ふみゅ・・・
ちょっとどたばたしてる間にどんどん問題増えるにゃぁ・・・ (´ω`;【みかん
とりあえずえでんの抽選で使うのは
lot.lua
print(math.mod(arg[1] * 60 + arg[2],arg[3]) + 1);
こんなかんじでいいのかなぁ?
引数に分,秒,参加人数を指定するだけだから参加人数を数え間違えなければだいじょ〜ぶなはず☆
ってn人中m人が当選するくじとかそのまま使えそうな気もするけど・・・
何回やっても結果がぶれないからたぶんきっとこれもあり・・・だよね? 〆(´ω`;【みかん
そんなことはおいといて今日は反転ものにちゃれんぢにう☆ヾ(・x・。【みかん



りすとを逆順に表示
027-ListReverse.lua
function ListReverse(list)
    local ret = {};
    
    while table.getn(list) ~= 0 do
        table.insert(ret,table.remove(list));
    end
    
    return ret;
end

require([[mylib]]);
PrintTable(ListReverse(arg));

後ろから順番に拾ってくだけのしんぷる実装にう d(´ω`;【みかん
引数にてきとうなりすとを指定すれば
>lua5.1.exe 027-ListReverse.lua 1 2 3 4 5
[5,4,3,2,1]

>lua5.1.exe 027-ListReverse.lua 1 2 5 4 2 38 8 7
[7,8,38,2,4,5,2,1]

>lua5.1.exe 027-ListReverse.lua Hello , world !
[!,world,,,Hello]

>lua5.1.exe 027-ListReverse.lua H e l l o , w o r l d!
[!,d,l,r,o,w,,,o,l,l,e,H]

こんなかんじ?
table.reverse みたいなのあると簡単だったのににゃぁ...〆(´ω`;【みかん

逆転したびっと列
061-BitReverse.lua
function BitReverse(n)
    local ret = {};
    
    for i = 0,n ^ 2 - 1,1 do
        local bin = [[]];
        while i > 0 do
            bin = bin .. math.mod(i,2);
            i = math.floor(i / 2);
        end
        table.insert(ret,tonumber(bin .. string.rep([[0]],n - string.len(bin)),2));
    end
    
    return ret;
end

require([[mylib]]);
PrintTable(BitReverse(arg[1]));

2進から10進はできても逆はできなさそうだから自分でびっと列に変換して反転☆
って思ったけど・・・
びっと列に変換するときに逆にぺったんすればおっけぃ・・・だよね?(´ω`;【みかん
らすとに足りない0を補って10進に戻しておしまい☆
引数にnを指定して実行すると
>lua5.1.exe 061-BitReverse.lua 4
[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15]

>lua5.1.exe 061-BitReverse.lua 5
[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3]

>lua5.1.exe 061-BitReverse.lua 8
[0,128,64,192,32,160,96,224,16,144,80,208,48,176,112,240,8,136,72,200,40,168,104,
232,24,152,88,216,56,184,120,248,4,132,68,196,36,164,100,228,20,148,84,212,52,180,
116,244,12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252]

>lua5.1.exe 061-BitReverse.lua 32
[0,2147483648,1073741824,3221225472,536870912,2684354560,1610612736,3758096384,
268435456,2415919104,1342177280,3489660928,805306368,2952790016,1879048192,4026531840,
134217728,2281701376,1207959552,3355443200,671088640,2818572288,1744830464,3892314112,
402653184,2550136832,1476395008,3623878656,939524096,3087007744,2013265920,4160749568,
67108864,2214592512,1140850688,3288334336,603979776,2751463424,1677721600,3825205248,
335544320,2483027968,1409286144,3556769792,872415232,3019898880,1946157056,4093640704,
201326592,2348810240,1275068416,3422552064,738197504,2885681152,1811939328,3959422976,
469762048,2617245696,1543503872,3690987520,1006632960,3154116608,2080374784,4227858432,
33554432,2181038080,1107296256,3254779904,570425344,2717908992,1644167168,3791650816,
301989888,2449473536,1375731712,3523215360,838860800,2986344448,1912602624,4060086272,
167772160,2315255808,1241513984,3388997632,704643072,2852126720,1778384896,3925868544,
436207616,2583691264,1509949440,3657433088,973078528,3120562176,2046820352,4194304000,
100663296,2248146944,1174405120,3321888768,637534208,2785017856,1711276032,3858759680,
369098752,2516582400,1442840576,3590324224,905969664,3053453312,1979711488,4127195136,
234881024,2382364672,1308622848,3456106496,771751936,2919235584,1845493760,3992977408,
503316480,2650800128,1577058304,3724541952,1040187392,3187671040,2113929216,4261412864,
16777216,2164260864,1090519040,3238002688,553648128,2701131776,1627389952,3774873600,
285212672,2432696320,1358954496,3506438144,822083584,2969567232,1895825408,4043309056,
150994944,2298478592,1224736768,3372220416,687865856,2835349504,1761607680,3909091328,
419430400,2566914048,1493172224,3640655872,956301312,3103784960,2030043136,4177526784,
83886080,2231369728,1157627904,3305111552,620756992,2768240640,1694498816,3841982464,
352321536,2499805184,1426063360,3573547008,889192448,3036676096,1962934272,4110417920,
218103808,2365587456,1291845632,3439329280,754974720,2902458368,1828716544,3976200192,
486539264,2634022912,1560281088,3707764736,1023410176,3170893824,2097152000,4244635648,
50331648,2197815296,1124073472,3271557120,587202560,2734686208,1660944384,3808428032,
318767104,2466250752,1392508928,3539992576,855638016,3003121664,1929379840,4076863488,
184549376,2332033024,1258291200,3405774848,721420288,2868903936,1795162112,3942645760,
452984832,2600468480,1526726656,3674210304,989855744,3137339392,2063597568,4211081216,
117440512,2264924160,1191182336,3338665984,654311424,2801795072,1728053248,3875536896,
385875968,2533359616,1459617792,3607101440,922746880,3070230528,1996488704,4143972352,
251658240,2399141888,1325400064,3472883712,788529152,2936012800,1862270976,4009754624,
520093696,2667577344,1593835520,3741319168,1056964608,3204448256,2130706432,4278190080,
8388608,2155872256,1082130432,3229614080,545259520,2692743168,1619001344,3766484992,
276824064,2424307712,1350565888,3498049536,813694976,2961178624,1887436800,4034920448,
142606336,2290089984,1216348160,3363831808,679477248,2826960896,1753219072,3900702720,
411041792,2558525440,1484783616,3632267264,947912704,3095396352,2021654528,4169138176,
75497472,2222981120,1149239296,3296722944,612368384,2759852032,1686110208,3833593856,
343932928,2491416576,1417674752,3565158400,880803840,3028287488,1954545664,4102029312,
209715200,2357198848,1283457024,3430940672,746586112,2894069760,1820327936,3967811584,
478150656,2625634304,1551892480,3699376128,1015021568,3162505216,2088763392,4236247040,
41943040,2189426688,1115684864,3263168512,578813952,2726297600,1652555776,3800039424,
310378496,2457862144,1384120320,3531603968,847249408,2994733056,1920991232,4068474880,
176160768,2323644416,1249902592,3397386240,713031680,2860515328,1786773504,3934257152,
444596224,2592079872,1518338048,3665821696,981467136,3128950784,2055208960,4202692608,
109051904,2256535552,1182793728,3330277376,645922816,2793406464,1719664640,3867148288,
377487360,2524971008,1451229184,3598712832,914358272,3061841920,1988100096,4135583744,
243269632,2390753280,1317011456,3464495104,780140544,2927624192,1853882368,4001366016,
511705088,2659188736,1585446912,3732930560,1048576000,3196059648,2122317824,4269801472,
25165824,2172649472,1098907648,3246391296,562036736,2709520384,1635778560,3783262208,
293601280,2441084928,1367343104,3514826752,830472192,2977955840,1904214016,4051697664,
159383552,2306867200,1233125376,3380609024,696254464,2843738112,1769996288,3917479936,
427819008,2575302656,1501560832,3649044480,964689920,3112173568,2038431744,4185915392,
92274688,2239758336,1166016512,3313500160,629145600,2776629248,1702887424,3850371072,
360710144,2508193792,1434451968,3581935616,897581056,3045064704,1971322880,4118806528,
226492416,2373976064,1300234240,3447717888,763363328,2910846976,1837105152,3984588800,
494927872,2642411520,1568669696,3716153344,1031798784,3179282432,2105540608,4253024256,
58720256,2206203904,1132462080,3279945728,595591168,2743074816,1669332992,3816816640,
327155712,2474639360,1400897536,3548381184,864026624,3011510272,1937768448,4085252096,
192937984,2340421632,1266679808,3414163456,729808896,2877292544,1803550720,3951034368,
461373440,2608857088,1535115264,3682598912,998244352,3145728000,2071986176,4219469824,
125829120,2273312768,1199570944,3347054592,662700032,2810183680,1736441856,3883925504,
394264576,2541748224,1468006400,3615490048,931135488,3078619136,2004877312,4152360960,
260046848,2407530496,1333788672,3481272320,796917760,2944401408,1870659584,4018143232,
528482304,2675965952,1602224128,3749707776,1065353216,3212836864,2139095040,4286578688,
4194304,2151677952,1077936128,3225419776,541065216,2688548864,1614807040,3762290688,
272629760,2420113408,1346371584,3493855232,809500672,2956984320,1883242496,4030726144,
138412032,2285895680,1212153856,3359637504,675282944,2822766592,1749024768,3896508416,
406847488,2554331136,1480589312,3628072960,943718400,3091202048,2017460224,4164943872,
71303168,2218786816,1145044992,3292528640,608174080,2755657728,1681915904,3829399552,
339738624,2487222272,1413480448,3560964096,876609536,3024093184,1950351360,4097835008,
205520896,2353004544,1279262720,3426746368,742391808,2889875456,1816133632,3963617280,
473956352,2621440000,1547698176,3695181824,1010827264,3158310912,2084569088,4232052736,
37748736,2185232384,1111490560,3258974208,574619648,2722103296,1648361472,3795845120,
306184192,2453667840,1379926016,3527409664,843055104,2990538752,1916796928,4064280576,
171966464,2319450112,1245708288,3393191936,708837376,2856321024,1782579200,3930062848,
440401920,2587885568,1514143744,3661627392,977272832,3124756480,2051014656,4198498304,
104857600,2252341248,1178599424,3326083072,641728512,2789212160,1715470336,3862953984,
373293056,2520776704,1447034880,3594518528,910163968,3057647616,1983905792,4131389440,
239075328,2386558976,1312817152,3460300800,775946240,2923429888,1849688064,3997171712,
507510784,2654994432,1581252608,3728736256,1044381696,3191865344,2118123520,4265607168,
20971520,2168455168,1094713344,3242196992,557842432,2705326080,1631584256,3779067904,
289406976,2436890624,1363148800,3510632448,826277888,2973761536,1900019712,4047503360,
155189248,2302672896,1228931072,3376414720,692060160,2839543808,1765801984,3913285632,
423624704,2571108352,1497366528,3644850176,960495616,3107979264,2034237440,4181721088,
88080384,2235564032,1161822208,3309305856,624951296,2772434944,1698693120,3846176768,
356515840,2503999488,1430257664,3577741312,893386752,3040870400,1967128576,4114612224,
222298112,2369781760,1296039936,3443523584,759169024,2906652672,1832910848,3980394496,
490733568,2638217216,1564475392,3711959040,1027604480,3175088128,2101346304,4248829952,
54525952,2202009600,1128267776,3275751424,591396864,2738880512,1665138688,3812622336,
322961408,2470445056,1396703232,3544186880,859832320,3007315968,1933574144,4081057792,
188743680,2336227328,1262485504,3409969152,725614592,2873098240,1799356416,3946840064,
457179136,2604662784,1530920960,3678404608,994050048,3141533696,2067791872,4215275520,
121634816,2269118464,1195376640,3342860288,658505728,2805989376,1732247552,3879731200,
390070272,2537553920,1463812096,3611295744,926941184,3074424832,2000683008,4148166656,
255852544,2403336192,1329594368,3477078016,792723456,2940207104,1866465280,4013948928,
524288000,2671771648,1598029824,3745513472,1061158912,3208642560,2134900736,4282384384,
12582912,2160066560,1086324736,3233808384,549453824,2696937472,1623195648,3770679296,
281018368,2428502016,1354760192,3502243840,817889280,2965372928,1891631104,4039114752,
146800640,2294284288,1220542464,3368026112,683671552,2831155200,1757413376,3904897024,
415236096,2562719744,1488977920,3636461568,952107008,3099590656,2025848832,4173332480,
79691776,2227175424,1153433600,3300917248,616562688,2764046336,1690304512,3837788160,
348127232,2495610880,1421869056,3569352704,884998144,3032481792,1958739968,4106223616,
213909504,2361393152,1287651328,3435134976,750780416,2898264064,1824522240,3972005888,
482344960,2629828608,1556086784,3703570432,1019215872,3166699520,2092957696,4240441344,
46137344,2193620992,1119879168,3267362816,583008256,2730491904,1656750080,3804233728,
314572800,2462056448,1388314624,3535798272,851443712,2998927360,1925185536,4072669184,
180355072,2327838720,1254096896,3401580544,717225984,2864709632,1790967808,3938451456,
448790528,2596274176,1522532352,3670016000,985661440,3133145088,2059403264,4206886912,
113246208,2260729856,1186988032,3334471680,650117120,2797600768,1723858944,3871342592,
381681664,2529165312,1455423488,3602907136,918552576,3066036224,1992294400,4139778048,
247463936,2394947584,1321205760,3468689408,784334848,2931818496,1858076672,4005560320,
515899392,2663383040,1589641216,3737124864,1052770304,3200253952,2126512128,4273995776,
29360128,2176843776,1103101952,3250585600,566231040,2713714688,1639972864,3787456512,
297795584,2445279232,1371537408,3519021056,834666496,2982150144,1908408320,4055891968,
163577856,2311061504,1237319680,3384803328,700448768,2847932416,1774190592,3921674240,
432013312,2579496960,1505755136,3653238784,968884224,3116367872,2042626048,4190109696,
96468992,2243952640,1170210816,3317694464,633339904,2780823552,1707081728,3854565376,
364904448,2512388096,1438646272,3586129920,901775360,3049259008,1975517184,4123000832,
230686720,2378170368,1304428544,3451912192,767557632,2915041280,1841299456,3988783104,
499122176,2646605824,1572864000,3720347648,1035993088,3183476736,2109734912,4257218560,
62914560,2210398208,1136656384,3284140032,599785472,2747269120,1673527296,3821010944,
331350016,2478833664,1405091840,3552575488,868220928,3015704576,1941962752,4089446400,
197132288,2344615936,1270874112,3418357760,734003200,2881486848,1807745024,3955228672,
465567744,2613051392,1539309568,3686793216,1002438656,3149922304,2076180480,4223664128,
130023424,2277507072,1203765248,3351248896,666894336,2814377984,1740636160,3888119808,
398458880,2545942528,1472200704,3619684352,935329792,3082813440,2009071616,4156555264,
264241152,2411724800,1337982976,3485466624,801112064,2948595712,1874853888,4022337536,
532676608,2680160256,1606418432,3753902080,1069547520,3217031168,2143289344,4290772992]

・・・32なんてあってるかどうかわかんにゃい(´・ω・`;【みかん


こめんと

こめんとする?



 
投稿された内容の著作権はこめんとの投稿者に帰属するっぽいです☆
また,現在 IE6 以下で Sleipnir,Lunascape,Donut じゃないゆ〜ざえ〜じぇんとからの描き込みを制限してますです☆
該当しちゃうかたはてきとうにゆ〜ざえ〜じぇんとを偽装しちゃってくださいです(´ω`;【みかん
さぶこんてんつ
前月 2024年 11月 翌月
          1
 
2
 
3
 
4
 
5
 
6
 
7
 
8
 
9
 
10
 
11
 
12
 
13
 
14
 
15
 
16
 
17
 
18
 
19
 
20
 
21
 
22
 
23
 
24
 
25
 
26
 
27
 
28
 
29
 
30
 
             
  • あじ あじ
  • ED ED
  • えでん えでん
  • えれふぃ えれふぃ
  • ぐらぶれ ぐらぶれ
  • etc etc
  • にっき にっき

あわせて読みたい

先頭に戻る
めにう 先頭に戻る