# Is there any shorter way i can do this

**URL:** <https://forum.makecode.com/t/is-there-any-shorter-way-i-can-do-this/3787>\
**Category:** Arcade\
**Created:** [October 6, 2020, 9:39pm UTC](https://forum.makecode.com/t/is-there-any-shorter-way-i-can-do-this/3787 "2020-10-06T21:39:44Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![jacob\_c](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jacob_c/32/1532_2.png) [@jacob\_c](https://forum.makecode.com/u/jacob_c)\
**Post date:** [October 8, 2020, 12:01am UTC](https://forum.makecode.com/t/is-there-any-shorter-way-i-can-do-this/3787/41 "2020-10-08T00:01:10Z")

</div>

It looks like 20 columns is too big to fit in one line. You’ll have to experiment with adjusting your column count to be the number of columns that you want. It looks like you can fit about `8` per row from your screenshot.

---

<div class="post-metadata">

**Author:** ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)\
**Post date:** [October 8, 2020, 12:01am UTC](https://forum.makecode.com/t/is-there-any-shorter-way-i-can-do-this/3787/42 "2020-10-08T00:01:38Z")

</div>

Do I have to edit the offset?

---

<div class="post-metadata">

**Author:** ![jacob\_c](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jacob_c/32/1532_2.png) [@jacob\_c](https://forum.makecode.com/u/jacob_c)\
**Post date:** [October 8, 2020, 12:01am UTC](https://forum.makecode.com/t/is-there-any-shorter-way-i-can-do-this/3787/43 "2020-10-08T00:01:49Z")

</div>

no; set `columnCount` to 8

---

<div class="post-metadata">

**Author:** ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)\
**Post date:** [October 8, 2020, 12:03am UTC](https://forum.makecode.com/t/is-there-any-shorter-way-i-can-do-this/3787/44 "2020-10-08T00:03:53Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/8/857afec581fc1806ed3d8618d2eb2dac261909c0.png)  
I am not good at math, or at least the very advanced math. Thanks to @jacob_c @jwunderl @AlexK @UnsignedArduino

---

<div class="post-metadata">

**Author:** ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)\
**Post date:** [October 8, 2020, 12:09am UTC](https://forum.makecode.com/t/is-there-any-shorter-way-i-can-do-this/3787/45 "2020-10-08T00:09:38Z")

</div>

Do you have an idea of how to make a stop watch instead of a timer. I want them to get them to see their times on how long it would take to solve the rubiks cubes

---

<div class="post-metadata">

**Author:** ![jacob\_c](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jacob_c/32/1532_2.png) [@jacob\_c](https://forum.makecode.com/u/jacob_c)\
**Post date:** [October 8, 2020, 12:09am UTC](https://forum.makecode.com/t/is-there-any-shorter-way-i-can-do-this/3787/46 "2020-10-08T00:09:54Z")

</div>

In response to your comment about math and learning, I think the best way to approach it is to just keep pulling at threads that you feel like you almost understand but don’t quite… you’ve got to start from a place where you understand part of it, but not all, and then look at one piece of what you don’t understand and work on that part (and ask questions) and build from there.

---

<div class="post-metadata">

**Author:** ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)\
**Post date:** [October 8, 2020, 12:11am UTC](https://forum.makecode.com/t/is-there-any-shorter-way-i-can-do-this/3787/47 "2020-10-08T00:11:14Z")

</div>

You gotta start at the bottom and work yourself up

---

<div class="post-metadata">

**Author:** ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)\
**Post date:** [October 8, 2020, 12:11am UTC](https://forum.makecode.com/t/is-there-any-shorter-way-i-can-do-this/3787/48 "2020-10-08T00:11:41Z")

</div>

Also, any way to make a stopwatch instead of a countdown @jacob_c?

---

<div class="post-metadata">

**Author:** ![jacob\_c](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jacob_c/32/1532_2.png) [@jacob\_c](https://forum.makecode.com/u/jacob_c)\
**Post date:** [October 8, 2020, 12:15am UTC](https://forum.makecode.com/t/is-there-any-shorter-way-i-can-do-this/3787/49 "2020-10-08T00:15:08Z")

</div>

Yeah; under `Game` there’s a `time since start (ms)` block. You can use that in a game update to show the number of milliseconds since the game started.

… you can use math to format that number to something more like minutes and seconds. 😅

---

<div class="post-metadata">

**Author:** ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)\
**Post date:** [October 8, 2020, 12:15am UTC](https://forum.makecode.com/t/is-there-any-shorter-way-i-can-do-this/3787/50 "2020-10-08T00:15:41Z")

</div>

I don’t understand…

---

<div class="post-metadata">

**Author:** ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)\
**Post date:** [October 8, 2020, 12:18am UTC](https://forum.makecode.com/t/is-there-any-shorter-way-i-can-do-this/3787/51 "2020-10-08T00:18:54Z")

</div>

Can you show me how to do it in blocks @jacob_c?

---

<div class="post-metadata">

**Author:** ![jacob\_c](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jacob_c/32/1532_2.png) [@jacob\_c](https://forum.makecode.com/u/jacob_c)\
**Post date:** [October 8, 2020, 12:23am UTC](https://forum.makecode.com/t/is-there-any-shorter-way-i-can-do-this/3787/52 "2020-10-08T00:23:52Z")

</div>

Sure:

 ![Screen Shot 2020-10-07 at 5.23.00 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/2/2ba30639a550a4da9a7e7eebf53b97cd5058709a.png)

I used a `Sprite` and `Sprite say` because I don’t have the text extension in this example project… but you can use a text sprite for this instead.

---

<div class="post-metadata">

**Author:** ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)\
**Post date:** [October 8, 2020, 12:25am UTC](https://forum.makecode.com/t/is-there-any-shorter-way-i-can-do-this/3787/53 "2020-10-08T00:25:11Z")

</div>

I might use sprite because just doing all this is very confusing

---

<div class="post-metadata">

**Author:** ![jacob\_c](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jacob_c/32/1532_2.png) [@jacob\_c](https://forum.makecode.com/u/jacob_c)\
**Post date:** [October 8, 2020, 12:27am UTC](https://forum.makecode.com/t/is-there-any-shorter-way-i-can-do-this/3787/54 "2020-10-08T00:27:36Z")

</div>

My example with blocks is just counting seconds… it doesn’t roll over to minutes formatting if you get above `60`. That is definitely also possible, but it will make it a bit more complicated.

---

<div class="post-metadata">

**Author:** ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)\
**Post date:** [October 8, 2020, 1:05am UTC](https://forum.makecode.com/t/is-there-any-shorter-way-i-can-do-this/3787/55 "2020-10-08T01:05:28Z")

</div>

When I do the stopwatch, it was running even at the start of the game. I want them to have time to do the scramble. The problem with your idea is because of the `time start since (ms)`. that block starts when the game loads.

---

<div class="post-metadata">

**Author:** ![jacob\_c](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jacob_c/32/1532_2.png) [@jacob\_c](https://forum.makecode.com/u/jacob_c)\
**Post date:** [October 8, 2020, 2:14am UTC](https://forum.makecode.com/t/is-there-any-shorter-way-i-can-do-this/3787/56 "2020-10-08T02:14:06Z")

</div>

You can do that too.

Save the current value of `time since start` in a variable when you want to start the timer. Then, when you want to display the value, subtract the saved value from the new current value.

---

<div class="post-metadata">

**Author:** ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)\
**Post date:** [October 8, 2020, 3:20am UTC](https://forum.makecode.com/t/is-there-any-shorter-way-i-can-do-this/3787/57 "2020-10-08T03:20:46Z")

</div>

I hope you’re proud of your project so far, @Dreadmask197. I sure am! You’ve got a bright future ahead of you, whether you choose to stick with computer programming or go in a different direction.

Nice work, too, @jacob_c, in helping with the math! Have you considered going into teaching?

I think @jacob_c pointed you in the right direction as far as getting the timer to work: You could start and pause the timer when the player presses a button (say, **A** ). It’s actually a pretty common routine … one you’ll find yourself writing many, many, many times in a lot of different programs that you create. You get the hang of it once you’ve written it a few times. Let us know if you’re stuck with that still; we’ll get you up and running.

---

<div class="post-metadata">

**Author:** ![jacob\_c](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jacob_c/32/1532_2.png) [@jacob\_c](https://forum.makecode.com/u/jacob_c)\
**Post date:** [October 8, 2020, 4:15am UTC](https://forum.makecode.com/t/is-there-any-shorter-way-i-can-do-this/3787/58 "2020-10-08T04:15:53Z")

</div>

> Have you considered going into teaching?

Ha; thanks. That’s high praise coming from you, @AlexK! I’m pretty well into a career in software development already, so a professional teaching role would be a pretty big pivot. 😅 I have done some volunteer teaching in the past (an AP CS class) and that was a challenging and rewarding experience.

---

<div class="post-metadata">

**Author:** ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)\
**Post date:** [October 8, 2020, 1:49pm UTC](https://forum.makecode.com/t/is-there-any-shorter-way-i-can-do-this/3787/59 "2020-10-08T13:49:16Z")

</div>

How do I do that in blocks?  
This is what I’m thinking so far

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/f/f669eecef2223036c7f83d98c1a547d0f5eaad51.png)  
I’m only in 8th grade so all this math and index are very confusing

---

<div class="post-metadata">

**Author:** ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)\
**Post date:** [October 8, 2020, 2:17pm UTC](https://forum.makecode.com/t/is-there-any-shorter-way-i-can-do-this/3787/60 "2020-10-08T14:17:59Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/6/685a6e80cc0f5e919fbe8d411d52d78ca5379d14.png)  
I’m trying!! I am just so far away though

[Previous page](https://forum.makecode.com/t/is-there-any-shorter-way-i-can-do-this/3787.md?page=2)

[Next page](https://forum.makecode.com/t/is-there-any-shorter-way-i-can-do-this/3787.md?page=4)
