মিশরীয় পিরামিডস


15

মিশরের বৃহত্তম পিরামিড গিজার গ্রেট পিরামিড কেবল প্রাচীন বিশ্বের সাতটি বিস্ময়কের মধ্যে প্রাচীনতম নয়, এটি কেবলমাত্র বৃহত্তর অক্ষত রয়ে গেছে। মিশরীয় পিরামিডগুলি তৈরি করতে 20 বছর সময় লাগতে পারে এবং এটি এত বড় যে ক্রুসেডারদের চূর্ণ করেছিল মহান সালাউদ্দিনের পুত্র আল-আজিজ উসমানকে গিজার গ্রেট পিরামিড ধ্বংস করে দিতে হবে কারণ এটি খুব দুর্দান্ত কাজ বলে মনে করা হয়েছিল । মিশরীয় পিরামিডগুলি বেশিরভাগই পুরানো এবং মধ্য কিংডম পিরিয়ড (সি। 2686–1690 খ্রিস্টাব্দ) সময়কালে দেশের ফেরাউন এবং তাদের কনসোর্টগুলির সমাধিসৌধ হিসাবে নির্মিত হয়েছিল এবং ২০০৮ সাল পর্যন্ত ১৩৮ টি মিশরীয় পিরামিড আবিষ্কার হয়েছে।

কাজটি এমন একটি প্রোগ্রাম তৈরি করা যা কোনও স্থান দ্বারা পৃথকীকরণের ক্রমকে অন্তর্ভুক্ত করে এবং সেই দূরত্বগুলি দ্বারা পৃথক 10 × 10 পাঠ্য পিরামিড উত্পাদন করে। 1 এর দূরত্ব দুটি অক্ষরের সমান।

একটি পাঠ্য পিরামিড এর মতো দেখাবে:

         /\
        /--\
       /----\
      /------\
     /--------\
    /----------\
   /------------\
  /--------------\
 /----------------\
/------------------\

যদি ইনপুটটিতে কেবল একটি লাইন বিরতি থাকে তবে উপরের মত একটি পিরামিড তৈরি করা হবে । প্রতিটি পিরামিডের জন্য, বাম দিকে পিরামিডগুলি প্রদর্শিত হয় যেন তারা সামনে ছিল।

উদাহরণ আমি

ইনপুট:

4 3 1

আউটপুট:

         /\      /\    /\/\
        /--\    /--\  /--\-\
       /----\  /----\/----\-\
      /------\/------\-----\-\
     /--------\-------\-----\-\
    /----------\-------\-----\-\
   /------------\-------\-----\-\
  /--------------\-------\-----\-\
 /----------------\-------\-----\-\
/------------------\-------\-----\-\

উদাহরণ II

ইনপুট:

0 9

আউটপুট:

         /\                /\
        /--\              /--\
       /----\            /----\
      /------\          /------\
     /--------\        /--------\
    /----------\      /----------\
   /------------\    /------------\
  /--------------\  /--------------\
 /----------------\/----------------\
/------------------\-----------------\

উদাহরণ III

ইনপুট:

11

আউটপুট:

         /\                    /\
        /--\                  /--\
       /----\                /----\
      /------\              /------\
     /--------\            /--------\
    /----------\          /----------\
   /------------\        /------------\
  /--------------\      /--------------\
 /----------------\    /----------------\
/------------------\  /------------------\

স্বল্প পরিমাণে এই প্রয়োজনীয়তাগুলি পূরণ করার জন্য অ্যাপ্লিকেশনটি হ'ল বিজয়ী।

তথ্যসূত্র: উইকিপিডিয়া.org


আমি অনুমান করি যে লাইনের শেষে অতিরিক্ত সাদা অংশের অনুমতি দেওয়া আছে?
পিটার টেলর

আপনি যাকে জিজ্ঞাসা করেন তা নির্ভর করে। অনুমানের কঠোরতম পাঠে, আউটপুটটি অনুসরণ করার পরে কোনও সাদা স্থান নেই। তবে প্রদত্ত যে এটি মজাদার জন্য, এতে আমার কোনও সমস্যা নেই।
nharren

সুতরাং ইনপুট নেওয়ার জন্য কমান্ড লাইন আর্গুমেন্ট অনুমোদিত?
জোয়

যতক্ষণ এটি প্রয়োজনীয়তা পূরণ করে। আমি এখন দেখতে পাচ্ছি যে হুইটলেজের সমাধানটি লাইনব্রেকগুলি আসলে ইনপুট হিসাবে পরিচালনা করতে সক্ষম নয় (আমি আমার উত্সটি পূর্বাবস্থায়িত করতে পারি না), কোনও ইনপুট না থাকলে কেবল পিরামিড উত্পাদন করে এটি কেবল চারপাশে কাজ করে। তবে যদি আপনি কোনও সমাধান খুঁজে পান যা কমান্ড লাইন আরোগুলি হিসাবে লাইন ব্রেক ব্রেক (handle r বা fine n ভাল হয়) পরিচালনা করতে পারে তবে তা আমার সাথে ঠিক আছে।
nharren

উত্তর:


4

গল্ফস্ক্রিপ্ট, 70 টি অক্ষর

~]0-:|;10,{:§9\-" "*"/""-"§2**+"\\"+:&|{.§>{§-(2*" "*1$}{-2*&>}if}%n}%

আমার রুবির সমাধানের সরাসরি পোর্ট , সুতরাং আমি নিশ্চিত যে এটি বেশ কয়েকটি চরিত্রের দ্বারা সংক্ষিপ্ত করা সম্ভব।


5

উইন্ডোজ পাওয়ারশেল, 122 132 133 139

$d=@(-split$input)-gt0
0..9|%{' '*(9-($x=$_))+($a="/$('--'*$_)\")+-join($d|%{'  '*(($_-$x-1)*($x-lt$_))
$a[(-2*$_)..-1]})}

পরীক্ষার স্ক্রিপ্ট

এলোমেলো ইনপুট সুন্দর চিত্রগুলির জন্যও তৈরি করে:

এলোমেলো পিরামিড


আমি $input=Read-Hostশীর্ষে যুক্ত করলে এটি কাজ করে, অন্যথায় এটি ইনপুট জিজ্ঞাসা করে না। এটি কিভাবে চালানো উচিত?
nharren

@ নহারেন: echo 0 3 4 1|powershell -noprofile -file pyramids.ps1বা পাওয়ারশেল থেকে '0 1 4 3' | .\pyramids.ps1। আপনি শুধুমাত্র গ্রহণ করতে পারে এভাবেই PowerShell মধ্যে golfing, দুঃখিতভাবে সঙ্গে একটি ঘন সমস্যা পারেন পাইপ-ইন ইনপুট বা ইন্টারেক্টিভ ইনপুট। পাওয়ারশেলের আসলেই অন্যান্য ভাষা এবং পরিবেশের স্টিডিনের ধারণা নেই এবং এটি কখনও কখনও প্রদর্শিত হয়। সংখ্যাটি অনুমান করার মতো, কার্যটি স্পষ্টরূপে ইন্টারঅ্যাক্টিভিটির জন্য কল না করলে আমি সাধারণত পাইপ ইনপুট নিতে যাই ।
জোয়

হ্যাঁ, এখন এটি কাজ করে। আমার বোতামটি ম্যাশিংয়ের কোনও ফল পাওয়া যাচ্ছে না এবং আমি এর কারণ বুঝতে পারি না।
nharren

4

হাস্কেল, 148 টি অক্ষর

r=replicate
p d=map(\k->foldr(\n i->r(9-k)' '++'/':r(2*k)'-'++"\\"++drop(11+k)(r(2*n)' '++i))""$d++[0])[0..9]
main=interact$unlines.p.map read.words

আমি এতে যথেষ্ট অসন্তুষ্ট! এটি কেবল দীর্ঘ দীর্ঘ অনুভব করে। ধারনা?


ল্যাম্বদার ভিতরে, আপনি একটি বড় ++তালিকার একক তালিকায় পরিবর্তন করতে এবং কনক্যাট ওরফে ব্যবহার করতে পারেন >>=id। জানি না এটি সাহায্য করবে কিনা। আর একটি পয়েন্ট foldr1পরিবর্তে ব্যবহার করা হবে foldr
FUZxxl

ধারণার জন্য ধন্যবাদ। উভয়ই এই ক্ষেত্রে সহায়তা করে না: ++সিকোয়েন্সগুলি রূপান্তর করা কেবলমাত্র প্রতি আইটেমের জন্য একটি অক্ষর সংরক্ষণ করে এবং ফাইনালের ওভারহেড concatএখানে খুব বেশি। foldrব্যবহার করতে পারেন না foldr1যেমন ফলাফলের সময় ফর্ম Stringযেহেতু তালিকা প্রকার [Int]( 1রূপগুলো foldপ্রয়োজন তাদের একই।)
MtnViewMark

4

পাইথন, 123 টি অক্ষর

N=[10]+map(int,raw_input().split())
for y in range(10):print''.join((2*n*' '+'/'+2*y*'-'+'\ ')[-2*n-1:-1]for n in N)[9-y:]

কৌতূহলের বাইরে এই অজগরটি কি 2.5? পাইথন ৩.২ এ কাজ করার জন্য, আমি মানচিত্রের ফাংশনটিকে একটি তালিকা ফাংশনে আবদ্ধ করেছি, কাঁচা-ইনপুট () ইনপুট () এ পরিবর্তন করেছি এবং মুদ্রণ () এ মুদ্রণ পরিবর্তন করেছি।
nharren

@ নহরেন: আমার জন্য ২.৪.৪ এবং ২.২.২ উভয় ক্ষেত্রেই কাজ করে।
কীথ র্যান্ডাল

4

রুবি 1.9, 116 টি অক্ষর

d=gets.split-[?0]
10.times{|i|puts [?\s*(9-i),l=?/+?-*2*i+?\\,d.map{|r|i<(r=r.to_i)??\s*2*(r+~i)+l :l[-2*r,99]}]*""}

2

পার্ল, 130 126 132 অক্ষর

$_=<>;$s=" "x9;map{$k.="/\\"."  "x($_-1)if$_}split;$_="$s$k/\\$s\n";for$i(0..9){print;s%\\-%-\\%g;s%\\/%-\\%g;s%\\ %-\\%g;s% /%/-%g}

সামান্য সংক্ষিপ্ত সংস্করণ যা স্টিডিনের পরিবর্তে কমান্ড-লাইন আর্গুমেন্ট হিসাবে ইনপুট নেয়:

$s=" "x9;map{$k.="/\\"."  "x($_-1)if$_}@ARGV;$_="$s$k/\\$s\n";for$i(0..9){print;s%\\-%-\\%g;s%\\/%-\\%g;s%\\ %-\\%g;s% /%/-%g}

বিশ্বাস করা যায় না কেউ এখনও একটি রেজেক্স সমাধান করেনি। পার্ল আমার সেরা ভাষা হতে দীর্ঘ পথ, তাই এটি সম্ভবত আরও অনেক কিছু হারাতে পারে। যদি কেউ চ্যালেঞ্জের মুখোমুখি হয় তবে আমি সেড বাস্তবায়ন দেখতে আগ্রহী।

(ধন্যবাদ, @ এমবিএক্স, 4 টি চর জন্য)।


foreach == for -> 4 টি অক্ষর সংরক্ষণ করুন
এমবিএক্স

আপনি কি প্রদত্ত পরীক্ষাগুলির সাথে আপনার সংস্করণটি পরীক্ষা করেছেন ?!
এমবিএক্স

@ এমএমএক্স, হ্যাঁ, আমার পক্ষে কাজ করে। পার্ল 5.10.1, উবুন্টু। আপনি কি বাগ দেখতে পাচ্ছেন?
পিটার টেলর

@ পিটার টেইলর - আমার উবুন্টু এবং উইন 32 এ এটিও দুর্দান্ত কাজ করে। আমি প্রথমে এটি আদর্শের উপর চেষ্টা করেছি যা পার্ল 5.12.1 তে চলছে।
এমবিএক্স

2
The যদি ইনপুটটিতে কেবল একটি লাইন ব্রেক থাকে standard স্ট্যান্ডার্ড ইনপুটটিতে ইঙ্গিতগুলি।
জোয়

1

জাভাস্ক্রিপ্ট, 396 বাইট

function p(a){for(u=0;u<10;u++){t[u+a][9-u]="/";for(k=9-u+1+a;k<10+u+a;k++)t[k][u]="-";
t[10+u+a][u]="\\"}}function _(a){t=[];for(i=0;i<50;i++){t[i]=[];for(j=0;j<10;j++)t[i][j]=" "
}var a=a.split(" "),b=a.reduce(function(a,b){return a-0+(b-0)})*2;for(i=a.length-1;i>=0;
i--)p(b),b-=a[i]*2-0;p(0);a="";for(j=0;j<10;j++){b="";for(i=0;i<50;i++)b+=t[i][j];
a+=b.replace(/\s+$/,"")+(j<9?"\n":"")}return a}

আমি জাভাস্ক্রিপ্ট দিয়ে জিততে যাচ্ছি না, তবে এখন একটি জাভাস্ক্রিপ্ট এন্ট্রি আছে :)

ব্যবহার: _("1 2 3") ইত্যাদি


1

রুবি (112)

ভেন্টোরোরো রুবি সলিউশন থেকে কিছুটা ছোট, আলাদা পদ্ধতির সাথে। আমি শুধু রুবি শিখতে শুরু করেছি, তাই সম্ভবত এটি বেশ কিছুটা কমে যেতে পারে।

s=' '*9+r='/\\';gets.split.map{|i|s+=' '*2*(i.to_i-1)+r}
10.times{puts s;s.gsub!' /','/-';s.gsub!(/\\.?/,'-\\')}

1

পাওয়ারশেল, 105 98 বাইট, অনুমানের কঠোর পাঠ্য

মাইগিমারুর উত্তর থেকে -7 বাইট ।

($a=' '+-join(,5+$args-gt0|%{'  '*--$_+'/\'}))
1..9|%{($a=$a-replace' /','/-'-replace'\\.?','-\')}

পরীক্ষার স্ক্রিপ্ট:

$f = {

($a=' '+-join(,5+$args-gt0|%{'  '*--$_+'/\'}))
1..9|%{($a=$a-replace' /','/-'-replace'\\.?','-\')}

}

@(
,(@"
         /\
        /--\
       /----\
      /------\
     /--------\
    /----------\
   /------------\
  /--------------\
 /----------------\
/------------------\
"@)

,(@"
         /\      /\    /\/\
        /--\    /--\  /--\-\
       /----\  /----\/----\-\
      /------\/------\-----\-\
     /--------\-------\-----\-\
    /----------\-------\-----\-\
   /------------\-------\-----\-\
  /--------------\-------\-----\-\
 /----------------\-------\-----\-\
/------------------\-------\-----\-\
"@, 4,3,1)

,(@"
         /\                /\
        /--\              /--\
       /----\            /----\
      /------\          /------\
     /--------\        /--------\
    /----------\      /----------\
   /------------\    /------------\
  /--------------\  /--------------\
 /----------------\/----------------\
/------------------\-----------------\
"@, 0,9)

,(@"
         /\                    /\
        /--\                  /--\
       /----\                /----\
      /------\              /------\
     /--------\            /--------\
    /----------\          /----------\
   /------------\        /------------\
  /--------------\      /--------------\
 /----------------\    /----------------\
/------------------\  /------------------\
"@, 11)
) | % {
    $expected, $a = $_
    $result = &$f @a
    ($result-join"`n")-eq$expected
    $result 
}

আউটপুট:

True
         /\
        /--\
       /----\
      /------\
     /--------\
    /----------\
   /------------\
  /--------------\
 /----------------\
/------------------\
True
         /\      /\    /\/\
        /--\    /--\  /--\-\
       /----\  /----\/----\-\
      /------\/------\-----\-\
     /--------\-------\-----\-\
    /----------\-------\-----\-\
   /------------\-------\-----\-\
  /--------------\-------\-----\-\
 /----------------\-------\-----\-\
/------------------\-------\-----\-\
True
         /\                /\
        /--\              /--\
       /----\            /----\
      /------\          /------\
     /--------\        /--------\
    /----------\      /----------\
   /------------\    /------------\
  /--------------\  /--------------\
 /----------------\/----------------\
/------------------\-----------------\
True
         /\                    /\
        /--\                  /--\
       /----\                /----\
      /------\              /------\
     /--------\            /--------\
    /----------\          /----------\
   /------------\        /------------\
  /--------------\      /--------------\
 /----------------\    /----------------\
/------------------\  /------------------\

পাওয়ারশেল, 101 94, এক শীর্ষস্থানীয় সাদা স্থানের সাথে মজা করুন

($a=-join(,6+$args-gt0|%{'  '*--$_+'/\'}))
1..9|%{($a=$a-replace' /','/-'-replace'\\.?','-\')}

0

আমি এর চেয়ে কম সংখ্যক সি # 3 সংস্করণটি পাইনি। আমি চরিত্রের গণনাটি ঠিক জানি না, তবে আমি সন্দেহ করি যে আমি হারিয়ে ফেলেছি। :-(

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;

namespace PyramidRenderer
{
    /// <summary>
    /// Generates ASCII-art pyramids at user-specified horizontal locations to
    /// the standard output stream.
    /// </summary>
    public class Program
    {
        /// <summary>
        /// Generates one or more ASCII-art pyramids at the locations specified and 
        /// sends them to the standard output stream.
        /// </summary>
        /// <param name="args">The command-line arguments. These should be non-negative 
        /// integers that specify the horizontal distance of each additional pyramid from the 
        /// preceeding pyramid. Whether or not any distances are suppplied, a pyramid
        /// is rendered at the starting location.</param>
        public static void Main(string[] args)
        {
            try
            {
                AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

                int[] pyramidDistances = ParsePyramidLocationsFromCommandLine(args).ToArray();
                PyramidCollection pyramids = new PyramidCollection(pyramidDistances);
                pyramids.RenderToText(Console.Out);
            }
            catch (ArgumentException ex)
            {
                Console.Error.WriteLine(ex.Message);
            }
        }

        /// <summary>
        /// Handler for the unhandled exception. This just displays the error message to 
        /// the standard error stream.
        /// </summary>
        /// <param name="sender">Required but unnecessary sender object for the event handler.</param>
        /// <param name="e">The object that represents the exception.</param>
        private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            Debug.Assert(e.ExceptionObject != null);

            string exceptionText;
            Exception ex = e.ExceptionObject as Exception;
            if (ex == null)
                exceptionText = e.ExceptionObject.ToString();
            else
                exceptionText = ex.Message;
            Console.Error.WriteLine(exceptionText);
        }

        /// <summary>
        /// Takes the command-line arguments and converts them to a sequence of 
        /// non-negative integers.
        /// </summary>
        /// <param name="args">The command-line arguments as supplied to Main.</param>
        /// <returns>A sequence of integers that represent the user’s distance selections.</returns>
        /// <exception cref="ArgumentException">An invalid argument was supplied.</exception>
        private static IEnumerable<int> ParsePyramidLocationsFromCommandLine(string[] args)
        {
            Debug.Assert(args != null);

            foreach (string arg in args)
            {
                int result;
                if (int.TryParse(arg, out result))
                {
                    if (result < 0)
                        throw new ArgumentException(string.Format("Invalid distance specified: {0}", arg));

                    yield return result;
                }
                else
                {
                    throw new ArgumentException(string.Format("Invalid option: {0}", arg));
                }
            }
        }
    }

    /// <summary>
    /// Represents a single pyramid to be rendered.
    /// </summary>
    internal class Pyramid
    {
        /// <summary>
        /// The height of the pyramids in text rows. The width of each pyramid will be
        /// twice the height.
        /// </summary>
        internal const int Height = 10;

        /// <summary>
        /// The length in characters of the horizontal unit distance in which the user 
        /// specifies the pyramid distances.
        /// </summary>
        internal const int PyramidUnits = 2;

        /// <summary>
        /// The character to output as the background of the pyramids.
        /// </summary>
        private const char backgroundChar = ' ';

        /// <summary>
        /// The character to output as the left edge of the pyramids.
        /// </summary>
        private const char leftEdgeChar = '/';

        /// <summary>
        /// The character to output within each pyramid, between the edges.
        /// </summary>
        private const char brickChar = '-';

        /// <summary>
        /// The character to output as the right edge of the pyramids.
        /// </summary>
        private const char rightEdgeChar = '\\';

        /// <summary>
        /// The absolute horizonal location of the pyramid’s bottom left corner as 
        /// specified in PyramidUnits.
        /// </summary>
        private int position;

        /// <summary>
        /// Constructs a new pyramid object at the specified location.
        /// </summary>
        /// <param name="position">The absolute horizonal location of the pyramid’s bottom
        /// left corner in PyramidUnits.</param>
        internal Pyramid(int position)
        {
            Debug.Assert(position >= 0);

            this.position = position;
        }

        /// <summary>
        /// Renders a single row the pyramid to the supplied text stream starting at
        /// the indicated location.
        /// </summary>
        /// <param name="textWriter">The output stream to which the pyramid is to
        /// be rendered.</param>
        /// <param name="row">The row of the pyramid to render. Zero is the top row,
        /// and Height - 1 is the bottom row.</param>
        /// <param name="startingPosition">The text character position—indexed at zero—at 
        /// which the rendering is to begin. If non-zero, this identifies the column one 
        /// past the ending location of the previous pyramid.</param>
        /// <returns>The horizontal location (in characters) at which the next item 
        /// may be rendered.</returns>
        internal int RenderRow(TextWriter textWriter, int row, int startingPosition)
        {
            Debug.Assert(textWriter != null);
            Debug.Assert(row >= 0);
            Debug.Assert(startingPosition >= 0);

            int leftBoundary = Height - 1 - row + position * PyramidUnits;
            int rightBoundary = Height + row + position * PyramidUnits;

            startingPosition = RenderField(textWriter, backgroundChar, startingPosition, leftBoundary);
            startingPosition = RenderField(textWriter, leftEdgeChar, startingPosition, leftBoundary + 1);
            startingPosition = RenderField(textWriter, brickChar, startingPosition, rightBoundary);
            startingPosition = RenderField(textWriter, rightEdgeChar, startingPosition, rightBoundary + 1);
            return startingPosition;
        }

        /// <summary>
        /// Outputs a sequence of repeated characters from the indicated starting position to
        /// just before the ending position, unless the starting position is already equal to
        /// or greater than the ending position.
        /// </summary>
        /// <param name="textWriter">The output stream to which the field is to be rendered.</param>
        /// <param name="character">The character to be repeated in the output.</param>
        /// <param name="startingPosition">The location at which rendering may begin in 
        /// characters indexed at zero.</param>
        /// <param name="endingPosition">The location one past the location at which rendering
        /// is to end.</param>
        /// <returns>The position at which the next field may begin.</returns>
        private static int RenderField(TextWriter textWriter, char character, int startingPosition, int endingPosition)
        {
            Debug.Assert(textWriter != null);
            Debug.Assert(startingPosition >= 0);
            Debug.Assert(endingPosition >= 0);

            int charCount = endingPosition - startingPosition;
            if (charCount <= 0)
                return startingPosition;
            textWriter.Write(new string(character, charCount));
            return endingPosition;
        }
    }

    /// <summary>
    /// A collection of pyramids to be displayed.
    /// </summary>
    internal class PyramidCollection
    {
        /// <summary>
        /// A left-to-right ordered list of the pyramids that the user has 
        /// requested to be rendered.
        /// </summary>
        List<Pyramid> allPyramids = new List<Pyramid>();

        /// <summary>
        /// Constructs a new pyramid collection.
        /// </summary>
        /// <param name="distances">The distances of each non-leftmost pyramid (in PyramidUnits) after
        /// the previous pyramid. The total number of pyramids will be one greater than the length of
        /// the distances array.</param>
        internal PyramidCollection(int[] distances)
        {
            Debug.Assert(distances != null);

            int nextPosition = 0;
            allPyramids.Add(new Pyramid(nextPosition));
            foreach (int nextDistance in distances)
            {
                Debug.Assert(nextDistance >= 0);

                try
                {
                    checked
                    {
                        nextPosition += nextDistance;
                        int endLocation = nextPosition * Pyramid.PyramidUnits + Pyramid.Height * 2;
                    }
                }
                catch (OverflowException)
                {
                    // Ignore any pyramids specified beyond the integer maximum distance.
                    break;
                }
                allPyramids.Add(new Pyramid(nextPosition));
            }
        }

        /// <summary>
        /// Outputs ASCII-art images of the pyramids in this collection to the 
        /// provided output stream.
        /// </summary>
        /// <param name="textWriter">The output stream to which the pyramids
        /// are to be rendered.</param>
        internal void RenderToText(TextWriter textWriter)
        {
            Debug.Assert(textWriter != null);

            for (int row = 0; row < Pyramid.Height; row++)
            {
                int startingPosition = 0;
                foreach (Pyramid pyramid in allPyramids)
                {
                    startingPosition = pyramid.RenderRow(textWriter, row, startingPosition);
                }
                textWriter.WriteLine();
            }
        }
    }

}

3
আপনি কি কোনও সুযোগে কোড বোলিং এবং কোড গল্ফকে বিভ্রান্ত করেছেন?
জোয়

1
কমপক্ষে চেষ্টা করার ভান করুন। আপনি যদি এটি গল্ফ করেন তবে লোকেরা আপনার বিরুদ্ধে ভার্ভোজ ভাষা রাখবে না ।
dmckee --- প্রাক্তন মডারেটর বিড়ালছানা

আমার অনুমান যে আপনার নিফটির কৌশলগুলি ব্যাখ্যা করার জন্য এটি আপনার ভার্বোজ সংস্করণ। দেখে মনে হচ্ছে আপনি এর গল্ফ সংস্করণটি পোস্ট করতে ভুলে গেছেন।
এমবিএক্স

@ জো, @ ডিএমকে - আমি গল্ফ সংস্করণ করার কথা ভেবেছিলাম, কিন্তু এর সাথে আর পাইনি। আমি যাই হোক না কেন এই খেলায় ভয়ানক। অস্পষ্ট কোড সম্পূর্ণ আমার প্রকৃতির বিরুদ্ধে যায়। আমার সম্ভবত গল্ফ ধাঁধা থেকে দূরে থাকা উচিত! - @ এমএমএক্স - দুঃখের বিষয়, কোনও নিফটি কৌশল নেই।
জেফ্রি এল হুইলেটজ
আমাদের সাইট ব্যবহার করে, আপনি স্বীকার করেছেন যে আপনি আমাদের কুকি নীতি এবং গোপনীয়তা নীতিটি পড়েছেন এবং বুঝতে পেরেছেন ।
Licensed under cc by-sa 3.0 with attribution required.