Questions tagged [zigzag]

The term "zigzag", in graphic design, describes a line composed of small lines in which any pattern of two small lines have the same length and form equal angles relative to any other patterns in the zigzag. The term also is the name of an encoding system for integers.

Zigzag offers an attractive and mention-able separators in some design approaches. The first Zigzag widely drawn was made by ancient Egyptian in hieroglyph writings.

zigzag example which depicts water.

From "Signed Types" on Encoding - Protocol Buffers - Google Code:

ZigZag encoding maps signed integers to unsigned integers so that numbers with a small absolute value (for instance, -1) have a small varint encoded value too. It does this in a way that "zig-zags" back and forth through the positive and negative integers, so that -1 is encoded as 1, 1 is encoded as 2, -2 is encoded as 3, and so on

55 questions
0
votes
1 answer

How to create zigzag movements in Python?

from tkinter import * def move(): global x1, y1, dx, dy, flag, n, z x1, y1 = x1 + dx, y1 + dy if x1 > 360: x1, dx, dy = 360, -15, 5 can1.itemconfig(oval1, fill = "purple") if x1 < 10: x1, dx, dy = 10, 15,…
Attila
  • 37
  • 1
  • 1
  • 7
-1
votes
4 answers

Looping through triplets for zigzag pattern

I am trying to see if groups of three with consecutive elements have a zigzag pattern. Add to an empty list "1" for a zig, "1" for a zag, or "0" for neither. It seems to satisfy my first "if" condition and my "else" statement but never the middle.…
-1
votes
1 answer

Can someone tell me the time complexity of my solution to this problem of zigag traversal

ZigZag traversal This is one of the question from algoexpert and this is my solution involving math def zigzagTraversal(arr): out = [] test = 1 out.append(arr[0][0]) while test <= len(arr)+len(arr[0]): for j in range(len(arr[0])): for i…
-1
votes
1 answer

Zigzag Line in Python

I'm trying to draw ZigZag line on another line. There are top and bottom points in my base line (price). I'm trying to connect the top and bottom points with a line. This is an example: This is my dataset: And this is how far I could go: Any…
iso_9001_
  • 2,655
  • 6
  • 31
  • 47
-1
votes
1 answer

Sum of array in a different way

Let assume I have an MxN array and I should sum this array like in image as shown below; Array sum I should sum all x's , all y's , all z's and all g's. I need an approach. My_Brain.exe has stopped and I couldn't find any approach to solve this…
Cello
  • 7
  • 5
-2
votes
1 answer

zig zag html css

I have a problem regarding HTML and CSS. Design include zig zag "border". Those zig-zag comes at the top and bottom of the page. Between those borders is white paper. Paper must be under zig-zag borders. Here is how it looks at the top of the page…
user812129
  • 43
  • 1
  • 3
  • 9
-2
votes
1 answer

How to make a vertical zig zag? That generates random letters ? As a beginner I'm not understanding

This is the line of code I have as a foundation of what I need to do. 1 #include 2 #include 3 #include 4 #include 5 6 7 8 int main() { 9 10 int num; 11 …
mick
  • 11
-3
votes
3 answers

Print elements of a matrix in diagonal stripes

I want to generate a matrix with consecutive numbers starting from 1, in this form zig zag matrix public static int[][] Zig_Zag(final int size) { int[][] data = new int[size][size]; int i = 1; int j = 1; for (int…
-4
votes
1 answer

Detecting zigzags in an array using python

I'm new to programming and studying python. I solved the following "zigzag" question using python language. You are given an array of integers and your task is to check all the triples of its consecutive elements for being a zigzag. zigzag- This…
ShanOH
  • 93
  • 2
1 2 3
4