<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mexican Wave Archives - Onestring Lab</title>
	<atom:link href="https://onestringlab.com/tag/mexican-wave/feed/" rel="self" type="application/rss+xml" />
	<link>https://onestringlab.com/tag/mexican-wave/</link>
	<description>Kode Kreativitas Kopi</description>
	<lastBuildDate>Mon, 04 May 2026 08:37:42 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://onestringlab.com/wp-content/uploads/2021/10/cropped-osl-high-res-e1455499003866-32x32.jpg</url>
	<title>Mexican Wave Archives - Onestring Lab</title>
	<link>https://onestringlab.com/tag/mexican-wave/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Belajar Bahasa C &#8211; Mexican Wave</title>
		<link>https://onestringlab.com/mexican-wave/</link>
		
		<dc:creator><![CDATA[Rajo Intan]]></dc:creator>
		<pubDate>Thu, 08 Dec 2022 01:52:00 +0000</pubDate>
				<category><![CDATA[Codewars]]></category>
		<category><![CDATA[C Language]]></category>
		<category><![CDATA[Mexican Wave]]></category>
		<guid isPermaLink="false">https://onestringlab.com/?p=855</guid>

					<description><![CDATA[<p>Introduction The wave (known as the Mexican wave in the English-speaking world outside North America) is an example of metachronal rhythm achieved in a packed &#8230; </p>
<p>The post <a href="https://onestringlab.com/mexican-wave/">Belajar Bahasa C &#8211; Mexican Wave</a> appeared first on <a href="https://onestringlab.com">Onestring Lab</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Introduction</h2>



<p>The wave (known as the Mexican wave in the English-speaking world outside North America) is an example of metachronal rhythm achieved in a packed stadium when successive groups of spectators briefly stand, yell, and raise their arms. Immediately upon stretching to full height, the spectator returns to the usual seated position.</p>



<p>The result is a wave of standing spectators that travels through the crowd, even though individual spectators never move away from their seats. In many large arenas the crowd is seated in a contiguous circuit all the way around the sport field, and so the wave is able to travel continuously around the arena; in discontinuous seating arrangements, the wave can instead reflect back and forth through the crowd. When the gap in seating is narrow, the wave can sometimes pass through it. Usually only one wave crest will be present at any given time in an arena, although simultaneous, counter-rotating waves have been produced. (Source <a href="https://en.wikipedia.org/wiki/Wave_(audience)" target="_blank" rel="noreferrer noopener">Wikipedia</a>)</p>



<h2 class="wp-block-heading">Task</h2>



<p>In this simple Kata your task is to create a function that turns a string into a Mexican Wave. You will be passed a string and you must return that string in an array where an uppercase letter is a person standing up. The problem link is <a href="https://www.codewars.com/kata/58f5c63f1e26ecda7e000029/train/c/" target="_blank" rel="noreferrer noopener">here</a>.</p>



<h2 class="wp-block-heading">Rules</h2>



<ul class="wp-block-list">
<li>The input string will always be lower case but maybe empty.</li>



<li>If the character in the string is whitespace then pass over it as if it was an empty seat</li>
</ul>



<h2 class="wp-block-heading">Example</h2>



<pre class="wp-block-code"><code lang="csharp" class="language-csharp">wave("hello") =&gt; {"Hello", "hEllo", "heLlo", "helLo", "hellO"}</code></pre>



<h2 class="wp-block-heading">Solution</h2>



<pre title="Mexican Wave" class="wp-block-code"><code lang="csharp" class="language-csharp line-numbers">void wave(const char *y, char **target)
{
  /* you don't have to allocate memory, use target */
  /* y string is always null terminated */
  /* each string in target has length strlen(y) + 1 */

  int i, k;
  char temp;
  int slen = strlen(y);
  char *c = (char *)calloc((slen + 1), sizeof(char));

  for (i = 0; i &lt; slen; i++)
  {
    strcpy(c, "");
    for (k = 0; k &lt; slen; k++)
    {
      temp = (k == i &amp;&amp; y[k] != 32) ? toupper(y[k]) : y[k];
      strncat(c, &amp;temp, 1);
    }
    if (y[i] != 32)
      strcpy(*target++, c);
  }
}</code></pre>
<p>The post <a href="https://onestringlab.com/mexican-wave/">Belajar Bahasa C &#8211; Mexican Wave</a> appeared first on <a href="https://onestringlab.com">Onestring Lab</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
